Skip to content

Commit

Permalink
Merge pull request #62 from baynezy/feature/issue-61-sonar
Browse files Browse the repository at this point in the history
Fix sonar recommendations
  • Loading branch information
baynezy authored Feb 12, 2024
2 parents fe5e529 + a00084e commit c52db9a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Console/Factories/ConfigFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Console.Factories;

public class ConfigFactory
public static class ConfigFactory
{
public static IConfig Create(List<string> input)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Factories/LoggerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Console.Factories;

public class LoggerFactory
public static class LoggerFactory
{
public static ILogger Create(bool? logError)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Factories/WarmerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Console.Factories;

public class WarmerFactory
public static class WarmerFactory
{
public static Warmer Create(int? retries, IConfig config, IRequester requester, ILogger logger)
{
Expand Down
5 changes: 2 additions & 3 deletions src/SiteWarmer.Core/Logging/ConsoleLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SiteWarmer.Core.Logging;
/// </summary>
public class ConsoleLogger : ILogger
{
private static ConsoleColor _originalTextColour;
private static readonly ConsoleColor OriginalTextColour = Console.ForegroundColor;
private static readonly object LockObject = new();
private const ConsoleColor ErrorTextColour = ConsoleColor.Red;
private const ConsoleColor ContentFailTextColour = ConsoleColor.Yellow;
Expand All @@ -18,7 +18,6 @@ public class ConsoleLogger : ILogger
/// </summary>
public ConsoleLogger()
{
_originalTextColour = Console.ForegroundColor;
}

public void Log(Check check)
Expand Down Expand Up @@ -66,7 +65,7 @@ private static void WriteToConsoleInColour(Check check, string passed, ConsoleCo
{
Console.ForegroundColor = textColour;
WriteToConsole(check, passed);
Console.ForegroundColor = _originalTextColour;
Console.ForegroundColor = OriginalTextColour;
}
}

Expand Down

0 comments on commit c52db9a

Please sign in to comment.