Skip to content

Commit

Permalink
Code cleanup for quarterly release.
Browse files Browse the repository at this point in the history
  • Loading branch information
David McCarter committed Nov 2, 2023
1 parent a5dcdde commit 442caf6
Show file tree
Hide file tree
Showing 28 changed files with 89 additions and 181 deletions.
4 changes: 2 additions & 2 deletions source/6/dotNetTips.Spargine.6.Core/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-11-2020
//
// Last Modified By : David McCarter
// Last Modified On : 10-12-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="App.cs" company="McCarter Consulting">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand Down Expand Up @@ -221,7 +221,7 @@ public static ProcessorInformation GetProcessorInformation()
/// Determines whether user is administrator.
/// </summary>
/// <returns><c>true</c> if [is user administrator]; otherwise, <c>false</c>.</returns>
/// <exception cref="PlatformNotSupportedException"></exception>
/// <exception cref="System.PlatformNotSupportedException"></exception>
[Information(UnitTestCoverage = 100, Status = Status.Available, Documentation = "https://bit.ly/SpargineJun2021")]
public static bool IsUserAdministrator()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-12-2020
//
// Last Modified By : David McCarter
// Last Modified On : 08-01-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="Collection.cs" company="McCarter Consulting">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand All @@ -28,7 +28,6 @@ namespace DotNetTips.Spargine.Core.Collections.Generic;
[Information("Collection<T>.", "David McCarter", "11/12/2020")]
public class Collection<T> : List<T>
{
//TODO: IN V8, CHANGE TO INHERIT-COLLECTION<T>

/// <summary>
/// Prevents a default instance of the <see cref="Collection{T}" /> class from being created.
Expand Down
4 changes: 3 additions & 1 deletion source/6/dotNetTips.Spargine.6.Core/DataRecordComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-01-2021
//
// Last Modified By : David McCarter
// Last Modified On : 08-23-2022
// Last Modified On : 03-13-2023
// ***********************************************************************
// <copyright file="DataRecordComparer.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand All @@ -25,6 +25,7 @@ namespace DotNetTips.Spargine.Core;
/// <seealso cref="IEqualityComparer" />
public sealed class DataRecordComparer : IEqualityComparer<IDataRecord>
{

/// <summary>
/// Determines whether the specified objects are equal.
/// </summary>
Expand All @@ -45,4 +46,5 @@ public int GetHashCode([DisallowNull] IDataRecord obj)
{
return string.GetHashCode(obj.ArgumentNotNull().Id, StringComparison.Ordinal);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-11-2020
//
// Last Modified By : David McCarter
// Last Modified On : 09-28-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="PerformanceStopwatch.cs" company="McCarter Consulting">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand Down Expand Up @@ -159,7 +159,7 @@ public TimeSpan StopRestart(ILogger logger, string message)
/// GetUsers():Load users from database. Time: 1013.02 ms
/// GetUsers():Save users to database.Time: 1013.7925 ms
/// </example>
public ImmutableArray<string> Diagnostics => this._diagnostics.ToImmutableArray(); //TODO: CHANGE TO READONLYCOLLECTION
public ImmutableArray<string> Diagnostics => this._diagnostics.ToImmutableArray();

/// <summary>
/// Gets the title.
Expand Down
2 changes: 1 addition & 1 deletion source/6/dotNetTips.Spargine.6.Core/Enumeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 12-21-2020
//
// Last Modified By : David McCarter
// Last Modified On : 09-23-2023
// Last Modified On : 09-28-2023
// ***********************************************************************
// <copyright file="Enumeration.cs" company="McCarter Consulting">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand Down
62 changes: 31 additions & 31 deletions source/6/dotNetTips.Spargine.6.Core/ExceptionThrower.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions source/6/dotNetTips.Spargine.6.Core/LoggableException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 09-28-2020
//
// Last Modified By : David McCarter
// Last Modified On : 01-03-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="LoggableException.cs" company="dotNetTips.Spargine.Core">
// Copyright (c) McCarter Consulting. All rights reserved.
Expand Down Expand Up @@ -34,6 +34,7 @@ namespace DotNetTips.Spargine.Core;
[Serializable]
public class LoggableException : Exception
{

/// <summary>
/// The string builder pool
/// </summary>
Expand Down Expand Up @@ -89,7 +90,7 @@ public LoggableException(string message, [AllowNull] Exception innerException) :
public LoggableException(string message, [NotNull] Exception ex, [AllowNull] string userMessage) : base(message, ex) => this.UserMessage = userMessage;

/// <summary>
/// Return's a list of properties and their value using <see cref="ObjectPool&lt;StringBuilder&gt;"/> to improve performance.
/// Return's a list of properties and their value using <see cref="ObjectPool&lt;StringBuilder&gt;" /> to improve performance.
/// </summary>
/// <param name="ex">The ex.</param>
/// <returns>System.String.</returns>
Expand Down Expand Up @@ -157,8 +158,6 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
/// <value>The messages.</value>
public virtual string[] Messages()
{
//TODO: CHANGE TO READONLYCOLLECTION IN THE RETURN.

var exceptions = LoggingHelper.RetrieveAllExceptions(this);
var errorMessages = new List<string>();

Expand Down Expand Up @@ -200,4 +199,5 @@ public bool HasBeenLogged
/// </summary>
/// <value>The user message.</value>
public virtual string UserMessage { get; }

}
6 changes: 1 addition & 5 deletions source/6/dotNetTips.Spargine.6.Core/Logging/LoggingHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 09-28-2020
//
// Last Modified By : David McCarter
// Last Modified On : 10-12-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="LoggingHelper.cs" company="dotNetTips.Spargine.Core">
// Copyright (c) McCarter Consulting. All rights reserved.
Expand Down Expand Up @@ -150,8 +150,6 @@ public static void LogComputerInformation([NotNull] ILogger logger)
[Information(nameof(RetrieveAllExceptionMessages), UnitTestCoverage = 100, Status = Status.Available)]
public static string[] RetrieveAllExceptionMessages([NotNull] Exception exception)
{
//TODO: CHANGE TO READONLYCOLLECTION IN THE RETURN.

exception = exception.ArgumentNotNull();

var exceptions = RetrieveAllExceptions(exception);
Expand All @@ -175,8 +173,6 @@ public static string[] RetrieveAllExceptionMessages([NotNull] Exception exceptio
[Information(nameof(RetrieveAllExceptions), UnitTestCoverage = 100, Status = Status.Available)]
public static Exception[] RetrieveAllExceptions([NotNull] Exception exception)
{
//TODO: CHANGE TO READONLYCOLLECTION IN THE RETURN.

exception = exception.ArgumentNotNull();

var collection = new List<Exception> { exception };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 07-19-2021
//
// Last Modified By : David McCarter
// Last Modified On : 09-28-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="EncryptionHelper.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand Down Expand Up @@ -100,9 +100,6 @@ public static string AesDecrypt([NotNull] string cipherText, [NotNull] byte[] ke
[Information(nameof(AesEncrypt), "David McCarter", "7/19/2021", BenchMarkStatus = BenchMarkStatus.None, UnitTestCoverage = 100, Status = Status.Available, Documentation = "https://bit.ly/SpargineSep2021")]
public static string AesEncrypt([NotNull] string plainText, [NotNull] byte[] key, [NotNull] byte[] iv)
{

//TODO: Fix CA5401 Symmetric encryption uses non-default initialization vector, which could be potentially repeatable in version 8.

plainText = plainText.ArgumentNotNullOrEmpty(true);
key = key.ArgumentNotNull();
iv = iv.ArgumentNotNull();
Expand Down
2 changes: 1 addition & 1 deletion source/6/dotNetTips.Spargine.6.Core/Validator.Argument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-16-2022
//
// Last Modified By : David McCarter
// Last Modified On : 09-23-2023
// Last Modified On : 09-28-2023
// ***********************************************************************
// <copyright file="Validator.Argument.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand Down
6 changes: 3 additions & 3 deletions source/6/dotNetTips.Spargine.6.Core/Web/ServiceProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
// <copyright file="ServiceProxy.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
// </copyright>
// <summary>
// Creates a service proxy for types that implement ICommunicationObject.
// </summary>
// <summary>Creates a service proxy for types that implement ICommunicationObject.</summary>
// ***********************************************************************
using System.Diagnostics.CodeAnalysis;
using System.ServiceModel;
Expand All @@ -28,6 +26,7 @@ namespace DotNetTips.Spargine.Core.Web;
/// <seealso cref="IDisposable" />
public abstract class ServiceProxy<T> : IDisposable where T : ICommunicationObject
{

/// <summary>
/// The channel.
/// </summary>
Expand Down Expand Up @@ -141,4 +140,5 @@ public void Dispose()
// Unregister object for finalization.
GC.SuppressFinalize(this);
}

}
4 changes: 1 addition & 3 deletions source/6/dotNetTips.Spargine.6.Core/Web/WebHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 02-07-2021
//
// Last Modified By : David McCarter
// Last Modified On : 09-23-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="WebHelper.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand Down Expand Up @@ -71,8 +71,6 @@ public static async Task<string> DownloadStringAsync(Uri address, string clientI
[Information(nameof(HttpHeaderNames), "David McCarter", "9/2/2020", "9/2/2020", Status = Status.Available, UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.NotRequired)]
public static string[] HttpHeaderNames()
{
//TODO: CHANGE TO READONLYCOLLECTION IN THE RETURN.

return Enum.GetNames(typeof(HttpRequestHeader));
}

Expand Down
4 changes: 1 addition & 3 deletions source/6/dotNetTips.Spargine.6.Extensions/ArrayExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-21-2020
//
// Last Modified By : David McCarter
// Last Modified On : 09-23-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="ArrayExtensions.cs" company="dotNetTips.Spargine.6.Extensions">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand Down Expand Up @@ -45,8 +45,6 @@ public static class ArrayExtensions
[Information(nameof(Add), author: "David McCarter", createdOn: "4/28/2021", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.None, Status = Status.Available, Documentation = "https://bit.ly/SpargineJun2021")]
public static T[] Add<T>([NotNull] this T[] array, [AllowNull] T item)
{
//TODO: REMOVE METHOD IN V8. CHANGE CODE TO USE ADDFIRST() OR ADDLAST().

if (item is null)
{
return array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-21-2020
//
// Last Modified By : David McCarter
// Last Modified On : 01-15-2023
// Last Modified On : 10-23-2023
// ***********************************************************************
// <copyright file="CollectionExtensions.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 10-08-2020
//
// Last Modified By : David McCarter
// Last Modified On : 09-23-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="DataContextExtensions.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand All @@ -27,7 +27,6 @@ namespace DotNetTips.Spargine.Extensions;
public static class DataContextExtensions
{

//TODO: LOOK INTO REMOVING LINQTODB.
/// <summary>
/// Gets the tracked objects from a <see cref="DataContext" />.
/// Validates that <paramref name="context" /> is not null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 09-15-2017
//
// Last Modified By : David McCarter
// Last Modified On : 10-22-2023
// Last Modified On : 11-01-2023
// ***********************************************************************
// <copyright file="DateTimeExtensions.cs" company="David McCarter - dotNetTips.com">
// David McCarter - dotNetTips.com
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ***********************************************************************
// ***********************************************************************
// Assembly : DotNetTips.Spargine.6.Extensions
// Author : David McCarter
// Created : 10-08-2020
//
// Last Modified By : David McCarter
// Last Modified On : 07-17-2022
// Last Modified On : 03-13-2023
// ***********************************************************************
// <copyright file="DirectoryInfoExtensions.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand All @@ -23,6 +23,7 @@ namespace DotNetTips.Spargine.Extensions;
/// </summary>
public static class DirectoryInfoExtensions
{

/// <summary>
/// Gets the total size of files in a <see cref="DirectoryInfo" />.
/// Validates that <paramref name="path" /> and <paramref name="searchPattern" /> is not null
Expand All @@ -44,4 +45,5 @@ public static long GetSize([NotNull] this DirectoryInfo path, string searchPatte

return path.GetFiles(searchPattern, searchOption).Sum(p => p.Length);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 11-21-2020
//
// Last Modified By : David McCarter
// Last Modified On : 08-01-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="EnumerableExtensions.cs" company="dotNetTips.Spargine.6.Extensions">
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
Expand Down Expand Up @@ -34,6 +34,7 @@ namespace DotNetTips.Spargine.Extensions;
/// </summary>
public static class EnumerableExtensions
{

/// <summary>
/// The string builder pool
/// </summary>
Expand All @@ -60,8 +61,6 @@ private static int GenerateRandomNumber()
[Information(nameof(Add), "David McCarter", "11/21/2020", BenchMarkStatus = BenchMarkStatus.None, UnitTestCoverage = 100, Status = Status.Available, Documentation = "https://bit.ly/SpargineJun2021")]
public static IEnumerable<T> Add<T>([NotNull] this IEnumerable<T> collection, [AllowNull] T item)
{
//TODO: REMOVE METHOD IN V8. CREATE ADDFIRST() & ADDLAST() LIKE ARRAYEXTENSIONS.

if (item is null)
{
return collection;
Expand Down Expand Up @@ -980,4 +979,5 @@ public static IEnumerable<T> Upsert<T>([NotNull] this IEnumerable<T> collection,

return items;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace DotNetTips.Spargine.Extensions;
/// </summary>
public static class SortedSetExtensions
{

/// <summary>
/// Checks set for null and ensures there are items in the set.
/// </summary>
Expand Down Expand Up @@ -97,4 +98,5 @@ public static ImmutableSortedSet<T> ToImmutable<T>([NotNull] this SortedSet<T> c
{
return ImmutableSortedSet.CreateRange(collection.ArgumentNotNull());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Created : 05-11-2020
//
// Last Modified By : David McCarter
// Last Modified On : 03-13-2023
// Last Modified On : 11-02-2023
// ***********************************************************************
// <copyright file="StringBuilderExtensions.cs" company="David McCarter - dotNetTips.com">
// McCarter Consulting (David McCarter)
Expand Down Expand Up @@ -41,7 +41,6 @@ private static string SetSeparator(string separator)
{
if (separator.HasValue() is false)
{
//TODO: THIS CONDITION NOT BEING TESTED
separator = ControlChars.DefaultSeparator;
}

Expand Down Expand Up @@ -114,7 +113,6 @@ public static void AppendKeyValue([NotNull] this StringBuilder sb, [NotNull] str

if (specialIndex >= 0)
{
//TODO: THIS CONDITION NOT BEING TESTED FOR APPEND
_ = sb.Append(value, lastSpecialIndex, specialIndex - lastSpecialIndex);
_ = sb.Append(ControlChars.Backslash);
_ = sb.Append(value[specialIndex]);
Expand All @@ -130,7 +128,6 @@ public static void AppendKeyValue([NotNull] this StringBuilder sb, [NotNull] str
}
else
{
//TODO: THIS CONDITION NOT BEING TESTED
_ = sb.Append(value);
}

Expand Down
Loading

0 comments on commit 442caf6

Please sign in to comment.