Skip to content

Commit

Permalink
Fix #1594: FxCopConverter produces invalid SARIF.
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Golding committed Aug 12, 2019
1 parent feb1953 commit b026c6e
Show file tree
Hide file tree
Showing 4 changed files with 33,297 additions and 36,990 deletions.
9 changes: 9 additions & 0 deletions src/Sarif.Converters/ConverterResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Sarif.Converters/ConverterResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,7 @@
<data name="ContrastSecuritySiteRootDescription" xml:space="preserve">
<value>The root URI of the web site that was analyzed.</value>
</data>
<data name="FxCopNoMessage" xml:space="preserve">
<value>FxCop does not provide messages for suppressed results.</value>
</data>
</root>
3 changes: 2 additions & 1 deletion src/Sarif.Converters/FxCopConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ internal Result CreateResult(FxCopLogReader.Context context)
}

result.RuleId = context.CheckId;
result.Message = new Message { Arguments = context.Items, Id = context.ResolutionName, Text = context.Message };
string messageText = context.Message ?? ConverterResources.FxCopNoMessage;
result.Message = new Message { Arguments = context.Items, Id = context.ResolutionName, Text = messageText };
var location = new Location();

string sourceFile = GetFilePath(context);
Expand Down
70,272 changes: 33,283 additions & 36,989 deletions src/Test.FunctionalTests.Sarif/v2/ConverterTestData/FxCop/SarifSdkTest.xml.sarif

Large diffs are not rendered by default.

0 comments on commit b026c6e

Please sign in to comment.