Skip to content

Commit

Permalink
Fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Werkman committed Feb 14, 2025
1 parent d913289 commit 7e03bca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
13 changes: 0 additions & 13 deletions src/Stryker.Core/Stryker.Core/StrykerRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,4 @@ private IReadOnlyProjectComponent AddRootFolderIfMultiProject(IEnumerable<IReadO

return projectComponents.FirstOrDefault();
}

private bool Test(int x, int y)
{
if (x == y)
{
y++;
}
if (y == 0)
{
return true;
}
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public static IEnumerable<ISourceGenerator> GetSourceGenerators(this IAnalyzerRe
catch (Exception e)
{
logger?.LogWarning(e,
$"Analyzer/Generator assembly {analyzer} could not be loaded. {Environment.NewLine}" +
"Generated source code may be missing.");
@"Analyzer/Generator assembly {analyzer} could not be loaded.
Generated source code may be missing.", analyzer);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text;
using Mono.Cecil;

Expand Down Expand Up @@ -155,12 +156,10 @@ private static Dictionary<string, string> CreateTrustedPlatformAssemblyMap()
return result;
}

foreach (var path in paths.Split(Path.PathSeparator))
foreach (var path in paths.Split(Path.PathSeparator)
.Where(path => string.Equals(Path.GetExtension(path), ".dll", StringComparison.OrdinalIgnoreCase)))
{
if (string.Equals(Path.GetExtension(path), ".dll", StringComparison.OrdinalIgnoreCase))
{
result[Path.GetFileNameWithoutExtension(path)] = path;
}
result[Path.GetFileNameWithoutExtension(path)] = path;
}

return result;
Expand Down

0 comments on commit 7e03bca

Please sign in to comment.