Skip to content

Commit

Permalink
chore: fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dupdob committed Mar 19, 2024
1 parent e90f022 commit 2a31da4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private static SyntaxNode FindEnclosingMember(SyntaxNode node)
return currentNode;
}
}
// return the all file if not found
// return the whole file if not found
return node.SyntaxTree.GetRoot();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ private CSharpCompilation GetCSharpCompilation(IEnumerable<SyntaxTree> syntaxTre
null),
options: emitOptions);
}
catch (NullReferenceException)
#pragma warning disable S1696 // this catches an exception raised by the C# compiler
catch (NullReferenceException e)
{
_logger.LogError("Roslyn C# compiler raised an NullReferenceException. This is a known Roslyn's issue that may be triggered by invalid usage of conditional access expression.");
_logger.LogInformation("Exception: {0}", e);
_logger.LogError("Stryker will attempt to skip problematic files.");
compilation = ScanForCauseOfException(compilation);
EmbeddedResourcesGenerator.ResetCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,14 @@ protected override ExpressionSyntax OrchestrateChildrenMutation(InvocationExpres
subContext.Leave();
return result;
}
if (original == node.ArgumentList)
else
{
//The argument list can be freely mutated,
var subContext = context.Enter(MutationControl.Member);
var result = subContext.Mutate(original, semanticModel);
subContext.Leave();
return result;
}
else
{
return context.Mutate(original, semanticModel);
}
});
return mutated;
}
Expand Down

0 comments on commit 2a31da4

Please sign in to comment.