diff --git a/README.md b/README.md index b54fb62d..e9f94c4f 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ It is possible to process several reports at the same time: `NVika parsereport r ## Analysis tools ### Supported - [InspectCode](https://chocolatey.org/packages/resharper-clt): example of usage `inspectcode /o="inspectcodereport.xml" "Vika.sln"` - - Analyzers producing [SARIF](http://sarifweb.azurewebsites.net) format, like Roslyn analyzers: for those you need to add an `ErrorLog` node in your `csproj` containing the path of the report, or an `/errorlog:` switch for `csc`; See [NVika.csproj](https://github.com/laedit/vika/blob/master/src/NVika/NVika.csproj) + - Analyzers producing [SARIF](http://sarifweb.azurewebsites.net) format, like Roslyn analyzers: for those you need to add an `ErrorLog` node in your `csproj` containing the path of the report followed by `;version=2` in order to produce a SARIF 2.1 version report, or an `/errorlog:;version=2` switch for `csc`; See [NVika.csproj](https://github.com/laedit/vika/blob/master/src/NVika/NVika.csproj) - [FxCop](https://msdn.microsoft.com/en-us/library/bb429476(v=vs.80).aspx): example of usage `fxcopcmd /file:NVika.dll /out:FxCopResults.xml`. Or activate Code Analysis in the corresponding tab of your project properties in Visual Studio. - [Mono.Gendarme](http://www.mono-project.com/docs/tools+libraries/tools/gendarme/): example of usafe `gendarme --xml GendarmeReport.xml "\GendarmeTest.exe"` @@ -55,7 +55,7 @@ It is possible to process several reports at the same time: `NVika parsereport r - [ContinuaCI](https://github.com/laedit/vika/issues/3)? - [MyGet](https://github.com/laedit/vika/issues/5)? -I really wondering if there is any value to supporting these three, because there doesn't support to add build message like AppVeyor but only log message. +I am really wondering if there is any value to supporting these three, because there doesn't support to add build message like AppVeyor but only log message. And they support custom HTML report, so an xslt transformation is enough. ## What it will be diff --git a/build/build.fsx b/build/build.fsx index 48766de0..a767ca0d 100644 --- a/build/build.fsx +++ b/build/build.fsx @@ -37,29 +37,17 @@ Target "RestorePackages" (fun _ -> ) Target "BeginSonarQube" (fun _ -> - "msbuild-sonarqube-runner" |> Choco.Install id + "sonarscanner-msbuild-net46" |> Choco.Install id - SonarQube Begin (fun p -> - {p with - ToolsPath = "MSBuild.SonarQube.Runner.exe" - Key = "laedit_vika" - Name = "Vika" - Version = version - Settings = [ - "sonar.host.url=https://sonarcloud.io"; - "sonar.login=" + environVar "SonarQube_Token"; - "sonar.projectDescription=\"Visual Interpreter of Kooky Analysis: parse analysis reports and send messages to the build server, or in console.\""; - "sonar.links.homepage=https://github.com/laedit/vika"; - "sonar.links.ci=https://ci.appveyor.com/project/laedit/vika"; - "sonar.links.issue=https://github.com/laedit/vika/issues"; - "sonar.organization=laedit-github" - ] }) + directExec(fun info -> + info.FileName <- "SonarScanner.MSBuild.exe" + info.Arguments <- "begin /k:\"laedit_vika\" /n:\"Vika\" /o:laedit-github /v:\"" + version + "\" /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=" + environVar "SonarQube_Token" + " /d:sonar.projectDescription=\"Visual Interpreter of Kooky Analysis: parse analysis reports and send messages to the build server, or in console.\" /d:sonar.links.homepage=https://github.com/laedit/vika /d:sonar.links.ci=https://ci.appveyor.com/project/laedit/vika /d:sonar.links.issue=https://github.com/laedit/vika/issues" ) |> ignore ) Target "EndSonarQube" (fun _ -> SonarQube End (fun p -> {p with - ToolsPath = "MSBuild.SonarQube.Runner.exe" + ToolsPath = "SonarScanner.MSBuild.exe" Settings = [ "sonar.login=" + environVar "SonarQube_Token" ] }) ) @@ -75,7 +63,7 @@ Target "InspectCodeAnalysis" (fun _ -> directExec(fun info -> info.FileName <- "inspectcode" - info.Arguments <- "/o=\"" + artifactsDir + "inspectcodereport.xml\" /project=\"NVika\" \"src\Vika.sln\"" ) |> ignore + info.Arguments <- "-o=\"" + artifactsDir + "inspectcodereport.xml\" --project=\"NVika\" \"src\Vika.sln\" --toolset=14.0" ) |> ignore ) let saveGendarmeReportAsGist report = diff --git a/src/NVika.Tests/Data/static-analysis.sarif.json b/src/NVika.Tests/Data/static-analysis.sarif.json index 4a4076cd..27e59ee4 100644 --- a/src/NVika.Tests/Data/static-analysis.sarif.json +++ b/src/NVika.Tests/Data/static-analysis.sarif.json @@ -1,77 +1,79 @@ { - "$schema": "http://json.schemastore.org/sarif-1.0.0", - "version": "1.0.0", + "$schema": "http://json.schemastore.org/sarif-2.1.0", + "version": "2.1.0", "runs": [ { - "tool": { - "name": "Microsoft (R) Visual C# Compiler", - "version": "1.3.1.0", - "fileVersion": "1.3.1.60616", - "semanticVersion": "1.3.1", - "language": "en-US" - }, "results": [ { - "ruleId": "CS0649", + "ruleId": "S1118", + "ruleIndex": 0, "level": "warning", - "message": "Field 'Program._commands' is never assigned to, and will always have its default value null", - "suppressionStates": [ - "suppressedInSource" - ], + "message": { + "text": "Add a 'protected' constructor or the 'static' keyword to the class declaration." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Program.cs" + }, "region": { - "startLine": 48, - "startColumn": 45, - "endLine": 48, - "endColumn": 54 + "startLine": 5, + "startColumn": 11, + "endLine": 5, + "endColumn": 18 } } } ], "properties": { - "warningLevel": 4 + "warningLevel": 1 } }, { - "ruleId": "CS0649", + "ruleId": "S1128", + "ruleIndex": 1, "level": "warning", - "message": "Field 'Program._logger' is never assigned to, and will always have its default value null", - "suppressionStates": [ - "suppressedInSource" - ], + "message": { + "text": "Remove this unnecessary 'using'." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/BuildServers/IBuildServer.cs" + }, "region": { - "startLine": 45, - "startColumn": 24, - "endLine": 45, - "endColumn": 31 + "startLine": 2, + "startColumn": 1, + "endLine": 2, + "endColumn": 26 } } } ], "properties": { - "warningLevel": 4 + "warningLevel": 1 } }, { - "ruleId": "CC0021", + "ruleId": "S3871", + "ruleIndex": 2, "level": "warning", - "message": "Use 'nameof(AppVeyor)' instead of specifying the program element name.", + "message": { + "text": "Make this exception 'public'." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/AppVeyor.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Exceptions/NVikaException.cs" + }, "region": { - "startLine": 20, - "startColumn": 26, - "endLine": 20, - "endColumn": 36 + "startLine": 6, + "startColumn": 29, + "endLine": 6, + "endColumn": 43 } } } @@ -81,18 +83,23 @@ } }, { - "ruleId": "CC0001", + "ruleId": "S1128", + "ruleIndex": 1, "level": "warning", - "message": "Use 'var' instead of specifying the type name.", + "message": { + "text": "Remove this unnecessary 'using'." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/LocalBuildServer.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/IReportParser.cs" + }, "region": { - "startLine": 30, - "startColumn": 13, - "endLine": 30, - "endColumn": 19 + "startLine": 2, + "startColumn": 1, + "endLine": 2, + "endColumn": 26 } } } @@ -102,18 +109,23 @@ } }, { - "ruleId": "CC0021", - "level": "warning", - "message": "Use 'nameof(Issue)' instead of specifying the program element name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 31, - "startColumn": 43, - "endLine": 31, - "endColumn": 50 + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 38 } } } @@ -123,18 +135,23 @@ } }, { - "ruleId": "CC0105", - "level": "warning", - "message": "Use 'var' instead of specifying the type name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/ParseReportCommand.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 43, - "startColumn": 13, - "endLine": 43, - "endColumn": 16 + "startLine": 2, + "startColumn": 1, + "endLine": 2, + "endColumn": 46 } } } @@ -144,60 +161,75 @@ } }, { - "ruleId": "CC0030", + "ruleId": "CC0037", + "ruleIndex": 3, "level": "note", - "message": "This variables can be made const.", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 38, - "startColumn": 13, - "endLine": 38, - "endColumn": 23 + "startLine": 3, + "startColumn": 1, + "endLine": 3, + "endColumn": 25 } } } ], "properties": { - "warningLevel": 4 + "warningLevel": 1 } }, { - "ruleId": "CC0048", + "ruleId": "CC0037", + "ruleIndex": 3, "level": "note", - "message": "Use string interpolation", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/AppVeyor.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 42, - "startColumn": 27, - "endLine": 42, - "endColumn": 76 + "startLine": 4, + "startColumn": 1, + "endLine": 4, + "endColumn": 30 } } } ], "properties": { - "warningLevel": 4 + "warningLevel": 1 } }, { - "ruleId": "CC0001", - "level": "warning", - "message": "Use 'var' instead of specifying the type name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/AppVeyor.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 45, - "startColumn": 13, - "endLine": 45, - "endColumn": 19 + "startLine": 5, + "startColumn": 1, + "endLine": 5, + "endColumn": 32 } } } @@ -207,17 +239,48 @@ } }, { - "ruleId": "CC0001", - "level": "warning", - "message": "Use 'var' instead of specifying the type name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/AppVeyor.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 57, - "startColumn": 13, - "endLine": 57, + "startLine": 6, + "startColumn": 1, + "endLine": 6, + "endColumn": 36 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 7, + "startColumn": 1, + "endLine": 7, "endColumn": 19 } } @@ -228,18 +291,23 @@ } }, { - "ruleId": "CC0001", - "level": "warning", - "message": "Use 'var' instead of specifying the type name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/BuildServers/AppVeyor.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 85, - "startColumn": 17, - "endLine": 85, - "endColumn": 39 + "startLine": 8, + "startColumn": 1, + "endLine": 8, + "endColumn": 21 } } } @@ -249,18 +317,153 @@ } }, { - "ruleId": "CC0021", - "level": "warning", - "message": "Use 'nameof(Issue)' instead of specifying the program element name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 12, + "startColumn": 1, + "endLine": 12, + "endColumn": 59 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 18, + "startColumn": 1, + "endLine": 18, + "endColumn": 79 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 30, + "startColumn": 1, + "endLine": 30, + "endColumn": 99 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 33, + "startColumn": 1, + "endLine": 33, + "endColumn": 61 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 34, + "startColumn": 1, + "endLine": 34, + "endColumn": 49 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { "startLine": 40, - "startColumn": 59, + "startColumn": 1, "endLine": 40, - "endColumn": 66 + "endColumn": 73 } } } @@ -270,18 +473,23 @@ } }, { - "ruleId": "CC0021", - "level": "warning", - "message": "Use 'nameof(Offset)' instead of specifying the program element name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { "startLine": 44, - "startColumn": 59, + "startColumn": 1, "endLine": 44, - "endColumn": 67 + "endColumn": 77 } } } @@ -291,18 +499,23 @@ } }, { - "ruleId": "CC0021", - "level": "warning", - "message": "Use 'nameof(Name)' instead of specifying the program element name.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 49, - "startColumn": 53, - "endLine": 49, - "endColumn": 59 + "startLine": 47, + "startColumn": 1, + "endLine": 47, + "endColumn": 88 } } } @@ -312,39 +525,49 @@ } }, { - "ruleId": "CC0048", + "ruleId": "CC0037", + "ruleIndex": 3, "level": "note", - "message": "Use string interpolation", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 64, - "startColumn": 29, - "endLine": 64, - "endColumn": 93 + "startLine": 51, + "startColumn": 1, + "endLine": 51, + "endColumn": 35 } } } ], "properties": { - "warningLevel": 4 + "warningLevel": 1 } }, { - "ruleId": "S1940", - "level": "error", - "message": "Use the opposite operator (\"!=\") instead.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 39, - "startColumn": 17, - "endLine": 39, - "endColumn": 26 + "startLine": 52, + "startColumn": 1, + "endLine": 52, + "endColumn": 72 } } } @@ -354,42 +577,205 @@ } }, { - "ruleId": "CC0022", - "level": "warning", - "message": "CompositionContainer should be disposed.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 54, + "startColumn": 1, + "endLine": 54, + "endColumn": 46 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 55, + "startColumn": 1, + "endLine": 55, + "endColumn": 76 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 57, + "startColumn": 1, + "endLine": 57, + "endColumn": 60 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 71, + "startColumn": 1, + "endLine": 71, + "endColumn": 39 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Program.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 78, + "startColumn": 1, + "endLine": 78, + "endColumn": 48 + } + } + } + ], + "properties": { + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { "startLine": 82, - "startColumn": 33, + "startColumn": 1, "endLine": 82, - "endColumn": 64 + "endColumn": 99 } } } ], "properties": { - "warningLevel": 1, - "customProperties": { - "typeName": "CompositionContainer" + "warningLevel": 1 + } + }, + { + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, + "region": { + "startLine": 85, + "startColumn": 1, + "endLine": 85, + "endColumn": 31 + } + } } + ], + "properties": { + "warningLevel": 1 } }, { - "ruleId": "CC0091", - "level": "warning", - "message": "Make 'GetUri' method static.", + "ruleId": "CC0037", + "ruleIndex": 3, + "level": "note", + "message": { + "text": "Commented code should be removed." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 65, - "startColumn": 21, - "endLine": 65, - "endColumn": 27 + "startLine": 90, + "startColumn": 1, + "endLine": 90, + "endColumn": 29 } } } @@ -399,18 +785,23 @@ } }, { - "ruleId": "CC0091", + "ruleId": "S125", + "ruleIndex": 4, "level": "warning", - "message": "Make 'GetSeverity' method static.", + "message": { + "text": "Remove this commented out code." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 97, - "startColumn": 31, - "endLine": 97, - "endColumn": 42 + "startLine": 1, + "startColumn": 1, + "endLine": 1, + "endColumn": 38 } } } @@ -420,18 +811,23 @@ } }, { - "ruleId": "CC0091", + "ruleId": "S1134", + "ruleIndex": 5, "level": "warning", - "message": "Make 'GetLine' method static.", + "message": { + "text": "Take the required action to fix the issue indicated by this 'FIXME' comment." + }, "locations": [ { - "resultFile": { - "uri": "file:///D:/Prog/Github/vika/src/NVika/Parsers/InspectCodeParser.cs", + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/SarifParser.cs" + }, "region": { - "startLine": 112, - "startColumn": 23, - "endLine": 112, - "endColumn": 30 + "startLine": 44, + "startColumn": 72, + "endLine": 44, + "endColumn": 77 } } } @@ -439,111 +835,413 @@ "properties": { "warningLevel": 1 } - } - ], - "rules": { - "CC0001": { - "id": "CC0001", - "shortDescription": "You should use 'var' whenever possible.", - "fullDescription": "Usage of an implicit type improve readability of the code.\u000d\u000aCode depending on types for their readability should be refactored with better variable names or by introducing well-named methods.", - "defaultLevel": "warning", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0001.html", + }, + { + "ruleId": "CC0057", + "ruleIndex": 6, + "level": "warning", + "message": { + "text": "Parameter 'args' is not used." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Program.cs" + }, + "region": { + "startLine": 7, + "startColumn": 26, + "endLine": 7, + "endColumn": 39 + } + } + } + ], "properties": { - "category": "Style", - "isEnabledByDefault": true + "warningLevel": 1, + "customProperties": { + "identifier": "args" + } } }, - "CC0021": { - "id": "CC0021", - "shortDescription": "Use nameof", - "fullDescription": "In C#6 the nameof() operator should be used to specify the name of a program element instead of a string literal as it produce code that is easier to refactor.", - "defaultLevel": "warning", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0021.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Issue)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/FxCopParser.cs" + }, + "region": { + "startLine": 34, + "startColumn": 56, + "endLine": 34, + "endColumn": 63 + } + } + } + ], "properties": { - "category": "Design", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CC0022": { - "id": "CC0022", - "shortDescription": "Should dispose object", - "fullDescription": "When a disposable object is created it should be disposed as soon as possible.\u000aThis warning will appear if you create a disposable object and don't store, return or dispose it.", - "defaultLevel": "warning", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0022.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Issue)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/InspectCodeParser.cs" + }, + "region": { + "startLine": 30, + "startColumn": 59, + "endLine": 30, + "endColumn": 66 + } + } + } + ], "properties": { - "category": "Usage", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CC0030": { - "id": "CC0030", - "shortDescription": "Make Local Variable Constant.", - "fullDescription": "This variable is assigned a constant value and never changed it can be made 'const'", - "defaultLevel": "note", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0030.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Offset)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/InspectCodeParser.cs" + }, + "region": { + "startLine": 34, + "startColumn": 59, + "endLine": 34, + "endColumn": 67 + } + } + } + ], "properties": { - "category": "Performance", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CC0048": { - "id": "CC0048", - "shortDescription": "Use string interpolation instead of String.Format", - "fullDescription": "String interpolation allows for better reading of the resulting string when compared to String.Format. You should use String.Format only when another method is supplying the format string.", - "defaultLevel": "note", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0048.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Name)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/InspectCodeParser.cs" + }, + "region": { + "startLine": 39, + "startColumn": 53, + "endLine": 39, + "endColumn": 59 + } + } + } + ], "properties": { - "category": "Style", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CC0091": { - "id": "CC0091", - "shortDescription": "Use static method", - "fullDescription": "If the method is not referencing any instance variable and if you are not creating a virtual, abstract, new or partial method, and if it is not a method override, your instance method may be changed to a static method.", - "defaultLevel": "warning", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0091.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Name)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/FxCopParser.cs" + }, + "region": { + "startLine": 39, + "startColumn": 52, + "endLine": 39, + "endColumn": 58 + } + } + } + ], "properties": { - "category": "Design", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CC0105": { - "id": "CC0105", - "shortDescription": "You should use 'var' whenever possible.", - "fullDescription": "Usage of an implicit type improve readability of the code.\u000d\u000aCode depending on types for their readability should be refactored with better variable names or by introducing well-named methods.", - "defaultLevel": "warning", - "helpUri": "https://code-cracker.github.io/diagnostics/CC0105.html", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Name)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/GendarmeParser.cs" + }, + "region": { + "startLine": 35, + "startColumn": 52, + "endLine": 35, + "endColumn": 58 + } + } + } + ], "properties": { - "category": "Style", - "isEnabledByDefault": true + "warningLevel": 1 } }, - "CS0649": { - "id": "CS0649", - "shortDescription": "Field is never assigned to, and will always have its default value", - "defaultLevel": "warning", + { + "ruleId": "S4524", + "ruleIndex": 8, + "level": "warning", + "message": { + "text": "Move this 'default:' case to the beginning or end of this 'switch' statement." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/GendarmeParser.cs" + }, + "region": { + "startLine": 67, + "startColumn": 17, + "endLine": 67, + "endColumn": 25 + } + } + } + ], "properties": { - "category": "Compiler", - "isEnabledByDefault": true, - "tags": [ - "Compiler", - "Telemetry" - ] + "warningLevel": 1 } }, - "S1940": { - "id": "S1940", - "shortDescription": "Boolean checks should not be inverted", - "fullDescription": "It is needlessly complex to invert the result of a boolean comparison. The opposite comparison should be made instead.", - "defaultLevel": "warning", - "helpUri": "http://vs.sonarlint.org/rules/index.html#version=1.16.0&ruleId=S1940", + { + "ruleId": "CC0021", + "ruleIndex": 7, + "level": "warning", + "message": { + "text": "Use 'nameof(Name)' instead of specifying the program element name." + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///C:/Users/jerem/source/repos/Vika/NVika/Parsers/GendarmeParser.cs" + }, + "region": { + "startLine": 79, + "startColumn": 74, + "endLine": 79, + "endColumn": 80 + } + } + } + ], "properties": { - "category": "Maintainability", - "isEnabledByDefault": true + "warningLevel": 1 } } - } + ], + "tool": { + "driver": { + "name": "Microsoft (R) Visual C# Compiler", + "version": "3.8.0-4.20503.2 (75d31ee9)", + "dottedQuadFileVersion": "3.8.0.0", + "semanticVersion": "3.8.0", + "language": "en-US", + "rules": [ + { + "id": "S1118", + "shortDescription": { + "text": "Utility classes should not have public constructors" + }, + "fullDescription": { + "text": "Utility classes, which are collections of static members, are not meant to be instantiated." + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-1118", + "properties": { + "category": "Major Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + }, + { + "id": "S1128", + "shortDescription": { + "text": "Unused \"using\" should be removed" + }, + "fullDescription": { + "text": "Although unnecessary using won't change anything to the produced application, removing them:" + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-1128", + "properties": { + "category": "Minor Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + }, + { + "id": "S3871", + "shortDescription": { + "text": "Exception types should be \"public\"" + }, + "fullDescription": { + "text": "The point of having custom exception types is to convey more information than is available in standard types. But custom exception types must be public for that to work. " + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-3871", + "properties": { + "category": "Critical Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + }, + { + "id": "CC0037", + "shortDescription": { + "text": "Remove commented code." + }, + "defaultConfiguration": { + "level": "note" + }, + "helpUri": "https://code-cracker.github.io/diagnostics/CC0037.html", + "properties": { + "category": "Style" + } + }, + { + "id": "S125", + "shortDescription": { + "text": "Sections of code should not be commented out" + }, + "fullDescription": { + "text": "Programmers should not comment out code as it bloats programs and reduces readability." + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-125", + "properties": { + "category": "Major Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + }, + { + "id": "S1134", + "shortDescription": { + "text": "Track uses of \"FIXME\" tags" + }, + "fullDescription": { + "text": "FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later." + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-1134", + "properties": { + "category": "Major Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + }, + { + "id": "CC0057", + "shortDescription": { + "text": "Unused parameters" + }, + "fullDescription": { + "text": "A method with an unused parameter creates unnecessary confusion and should be deleted." + }, + "helpUri": "https://code-cracker.github.io/diagnostics/CC0057.html", + "properties": { + "category": "Usage", + "tags": [ + "Unnecessary" + ] + } + }, + { + "id": "CC0021", + "shortDescription": { + "text": "Use nameof" + }, + "fullDescription": { + "text": "In C#6 the nameof() operator should be used to specify the name of a program element instead of a string literal as it produce code that is easier to refactor." + }, + "helpUri": "https://code-cracker.github.io/diagnostics/CC0021.html", + "properties": { + "category": "Design" + } + }, + { + "id": "S4524", + "shortDescription": { + "text": "\"default\" clauses should be first or last" + }, + "fullDescription": { + "text": "switch can contain a default clause for various reasons: to handle unexpected values, to show that all the cases were properly considered." + }, + "helpUri": "https://rules.sonarsource.com/csharp/RSPEC-4524", + "properties": { + "category": "Critical Code Smell", + "tags": [ + "C#", + "SonarWay", + "MainSourceScope", + "TestSourceScope" + ] + } + } + ] + } + }, + "columnKind": "utf16CodeUnits" } ] } \ No newline at end of file diff --git a/src/NVika.Tests/Parsers/SarifParserTest.cs b/src/NVika.Tests/Parsers/SarifParserTest.cs index 3a5a5322..07e227c2 100644 --- a/src/NVika.Tests/Parsers/SarifParserTest.cs +++ b/src/NVika.Tests/Parsers/SarifParserTest.cs @@ -1,4 +1,4 @@ -using NVika.Parsers; +using NVika.Parsers; using System.Collections.Generic; using System.IO.Abstractions.TestingHelpers; using System.Linq; @@ -65,62 +65,76 @@ public void Parse() var results = parser.Parse("static-analysis.sarif.json").ToList(); // assert - Assert.Equal(18, results.Count); + Assert.Equal(41, results.Count); var issue = results[0]; - Assert.Equal("Design", issue.Category); - Assert.Equal("Use nameof", issue.Description); - Assert.Equal(@"D:\Prog\Github\vika\src\NVika\BuildServers\AppVeyor.cs", issue.FilePath); - Assert.Equal("https://code-cracker.github.io/diagnostics/CC0021.html", issue.HelpUri.AbsoluteUri); - Assert.Equal(20u, issue.Line); - Assert.Equal("Use 'nameof(AppVeyor)' instead of specifying the program element name.", issue.Message); - Assert.Equal("CC0021", issue.Name); - Assert.Equal(26u, issue.Offset.Start); - Assert.Equal(36u, issue.Offset.End); + Assert.Equal("Major Code Smell", issue.Category); + Assert.Equal("Utility classes should not have public constructors", issue.Description); + Assert.Equal(@"C:\Users\jerem\source\repos\Vika\NVika\Program.cs", issue.FilePath); + Assert.Equal("https://rules.sonarsource.com/csharp/RSPEC-1118", issue.HelpUri.AbsoluteUri); + Assert.Equal(5u, issue.Line); + Assert.Equal("Add a 'protected' constructor or the 'static' keyword to the class declaration.", issue.Message); + Assert.Equal("S1118", issue.Name); + Assert.Equal(11u, issue.Offset.Start); + Assert.Equal(18u, issue.Offset.End); Assert.Null(issue.Project); Assert.Equal(IssueSeverity.Warning, issue.Severity); Assert.Equal("SARIF", issue.Source); issue = results[12]; Assert.Equal("Style", issue.Category); - Assert.Equal("Use string interpolation instead of String.Format", issue.Description); - Assert.Equal(@"D:\Prog\Github\vika\src\NVika\Program.cs", issue.FilePath); - Assert.Equal("https://code-cracker.github.io/diagnostics/CC0048.html", issue.HelpUri.AbsoluteUri); - Assert.Equal(64u, issue.Line); - Assert.Equal("Use string interpolation", issue.Message); - Assert.Equal("CC0048", issue.Name); - Assert.Equal(29u, issue.Offset.Start); - Assert.Equal(93u, issue.Offset.End); + Assert.Equal("Remove commented code.", issue.Description); + Assert.Equal(@"C:\Users\jerem\source\repos\Vika\NVika\Parsers\SarifParser.cs", issue.FilePath); + Assert.Equal("https://code-cracker.github.io/diagnostics/CC0037.html", issue.HelpUri.AbsoluteUri); + Assert.Equal(12u, issue.Line); + Assert.Equal("Commented code should be removed.", issue.Message); + Assert.Equal("CC0037", issue.Name); + Assert.Equal(1u, issue.Offset.Start); + Assert.Equal(59u, issue.Offset.End); Assert.Null(issue.Project); Assert.Equal(IssueSeverity.Suggestion, issue.Severity); Assert.Equal("SARIF", issue.Source); - issue = results[13]; - Assert.Equal("Maintainability", issue.Category); - Assert.Equal("Boolean checks should not be inverted", issue.Description); - Assert.Equal(@"D:\Prog\Github\vika\src\NVika\Program.cs", issue.FilePath); - Assert.Equal("http://vs.sonarlint.org/rules/index.html#version=1.16.0&ruleId=S1940", issue.HelpUri.AbsoluteUri); - Assert.Equal(39u, issue.Line); - Assert.Equal("Use the opposite operator (\"!=\") instead.", issue.Message); - Assert.Equal("S1940", issue.Name); - Assert.Equal(17u, issue.Offset.Start); + issue = results[3]; + Assert.Equal("Minor Code Smell", issue.Category); + Assert.Equal("Unused \"using\" should be removed", issue.Description); + Assert.Equal(@"C:\Users\jerem\source\repos\Vika\NVika\Parsers\IReportParser.cs", issue.FilePath); + Assert.Equal("https://rules.sonarsource.com/csharp/RSPEC-1128", issue.HelpUri.AbsoluteUri); + Assert.Equal(2u, issue.Line); + Assert.Equal("Remove this unnecessary 'using'.", issue.Message); + Assert.Equal("S1128", issue.Name); + Assert.Equal(1u, issue.Offset.Start); Assert.Equal(26u, issue.Offset.End); Assert.Null(issue.Project); - Assert.Equal(IssueSeverity.Error, issue.Severity); + Assert.Equal(IssueSeverity.Warning, issue.Severity); + Assert.Equal("SARIF", issue.Source); + + issue = results[33]; + Assert.Equal("Design", issue.Category); + Assert.Equal("Use nameof", issue.Description); + Assert.Equal(@"C:\Users\jerem\source\repos\Vika\NVika\Parsers\FxCopParser.cs", issue.FilePath); + Assert.Equal("https://code-cracker.github.io/diagnostics/CC0021.html", issue.HelpUri.AbsoluteUri); + Assert.Equal(34u, issue.Line); + Assert.Equal("Use 'nameof(Issue)' instead of specifying the program element name.", issue.Message); + Assert.Equal("CC0021", issue.Name); + Assert.Equal(56u, issue.Offset.Start); + Assert.Equal(63u, issue.Offset.End); + Assert.Null(issue.Project); + Assert.Equal(IssueSeverity.Warning, issue.Severity); Assert.Equal("SARIF", issue.Source); } private const string EmptyReportSample = @"{ - ""$schema"": ""http://json.schemastore.org/sarif-1.0.0"", - ""version"": ""1.0.0"", - ""runs"": [ - { - ""tool"": { - ""name"": ""Microsoft (R) Visual C# Compiler"", - ""version"": ""1.3.1.0"", - ""fileVersion"": ""1.3.1.60616"", - ""semanticVersion"": ""1.3.1"", - ""language"": ""en-US"" - }}]}"; + ""$schema"": ""http://json.schemastore.org/sarif-2.1.0"", + ""version"": ""2.1.0"", + ""runs"": [{ + ""tool"": { + ""driver"": { + ""name"": ""Microsoft (R) Visual C# Compiler"", + ""version"": ""3.8.0-4.20503.2 (75d31ee9)"", + ""dottedQuadFileVersion"": ""3.8.0.0"", + ""semanticVersion"": ""3.8.0"", + ""language"": ""en-US"" + }}}]}"; } } diff --git a/src/NVika/NVika.csproj b/src/NVika/NVika.csproj index 4431cf3a..8efc01ae 100644 --- a/src/NVika/NVika.csproj +++ b/src/NVika/NVika.csproj @@ -26,7 +26,7 @@ false true Properties\GlobalSuppressions.cs - $(OutputPath)\static-analysis.sarif.json + $(OutputPath)\static-analysis.sarif.json;version=2 AnyCPU @@ -39,7 +39,7 @@ false true Properties\GlobalSuppressions.cs - $(OutputPath)\static-analysis.sarif.json + $(OutputPath)\static-analysis.sarif.json;version=2 @@ -57,9 +57,8 @@ ..\packages\Newtonsoft.Json.Schema.3.0.10\lib\net45\Newtonsoft.Json.Schema.dll True - - ..\packages\Sarif.Sdk.1.7.5\lib\net452\Sarif.dll - True + + ..\packages\Sarif.Sdk.2.3.6\lib\net45\Sarif.dll ..\packages\Serilog.2.7.1\lib\net45\Serilog.dll @@ -81,9 +80,9 @@ ..\packages\System.IO.Abstractions.3.0.2\lib\net40\System.IO.Abstractions.dll - + False - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll @@ -125,9 +124,9 @@ - - - + + + diff --git a/src/NVika/Parsers/SarifParser.cs b/src/NVika/Parsers/SarifParser.cs index 9e778395..2a4bb31b 100644 --- a/src/NVika/Parsers/SarifParser.cs +++ b/src/NVika/Parsers/SarifParser.cs @@ -39,33 +39,42 @@ public override IEnumerable Parse(string reportPath) { var logContents = FileSystem.File.ReadAllText(reportPath); - var settings = new JsonSerializerSettings - { - ContractResolver = SarifContractResolver.Instance - }; - - var log = JsonConvert.DeserializeObject(logContents, settings); + var log = JsonConvert.DeserializeObject(logContents); - return log.Runs.SelectMany(run => run.Results.Where(result => result.SuppressionStates == SuppressionStates.None).Select(result => + return log.Runs.SelectMany(run => run.Results.Where(result => result.Suppressions == null || result.Suppressions.All(suppression => suppression.Status == SuppressionStatus.None)) + .Select(result => { - Rule resultRule; - run.Rules.TryGetValue(result.RuleId, out resultRule); + run.SetRunOnResults(); + var resultRule = result.GetRule(); string ruleCategory = null; resultRule?.TryGetProperty("category", out ruleCategory); - var resultLocation = GetLocation(result); + string filePath = null; + Region region = null; + if (result.Locations.Count > 0) + { + if (result.Locations[0].PhysicalLocation != null) + { + filePath = result.Locations[0].PhysicalLocation.ArtifactLocation.Uri.LocalPath; + region = result.Locations[0].PhysicalLocation.Region; + } + else + { + filePath = result.AnalysisTarget.Uri.LocalPath; + } + } return new Issue { Category = ruleCategory, - Description = resultRule?.ShortDescription, - FilePath = resultLocation.Uri.LocalPath, + Description = resultRule?.ShortDescription.Text, + FilePath = filePath, HelpUri = resultRule?.HelpUri, - Message = resultRule == null ? result.Message : result.GetMessageText(resultRule), + Message = resultRule == null ? result.Message.Text : result.GetMessageText(resultRule), Name = result.RuleId, - Line = resultLocation.Region == null ? 0u : (uint)resultLocation.Region.StartLine, - Offset = resultLocation.Region == null ? new Offset() : new Offset { Start = (uint)resultLocation.Region.StartColumn, End = (uint)resultLocation.Region.EndColumn }, + Line = region == null ? 0u : (uint)region.StartLine, + Offset = region == null ? new Offset() : new Offset { Start = (uint)region.StartColumn, End = (uint)region.EndColumn }, Project = null, Severity = LevelToSeverity(result.Level), Source = "SARIF" @@ -73,30 +82,15 @@ public override IEnumerable Parse(string reportPath) })); } - private static PhysicalLocation GetLocation(Result result) - { - PhysicalLocation location = null; - - if (result.Locations.Count > 0) - { - location = result.Locations[0].ResultFile ?? result.Locations[0].AnalysisTarget; - } - - return location; - } - - private static IssueSeverity LevelToSeverity(ResultLevel level) + private static IssueSeverity LevelToSeverity(FailureLevel level) { switch (level) { - case ResultLevel.Default: - case ResultLevel.Warning: return IssueSeverity.Warning; + case FailureLevel.Warning: return IssueSeverity.Warning; - case ResultLevel.Error: return IssueSeverity.Error; + case FailureLevel.Error: return IssueSeverity.Error; - case ResultLevel.NotApplicable: - case ResultLevel.Pass: - case ResultLevel.Note: + case FailureLevel.Note: default: return IssueSeverity.Suggestion; } } diff --git a/src/NVika/Schemas/Sarif.schema.json b/src/NVika/Schemas/Sarif.schema.json index 033bd14f..e0b65245 100644 --- a/src/NVika/Schemas/Sarif.schema.json +++ b/src/NVika/Schemas/Sarif.schema.json @@ -1,7 +1,8 @@ { - "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Static Analysis Results Format (SARIF) Version 1.0.0 JSON Schema", - "description": "Static Analysis Results Format (SARIF) Version 1.0.0 JSON Schema: a standard format for the output of static analysis and other tools.", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema", + "$id": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", + "description": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.", "additionalProperties": false, "type": "object", "properties": { @@ -14,1183 +15,3356 @@ "version": { "description": "The SARIF format version of this log file.", - "enum": [ "1.0.0" ] + "enum": [ "2.1.0" ] }, "runs": { "description": "The set of runs contained in this log file.", "type": "array", - "minItems": 1, + "minItems": 0, + "uniqueItems": false, "items": { "$ref": "#/definitions/run" } + }, + + "inlineExternalProperties": { + "description": "References to external property files that share data between runs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/externalProperties" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the log file.", + "$ref": "#/definitions/propertyBag" } }, + "required": [ "version", "runs" ], + "definitions": { - "annotatedCodeLocation": { - "description": "An annotation used to express code flows through a method or other locations that are related to a result.", + "address": { + "description": "A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file).", "additionalProperties": false, "type": "object", "properties": { - "id": { - "description": "OBSOLETE (use \"step\" instead): An identifier for the location, unique within the scope of the code flow within which it occurs.", - "type": [ "integer", "string" ], - "pattern": "^[1-9][0-9]*$", - "minimum": 1 + "absoluteAddress": { + "description": "The address expressed as a byte offset from the start of the addressable region.", + "type": "integer", + "minimum": -1, + "default": -1 + }, - "step": { - "description": "The 0-based sequence number of the location in the code flow within which it occurs.", - "type": "integer", - "minimum": 0 + "relativeAddress": { + "description": "The address expressed as a byte offset from the absolute address of the top-most parent object.", + "type": "integer" + }, - "physicalLocation": { - "description": "A file location to which this annotation refers.", - "$ref": "#/definitions/physicalLocation" + "length": { + "description": "The number of bytes in this range of addresses.", + "type": "integer" }, - "fullyQualifiedLogicalName": { - "description": "The fully qualified name of the method or function that is executing.", + "kind": { + "description": "An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', 'segment', 'stack', 'stackFrame', 'table' are well-known values.", "type": "string" }, - "logicalLocationKey": { - "description": "A key used to retrieve the annotation's logicalLocation from the logicalLocations dictionary.", + "name": { + "description": "A name that is associated with the address, e.g., '.text'.", "type": "string" }, - "module": { - "description": "The name of the module that contains the code that is executing.", + "fullyQualifiedName": { + "description": "A human-readable fully qualified name that is associated with the address.", "type": "string" }, - "threadId": { - "description": "The thread identifier of the code that is executing.", + "offsetFromParent": { + "description": "The byte offset of this address from the absolute or relative address of the parent object.", "type": "integer" }, - "message": { - "description": "A message relevant to this annotation.", - "type": "string" + "index": { + "description": "The index within run.addresses of the cached object for this address.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "kind": { - "description": "Categorizes the location.", - "enum": [ "alias", "assignment", "branch", "call", "callReturn", "continuation", "declaration", "functionEnter", "functionExit", "functionReturn", "usage" ] + "parentIndex": { + "description": "The index within run.addresses of the parent object.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the address.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "artifact": { + "description": "A single artifact. In some cases, this artifact might be nested within another artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "description": { + "description": "A short description of the artifact.", + "$ref": "#/definitions/message" }, - "taintKind": { - "description": "Classifies state transitions in code locations relevant to a taint analysis.", - "enum": [ "source", "sink", "sanitizer" ] + "location": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" }, - "target": { - "description": "The fully qualified name of the target on which this location operates. For an annotation of kind 'call', for example, the target refers to the fully qualified logical name of the function called from this location.", - "type": "string" + "parentIndex": { + "description": "Identifies the index of the immediate parent of the artifact, if this artifact is nested.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "parameters": { - "description": "An ordered set of strings that parameterize the operation for this location. For an annotation of kind 'call', for example, this property may hold the ordered list of arguments passed to the callee.", + "offset": { + "description": "The offset in bytes of the artifact within its containing artifact.", + "type": "integer", + "minimum": 0 + }, + + "length": { + "description": "The length of the artifact in bytes.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "roles": { + "description": "The role or roles played by the artifact in the analysis.", "type": "array", + "minItems": 0, + "uniqueItems": true, "default": [], "items": { - "type": "string" + "enum": [ + "analysisTarget", + "attachment", + "responseFile", + "resultFile", + "standardStream", + "tracedFile", + "unmodified", + "modified", + "added", + "deleted", + "renamed", + "uncontrolled", + "driver", + "extension", + "translation", + "taxonomy", + "policy", + "referencedOnCommandLine", + "memoryContents", + "directory", + "userSpecifiedConfiguration", + "toolSpecifiedConfiguration", + "debugOutputFile" + ] } }, - "variables": { - "description": "A dictionary, each of whose keys specifies a variable name, the associated value of which represents the variable value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.", - "type": "object" + "mimeType": { + "description": "The MIME type (RFC 2045) of the artifact.", + "type": "string", + "pattern": "[^/]+/.+" + }, + + "contents": { + "description": "The contents of the artifact.", + "$ref": "#/definitions/artifactContent" }, - "targetKey": { - "description": "A key used to retrieve the target's logicalLocation from the logicalLocations dictionary.", + "encoding": { + "description": "Specifies the encoding for an artifact object that refers to a text file.", "type": "string" }, - "essential": { - "description": "OBSOLETE (use \"importance\" instead): True if this location is essential to understanding the code flow in which it occurs.", - "type": "boolean" + "sourceLanguage": { + "description": "Specifies the source language for any artifact object that refers to a text file that contains source code.", + "type": "string" }, - "importance": { - "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".", - "enum": [ "important", "essential", "unimportant" ] + "hashes": { + "description": "A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function.", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "snippet": { - "description": "The source code at the specified location.", - "type": "string" + "lastModifiedTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" }, "properties": { - "description": "Key/value pairs that provide additional information about the code location.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the artifact.", + "$ref": "#/definitions/propertyBag" } } }, - "codeFlow": { + + "artifactChange": { + "description": "A change to a single artifact.", + "additionalProperties": false, "type": "object", "properties": { - "message": { - "description": "A message relevant to the code flow", - "type": "string" + "artifactLocation": { + "description": "The location of the artifact to change.", + "$ref": "#/definitions/artifactLocation" }, - "locations": { - "description": "An array of 'annotatedCodeLocation' objects, each of which describes a single location visited by the tool in the course of producing the result.", + "replacements": { + "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.", "type": "array", "minItems": 1, + "uniqueItems": false, "items": { - "$ref": "#/definitions/annotatedCodeLocation" + "$ref": "#/definitions/replacement" } }, "properties": { - "description": "Key/value pairs that provide additional information about the code flow.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the change.", + "$ref": "#/definitions/propertyBag" } + }, - "required": [ "locations" ] + + "required": [ "artifactLocation", "replacements" ] }, - "exception": { + + "artifactContent": { + "description": "Represents the contents of an artifact.", "type": "object", + "additionalProperties": false, "properties": { - "kind": { - "type": "string", - "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal." + "text": { + "description": "UTF-8-encoded content from a text artifact.", + "type": "string" }, - "message": { - "type": "string", - "description": "A string that describes the exception." + "binary": { + "description": "MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.", + "type": "string" }, - "stack": { - "description": "The sequence of function calls leading to the exception.", - "$ref": "#/definitions/stack" + "rendered": { + "description": "An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region).", + "$ref": "#/definitions/multiformatMessageString" }, - "innerExceptions": { - "type": "array", - "description": "An array of exception objects each of which is considered a cause of this exception.", - "items": { - "$ref": "#/definitions/exception" - } + "properties": { + "description": "Key/value pairs that provide additional information about the artifact content.", + "$ref": "#/definitions/propertyBag" } } }, - "fileChange": { - "description": "A change to a single file.", + + "artifactLocation": { + "description": "Specifies the location of an artifact.", "additionalProperties": false, "type": "object", "properties": { "uri": { - "description": "A string that represents the location of the file to change as a valid URI.", + "description": "A string containing a valid relative or absolute URI.", "type": "string", - "format": "uri" + "format": "uri-reference" }, "uriBaseId": { - "description": "A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.", + "description": "A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.", "type": "string" }, - "replacements": { - "description": "An array of replacement objects, each of which represents the replacement of a single range of bytes in a single file specified by 'uri'.", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/replacement" - } - } - }, - - "required": [ "uri", "replacements" ], - "dependencies": { - "uriBaseId": [ "uri" ] - } - }, - "file": { - "description": "A single file. In some cases, this file might be nested within another file.", - "additionalProperties": false, - "type": "object", - "properties": { - - "uri": { - "description": "The path to the file within its containing file.", - "type": "string", - "format": "uri" + "index": { + "description": "The index within the run artifacts array of the artifact object associated with the artifact location.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "uriBaseId": { - "description": "A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.", - "type": "string" + "description": { + "description": "A short description of the artifact location.", + "$ref": "#/definitions/message" }, - "parentKey": { - "description": "Identifies the key of the immediate parent of the file, if this file is nested.", - "type": "string" - }, + "properties": { + "description": "Key/value pairs that provide additional information about the artifact location.", + "$ref": "#/definitions/propertyBag" + } + } + }, - "offset": { - "description": "The offset in bytes of the file within its containing file.", - "type": "integer" - }, + "attachment": { + "description": "An artifact relevant to a result.", + "type": "object", + "additionalProperties": false, + "properties": { - "length": { - "description": "The length of the file in bytes.", - "type": "integer" + "description": { + "description": "A message describing the role played by the attachment.", + "$ref": "#/definitions/message" }, - "mimeType": { - "description": "The MIME type (RFC 2045) of the file.", - "type": "string", - "pattern": "[^/]+/.+" + "artifactLocation": { + "description": "The location of the attachment.", + "$ref": "#/definitions/artifactLocation" }, - "contents": { - "description": "The contents of the file, expressed as a MIME Base64-encoded byte sequence.", - "type": "string" + "regions": { + "description": "An array of regions of interest within the attachment.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } }, - "hashes": { - "description": "An array of hash objects, each of which specifies a hashed value for the file, along with the name of the algorithm used to compute the hash.", + "rectangles": { + "description": "An array of rectangles specifying areas of interest within the image.", "type": "array", - "minItems": 1, + "minItems": 0, "uniqueItems": true, + "default": [], "items": { - "$ref": "#/definitions/hash" + "$ref": "#/definitions/rectangle" } }, "properties": { - "description": "Key/value pairs that provide additional information about the file.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the attachment.", + "$ref": "#/definitions/propertyBag" } }, - "dependencies": { - "uriBaseId": [ "uri" ] - } + "required": [ "artifactLocation" ] }, - "fix": { - "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of file to modify. For each file, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.", + + "codeFlow": { + "description": "A set of threadFlows which together describe a pattern of code execution relevant to detecting a result.", "additionalProperties": false, "type": "object", "properties": { - "description": { - "description": "A string that describes the proposed fix, enabling viewers to present a proposed change to an end user.", - "type": "string" + "message": { + "description": "A message relevant to the code flow.", + "$ref": "#/definitions/message" }, - "fileChanges": { - "description": "One or more file changes that comprise a fix for a result.", + "threadFlows": { + "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", "type": "array", + "minItems": 1, + "uniqueItems": false, "items": { - "$ref": "#/definitions/fileChange" + "$ref": "#/definitions/threadFlow" } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the code flow.", + "$ref": "#/definitions/propertyBag" } }, - "required": [ "description", "fileChanges" ] + + "required": [ "threadFlows" ] }, - "formattedRuleMessage": { - "description": "Contains information that can be used to construct a formatted message that describes a result.", - "additionalProperties": false, + + "configurationOverride": { + "description": "Information about how a specific rule or notification was reconfigured at runtime.", "type": "object", + "additionalProperties": false, "properties": { - "formatId": { - "description": "A string that identifies the message format used to format the message that describes this result. The value of formatId must correspond to one of the names in the set of name/value pairs contained in the 'messageFormats' property of the rule object whose 'id' property matches the 'ruleId' property of this result.", - "type": "string" + "configuration": { + "description": "Specifies how the rule or notification was configured during the scan.", + "$ref": "#/definitions/reportingConfiguration" }, - "arguments": { - "description": "An array of strings that will be used, in combination with a message format, to construct a result message.", - "type": "array", - "items": { - "type": "string" - } + "descriptor": { + "description": "A reference used to locate the descriptor whose configuration was overridden.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the configuration override.", + "$ref": "#/definitions/propertyBag" } }, - "required": [ "formatId" ] + "required": [ "configuration", "descriptor" ] }, - "hash": { - "description": "A hash value of some file or collection of files, together with the algorithm used to compute the hash.", + + "conversion": { + "description": "Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format.", "additionalProperties": false, "type": "object", "properties": { - "value": { - "description": "The hash value of some file or collection of files, computed by the algorithm named in the 'algorithm' property.", - "type": "string" + "tool": { + "description": "A tool object that describes the converter.", + "$ref": "#/definitions/tool" + }, + + "invocation": { + "description": "An invocation object that describes the invocation of the converter.", + "$ref": "#/definitions/invocation" + }, + + "analysisToolLogFiles": { + "description": "The locations of the analysis tool's per-run log files.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/artifactLocation" + } }, - "algorithm": { - "description": "The name of the algorithm used to compute the hash value specified in the 'value' property.", - "enum": [ "authentihash", "blake256", "blake512", "ecoh", "fsb", "gost", "groestl", "has160", "haval", "jh", "md2", "md4", "md5", "md6", "radioGatun", "ripeMD", "ripeMD128", "ripeMD160", "ripeMD320", "sdhash", "sha1", "sha224", "sha256", "sha384", "sha512", "sha3", "skein", "snefru", "spectralHash", "ssdeep", "swifft", "tiger", "tlsh", "whirlpool" ] + "properties": { + "description": "Key/value pairs that provide additional information about the conversion.", + "$ref": "#/definitions/propertyBag" } + }, - "required": [ "value", "algorithm" ] + + "required": [ "tool" ] }, - "invocation": { - "description": "The runtime environment of the analysis tool run.", - "additionalProperties": false, + + "edge": { + "description": "Represents a directed edge in a graph.", "type": "object", + "additionalProperties": false, "properties": { - "commandLine": { - "description": "The command line used to invoke the tool.", + "id": { + "description": "A string that uniquely identifies the edge within its graph.", "type": "string" }, - "responseFiles": { - "description": "The contents of any response files specified on the tool's command line.", - "type": "object", - "additionalProperties": true - }, - - "startTime": { - "description": "The date and time at which the run started. See \"Date/time properties\" in the SARIF spec for the required format.", - "type": "string", - "format": "date-time" - }, - - "endTime": { - "description": "The date and time at which the run ended. See \"Date/time properties\" in the SARIF spec for the required format.", - "type": "string", - "format": "date-time" + "label": { + "description": "A short description of the edge.", + "$ref": "#/definitions/message" }, - "machine": { - "description": "The machine that hosted the analysis tool run.", + "sourceNodeId": { + "description": "Identifies the source node (the node at which the edge starts).", "type": "string" }, - "account": { - "description": "The account that ran the analysis tool.", + "targetNodeId": { + "description": "Identifies the target node (the node at which the edge ends).", "type": "string" }, - "processId": { - "description": "The process id for the analysis tool run.", - "type": "integer" - }, + "properties": { + "description": "Key/value pairs that provide additional information about the edge.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "id", "sourceNodeId", "targetNodeId" ] + }, + + "edgeTraversal": { + "description": "Represents the traversal of a single edge during a graph traversal.", + "type": "object", + "additionalProperties": false, + "properties": { - "fileName": { - "description": "The fully qualified path to the analysis tool.", + "edgeId": { + "description": "Identifies the edge being traversed.", "type": "string" }, - "workingDirectory": { - "description": "The working directory for the analysis rool run.", - "type": "string" + "message": { + "description": "A message to display to the user as the edge is traversed.", + "$ref": "#/definitions/message" }, - "environmentVariables": { - "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.", + "finalState": { + "description": "The values of relevant expressions after the edge has been traversed.", "type": "object", - "additionalProperties": true, - "default": {} + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "stepOverEdgeCount": { + "description": "The number of edge traversals necessary to return from a nested graph.", + "type": "integer", + "minimum": 0 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the edge traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "edgeId" ] + }, + + "exception": { + "description": "Describes a runtime exception encountered during the execution of an analysis tool.", + "type": "object", + "additionalProperties": false, + "properties": { + + "kind": { + "type": "string", + "description": "A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal." + }, + + "message": { + "description": "A message that describes the exception.", + "type": "string" + }, + + "stack": { + "description": "The sequence of function calls leading to the exception.", + "$ref": "#/definitions/stack" + }, + + "innerExceptions": { + "description": "An array of exception objects each of which is considered a cause of this exception.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/exception" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the exception.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "externalProperties": { + "description": "The top-level element of an external property file.", + "type": "object", + "additionalProperties": false, + "properties": { + + "schema": { + "description": "The URI of the JSON schema corresponding to the version of the external property file format.", + "type": "string", + "format": "uri" + }, + + "version": { + "description": "The SARIF format version of this external properties object.", + "enum": [ "2.1.0" ] + }, + + "guid": { + "description": "A stable, unique identifer for this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "runGuid": { + "description": "A stable, unique identifer for the run associated with this external properties object, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "conversion": { + "description": "A conversion object that will be merged with a separate run.", + "$ref": "#/definitions/conversion" + }, + + "graphs": { + "description": "An array of graph objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/graph" + } + }, + + "externalizedProperties": { + "description": "Key/value pairs that provide additional information that will be merged with a separate run.", + "$ref": "#/definitions/propertyBag" + }, + + "artifacts": { + "description": "An array of artifact objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + + "invocations": { + "description": "Describes the invocation of the analysis tool that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + + "results": { + "description": "An array of result objects that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/result" + } + }, + + "taxonomies": { + "description": "Tool taxonomies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "driver": { + "description": "The analysis tool object that will be merged with a separate run.", + "$ref": "#/definitions/toolComponent" + }, + + "extensions": { + "description": "Tool extensions that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "policies": { + "description": "Tool policies that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "translations": { + "description": "Tool translations that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "addresses": { + "description": "Addresses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + + "webRequests": { + "description": "Requests that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + + "webResponses": { + "description": "Responses that will be merged with a separate run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external properties.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "externalPropertyFileReference": { + "description": "Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run.", + "type": "object", + "additionalProperties": false, + "properties": { + + "location": { + "description": "The location of the external property file.", + "$ref": "#/definitions/artifactLocation" + }, + + "guid": { + "description": "A stable, unique identifer for the external property file in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "itemCount": { + "description": "A non-negative integer specifying the number of items contained in the external property file.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external property file.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "location" ] }, + { "required": [ "guid" ] } + ] + }, + + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "additionalProperties": false, + "type": "object", + "properties": { + + "conversion": { + "description": "An external property file containing a run.conversion object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "graphs": { + "description": "An array of external property files containing a run.graphs object to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "externalizedProperties": { + "description": "An external property file containing a run.properties object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "artifacts": { + "description": "An array of external property files containing run.artifacts arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "invocations": { + "description": "An array of external property files containing run.invocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "logicalLocations": { + "description": "An array of external property files containing run.logicalLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "threadFlowLocations": { + "description": "An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "results": { + "description": "An array of external property files containing run.results arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "taxonomies": { + "description": "An array of external property files containing run.taxonomies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "addresses": { + "description": "An array of external property files containing run.addresses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "driver": { + "description": "An external property file containing a run.driver object to be merged with the root log file.", + "$ref": "#/definitions/externalPropertyFileReference" + }, + + "extensions": { + "description": "An array of external property files containing run.extensions arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "policies": { + "description": "An array of external property files containing run.policies arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "translations": { + "description": "An array of external property files containing run.translations arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "webRequests": { + "description": "An array of external property files containing run.requests arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "webResponses": { + "description": "An array of external property files containing run.responses arrays to be merged with the root log file.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/externalPropertyFileReference" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the external property files.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "fix": { + "description": "A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them.", + "additionalProperties": false, + "type": "object", + "properties": { + + "description": { + "description": "A message that describes the proposed fix, enabling viewers to present the proposed change to an end user.", + "$ref": "#/definitions/message" + }, + + "artifactChanges": { + "description": "One or more artifact changes that comprise a fix for a result.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactChange" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the fix.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "artifactChanges" ] + }, + + "graph": { + "description": "A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph).", + "type": "object", + "additionalProperties": false, + "properties": { + + "description": { + "description": "A description of the graph.", + "$ref": "#/definitions/message" + }, + + "nodes": { + "description": "An array of node objects representing the nodes of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + + "edges": { + "description": "An array of edge objects representing the edges of the graph.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/edge" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the graph.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "graphTraversal": { + "description": "Represents a path through a graph.", + "type": "object", + "additionalProperties": false, + "properties": { + + "runGraphIndex": { + "description": "The index within the run.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "resultGraphIndex": { + "description": "The index within the result.graphs to be associated with the result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "description": { + "description": "A description of this graph traversal.", + "$ref": "#/definitions/message" + }, + + "initialState": { + "description": "Values of relevant expressions at the start of the graph traversal that may change during graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "immutableState": { + "description": "Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "edgeTraversals": { + "description": "The sequences of edges traversed by this graph traversal.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/edgeTraversal" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the graph traversal.", + "$ref": "#/definitions/propertyBag" + } + }, + "oneOf": [ + { "required": [ "runGraphIndex" ] }, + { "required": [ "resultGraphIndex" ] } + ] + }, + + "invocation": { + "description": "The runtime environment of the analysis tool run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "commandLine": { + "description": "The command line used to invoke the tool.", + "type": "string" + }, + + "arguments": { + "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "type": "string" + } + }, + + "responseFiles": { + "description": "The locations of any response files specified on the tool's command line.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "startTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "endTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" + }, + + "exitCode": { + "description": "The process exit code.", + "type": "integer" + }, + + "ruleConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe rules related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + + "notificationConfigurationOverrides": { + "description": "An array of configurationOverride objects that describe notifications related runtime overrides.", + "type": "array", + "minItems": 0, + "default": [], + "uniqueItems": true, + "items": { + "$ref": "#/definitions/configurationOverride" + } + }, + + "toolExecutionNotifications": { + "description": "A list of runtime conditions detected by the tool during the analysis.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + + "toolConfigurationNotifications": { + "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/notification" + } + }, + + "exitCodeDescription": { + "description": "The reason for the process exit.", + "type": "string" + }, + + "exitSignalName": { + "description": "The name of the signal that caused the process to exit.", + "type": "string" + }, + + "exitSignalNumber": { + "description": "The numeric value of the signal that caused the process to exit.", + "type": "integer" + }, + + "processStartFailureMessage": { + "description": "The reason given by the operating system that the process failed to start.", + "type": "string" + }, + + "executionSuccessful": { + "description": "Specifies whether the tool's execution completed successfully.", + "type": "boolean" + }, + + "machine": { + "description": "The machine on which the invocation occurred.", + "type": "string" + }, + + "account": { + "description": "The account under which the invocation occurred.", + "type": "string" + }, + + "processId": { + "description": "The id of the process in which the invocation occurred.", + "type": "integer" + }, + + "executableLocation": { + "description": "An absolute URI specifying the location of the executable that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "workingDirectory": { + "description": "The working directory for the invocation.", + "$ref": "#/definitions/artifactLocation" + }, + + "environmentVariables": { + "description": "The environment variables associated with the analysis tool process, expressed as key/value pairs.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "stdin": { + "description": "A file containing the standard input stream to the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stdout": { + "description": "A file containing the standard output stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stderr": { + "description": "A file containing the standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "stdoutStderr": { + "description": "A file containing the interleaved standard output and standard error stream from the process that was invoked.", + "$ref": "#/definitions/artifactLocation" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the invocation.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "executionSuccessful" ] + }, + + "location": { + "description": "A location within a programming artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "id": { + "description": "Value that distinguishes this location from all other locations within a single result object.", + "type": "integer", + "minimum": -1, + "default": -1 + }, + + "physicalLocation": { + "description": "Identifies the artifact and region.", + "$ref": "#/definitions/physicalLocation" + }, + + "logicalLocations": { + "description": "The logical locations associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "message": { + "description": "A message relevant to the location.", + "$ref": "#/definitions/message" + }, + + "annotations": { + "description": "A set of regions relevant to the location.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/region" + } + }, + + "relationships": { + "description": "An array of objects that describe relationships between this location and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/locationRelationship" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "locationRelationship": { + "description": "Information about the relation of one location to another.", + "type": "object", + "additionalProperties": false, + "properties": { + + "target": { + "description": "A reference to the related location.", + "type": "integer", + "minimum": 0 + }, + + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.", + "type": "array", + "default": [ "relevant" ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "description": { + "description": "A description of the location relationship.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the location relationship.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "target" ] + }, + + "logicalLocation": { + "description": "A logical location of a construct that produced a result.", + "additionalProperties": false, + "type": "object", + "properties": { + + "name": { + "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", + "type": "string" + }, + + "index": { + "description": "The index within the logical locations array.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "fullyQualifiedName": { + "description": "The human-readable fully qualified name of the logical location.", + "type": "string" + }, + + "decoratedName": { + "description": "The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", + "type": "string" + }, + + "parentIndex": { + "description": "Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "kind": { + "description": "The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the logical location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "message": { + "description": "Encapsulates a message intended to be read by the end user.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "text": { + "description": "A plain text message string.", + "type": "string" + }, + + "markdown": { + "description": "A Markdown message string.", + "type": "string" + }, + + "id": { + "description": "The identifier for this message.", + "type": "string" + }, + + "arguments": { + "description": "An array of strings to substitute into the message string.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "text" ] }, + { "required": [ "id" ] } + ] + }, + + "multiformatMessageString": { + "description": "A message string or message format string rendered in multiple formats.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "text": { + "description": "A plain text message string or format string.", + "type": "string" + }, + + "markdown": { + "description": "A Markdown message string or format string.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the message.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "text" ] + }, + + "node": { + "description": "Represents a node in a graph.", + "type": "object", + "additionalProperties": false, + + "properties": { + + "id": { + "description": "A string that uniquely identifies the node within its graph.", + "type": "string" + }, + + "label": { + "description": "A short description of the node.", + "$ref": "#/definitions/message" + }, + + "location": { + "description": "A code location associated with the node.", + "$ref": "#/definitions/location" + }, + + "children": { + "description": "Array of child nodes.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/node" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the node.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "id" ] + }, + + "notification": { + "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.", + "type": "object", + "additionalProperties": false, + "properties": { + + "locations": { + "description": "The locations relevant to this notification.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "message": { + "description": "A message that describes the condition that was encountered.", + "$ref": "#/definitions/message" + }, + + "level": { + "description": "A value specifying the severity level of the notification.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ] + }, + + "threadId": { + "description": "The thread identifier of the code that generated the notification.", + "type": "integer" + }, + + "timeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification.", + "type": "string", + "format": "date-time" + }, + + "exception": { + "description": "The runtime exception, if any, relevant to this notification.", + "$ref": "#/definitions/exception" + }, + + "descriptor": { + "description": "A reference used to locate the descriptor relevant to this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "associatedRule": { + "description": "A reference used to locate the rule descriptor associated with this notification.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the notification.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "message" ] + }, + + "physicalLocation": { + "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "address": { + "description": "The address of the location.", + "$ref": "#/definitions/address" + }, + + "artifactLocation": { + "description": "The location of the artifact.", + "$ref": "#/definitions/artifactLocation" + }, + + "region": { + "description": "Specifies a portion of the artifact.", + "$ref": "#/definitions/region" + }, + + "contextRegion": { + "description": "Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region.", + "$ref": "#/definitions/region" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the physical location.", + "$ref": "#/definitions/propertyBag" + } + }, + + "anyOf": [ + { + "required": [ "address" ] + }, + { + "required": [ "artifactLocation" ] + } + ] + }, + + "propertyBag": { + "description": "Key/value pairs that provide additional information about the object.", + "type": "object", + "additionalProperties": true, + "properties": { + "tags": { + + "description": "A set of distinct strings that provide additional information.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + } + } + }, + + "rectangle": { + "description": "An area within an image.", + "additionalProperties": false, + "type": "object", + "properties": { + + "top": { + "description": "The Y coordinate of the top edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "left": { + "description": "The X coordinate of the left edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "bottom": { + "description": "The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "right": { + "description": "The X coordinate of the right edge of the rectangle, measured in the image's natural units.", + "type": "number" + }, + + "message": { + "description": "A message relevant to the rectangle.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the rectangle.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "region": { + "description": "A region within an artifact where a result was detected.", + "additionalProperties": false, + "type": "object", + "properties": { + + "startLine": { + "description": "The line number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + + "startColumn": { + "description": "The column number of the first character in the region.", + "type": "integer", + "minimum": 1 + }, + + "endLine": { + "description": "The line number of the last character in the region.", + "type": "integer", + "minimum": 1 + }, + + "endColumn": { + "description": "The column number of the character following the end of the region.", + "type": "integer", + "minimum": 1 + }, + + "charOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first character in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "charLength": { + "description": "The length of the region in characters.", + "type": "integer", + "minimum": 0 + }, + + "byteOffset": { + "description": "The zero-based offset from the beginning of the artifact of the first byte in the region.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "byteLength": { + "description": "The length of the region in bytes.", + "type": "integer", + "minimum": 0 + }, + + "snippet": { + "description": "The portion of the artifact contents within the specified region.", + "$ref": "#/definitions/artifactContent" + }, + + "message": { + "description": "A message relevant to the region.", + "$ref": "#/definitions/message" + }, + + "sourceLanguage": { + "description": "Specifies the source language, if any, of the portion of the artifact specified by the region object.", + "type": "string" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the region.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "replacement": { + "description": "The replacement of a single region of an artifact.", + "additionalProperties": false, + "type": "object", + "properties": { + + "deletedRegion": { + "description": "The region of the artifact to delete.", + "$ref": "#/definitions/region" + }, + + "insertedContent": { + "description": "The content to insert at the location specified by the 'deletedRegion' property.", + "$ref": "#/definitions/artifactContent" }, "properties": { - "description": "Key/value pairs that provide additional information about the run.", + "description": "Key/value pairs that provide additional information about the replacement.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "deletedRegion" ] + }, + + "reportingDescriptor": { + "description": "Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting.", + "additionalProperties": false, + "type": "object", + "properties": { + + "id": { + "description": "A stable, opaque identifier for the report.", + "type": "string" + }, + + "deprecatedIds": { + "description": "An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "guid": { + "description": "A unique identifer for the reporting descriptor in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "deprecatedGuids": { + "description": "An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + } + }, + + "name": { + "description": "A report identifier that is understandable to an end user.", + "type": "string" + }, + + "deprecatedNames": { + "description": "An array of readable identifiers by which this report was known in some previous version of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "shortDescription": { + "description": "A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullDescription": { + "description": "A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "messageStrings": { + "description": "A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } + }, + + "defaultConfiguration": { + "description": "Default reporting configuration information.", + "$ref": "#/definitions/reportingConfiguration" + }, + + "helpUri": { + "description": "A URI where the primary documentation for the report can be found.", + "type": "string", + "format": "uri" + }, + + "help": { + "description": "Provides the primary documentation for the report, useful when there is no online documentation.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "relationships": { + "description": "An array of objects that describe relationships between this reporting descriptor and others.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorRelationship" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the report.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "id" ] + }, + + "reportingConfiguration": { + "description": "Information about a rule or notification that can be configured at runtime.", + "type": "object", + "additionalProperties": false, + "properties": { + + "enabled": { + "description": "Specifies whether the report may be produced during the scan.", + "type": "boolean", + "default": true + }, + + "level": { + "description": "Specifies the failure level for the report.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ] + }, + + "rank": { + "description": "Specifies the relative priority of the report. Used for analysis output only.", + "type": "number", + "default": -1.0, + "minimum": -1.0, + "maximum": 100.0 + }, + + "parameters": { + "description": "Contains configuration information specific to a report.", + "$ref": "#/definitions/propertyBag" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting configuration.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "reportingDescriptorReference": { + "description": "Information about how to locate a relevant reporting descriptor.", + "type": "object", + "additionalProperties": false, + "properties": { + + "id": { + "description": "The id of the descriptor.", + "type": "string" + }, + + "index": { + "description": "The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "guid": { + "description": "A guid that uniquely identifies the descriptor.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "toolComponent": { + "description": "A reference used to locate the toolComponent associated with the descriptor.", + "$ref": "#/definitions/toolComponentReference" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "anyOf": [ + { "required": [ "index" ] }, + { "required": [ "guid" ] }, + { "required": [ "id" ] } + ] + }, + + "reportingDescriptorRelationship": { + "description": "Information about the relation of one reporting descriptor to another.", + "type": "object", + "additionalProperties": false, + "properties": { + + "target": { + "description": "A reference to the related reporting descriptor.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "kinds": { + "description": "A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.", + "type": "array", + "default": [ "relevant" ], + "uniqueItems": true, + "items": { + "type": "string" + } + }, + + "description": { + "description": "A description of the reporting descriptor relationship.", + "$ref": "#/definitions/message" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the reporting descriptor reference.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "target" ] + }, + + "result": { + "description": "A result produced by an analysis tool.", + "additionalProperties": false, + "type": "object", + "properties": { + + "ruleId": { + "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.", + "type": "string" + }, + + "ruleIndex": { + "description": "The index within the tool component rules array of the rule object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "rule": { + "description": "A reference used to locate the rule descriptor relevant to this result.", + "$ref": "#/definitions/reportingDescriptorReference" + }, + + "kind": { + "description": "A value that categorizes results by evaluation state.", + "default": "fail", + "enum": [ "notApplicable", "pass", "fail", "review", "open", "informational" ] + }, + + "level": { + "description": "A value specifying the severity level of the result.", + "default": "warning", + "enum": [ "none", "note", "warning", "error" ] + }, + + "message": { + "description": "A message that describes the result. The first sentence of the message only will be displayed when visible space is limited.", + "$ref": "#/definitions/message" + }, + + "analysisTarget": { + "description": "Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred.", + "$ref": "#/definitions/artifactLocation" + }, + + "locations": { + "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "guid": { + "description": "A stable, unique identifer for the result in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "occurrenceCount": { + "description": "A positive integer specifying the number of times this logically unique result was observed in this run.", + "type": "integer", + "minimum": 1 + }, + + "partialFingerprints": { + "description": "A set of strings that contribute to the stable, unique identity of the result.", + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + + "fingerprints": { + "description": "A set of strings each of which individually defines a stable, unique identity for the result.", "type": "object", - "additionalProperties": true, - "properties": { - "tags": { - - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } + "additionalProperties": { + "type": "string" + } + }, + + "stacks": { + "description": "An array of 'stack' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/stack" + } + }, + + "codeFlows": { + "description": "An array of 'codeFlow' objects relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/codeFlow" + } + }, + + "graphs": { + "description": "An array of zero or more unique graph objects associated with the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + + "graphTraversals": { + "description": "An array of one or more unique 'graphTraversal' objects.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graphTraversal" + } + }, + + "relatedLocations": { + "description": "A set of locations relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/location" + } + }, + + "suppressions": { + "description": "A set of suppressions relevant to this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/suppression" + } + }, + + "baselineState": { + "description": "The state of a result relative to a baseline of a previous run.", + "enum": [ + "new", + "unchanged", + "updated", + "absent" + ] + }, + + "rank": { + "description": "A number representing the priority or importance of the result.", + "type": "number", + "default": -1.0, + "minimum": -1.0, + "maximum": 100.0 + }, + + "attachments": { + "description": "A set of artifacts relevant to the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/attachment" + } + }, + + "hostedViewerUri": { + "description": "An absolute URI at which the result can be viewed.", + "type": "string", + "format": "uri" + }, + + "workItemUris": { + "description": "The URIs of the work items associated with this result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "type": "string", + "format": "uri" + } + }, + + "provenance": { + "description": "Information about how and when the result was detected.", + "$ref": "#/definitions/resultProvenance" + }, + + "fixes": { + "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/fix" + } + }, + + "taxa": { + "description": "An array of references to taxonomy reporting descriptors that are applicable to the result.", + "type": "array", + "default": [], + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/reportingDescriptorReference" } + }, + + "webRequest": { + "description": "A web request associated with this result.", + "$ref": "#/definitions/webRequest" + }, + + "webResponse": { + "description": "A web response associated with this result.", + "$ref": "#/definitions/webResponse" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" } - } + }, + "required": [ "message" ] }, - "location": { - "description": "The location where an analysis tool produced a result.", + + "resultProvenance": { + "description": "Contains information about how and when a result was detected.", "additionalProperties": false, "type": "object", "properties": { - "analysisTarget": { - "description": "Identifies the file that the analysis tool was instructed to scan. This need not be the same as the file where the result actually occurred.", - "$ref": "#/definitions/physicalLocation" + "firstDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was first detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" }, - "resultFile": { - "description": "Identifies the file where the analysis tool produced the result.", - "$ref": "#/definitions/physicalLocation" + "lastDetectionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See \"Date/time properties\" in the SARIF spec for the required format.", + "type": "string", + "format": "date-time" }, - "fullyQualifiedLogicalName": { - "description": "The human-readable fully qualified name of the logical location where the analysis tool produced the result. If 'logicalLocationKey' is not specified, this member is can used to retrieve the location logicalLocation from the logicalLocations dictionary, if one exists.", - "type": "string" + "firstDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, - "logicalLocationKey": { - "description": "A key used to retrieve the location logicalLocation from the logicalLocations dictionary, when the string specified by 'fullyQualifiedLogicalName' is not unique.", - "type": "string" + "lastDetectionRunGuid": { + "description": "A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, - "decoratedName": { - "description": "The machine-readable fully qualified name for the logical location where the analysis tool produced the result, such as the mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name.", - "type": "string" + "invocationIndex": { + "description": "The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "properties": { - "description": "Key/value pairs that provide additional information about the location.", - "type": "object", - "additionalProperties": true, - "properties": { - "tags": { - - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } + "conversionSources": { + "description": "An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/physicalLocation" } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the result.", + "$ref": "#/definitions/propertyBag" } } }, - "logicalLocation": { - "description": "A logical location of a construct that produced a result.", + + "run": { + "description": "Describes a single run of an analysis tool, and contains the reported output of that run.", "additionalProperties": false, "type": "object", "properties": { - "name": { - "description": "Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method.", + "tool": { + "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.", + "$ref": "#/definitions/tool" + }, + + "invocations": { + "description": "Describes the invocation of the analysis tool.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/invocation" + } + }, + + "conversion": { + "description": "A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format.", + "$ref": "#/definitions/conversion" + }, + + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}]?$" + }, + + "versionControlProvenance": { + "description": "Specifies the revision in version control of the artifacts that were scanned.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/versionControlDetails" + } + }, + + "originalUriBaseIds": { + "description": "The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/artifactLocation" + } + }, + + "artifacts": { + "description": "An array of artifact objects relevant to the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "items": { + "$ref": "#/definitions/artifact" + } + }, + + "logicalLocations": { + "description": "An array of logical locations such as namespaces, types or functions.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/logicalLocation" + } + }, + + "graphs": { + "description": "An array of zero or more unique graph objects associated with the run.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/graph" + } + }, + + "results": { + "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/result" + } + }, + + "automationDetails": { + "description": "Automation details that describe this run.", + "$ref": "#/definitions/runAutomationDetails" + }, + + "runAggregates": { + "description": "Automation details that describe the aggregate of runs to which this run belongs.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/runAutomationDetails" + } + }, + + "baselineGuid": { + "description": "The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" + }, + + "redactionTokens": { + "description": "An array of strings used to replace sensitive information in a redaction-aware property.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "type": "string" + } + }, + + "defaultEncoding": { + "description": "Specifies the default encoding for any artifact object that refers to a text file.", + "type": "string" + }, + + "defaultSourceLanguage": { + "description": "Specifies the default source language for any artifact object that refers to a text file that contains source code.", "type": "string" }, - "parentKey": { - "description": "Identifies the key of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type.", - "type": "string" + "newlineSequences": { + "description": "An ordered list of character sequences that were treated as line breaks when computing region information for the run.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "default": [ "\r\n", "\n" ], + "items": { + "type": "string" + } + }, + + "columnKind": { + "description": "Specifies the unit in which the tool measures columns.", + "enum": [ "utf16CodeUnits", "unicodeCodePoints" ] + }, + + "externalPropertyFileReferences": { + "description": "References to external property files that should be inlined with the content of a root log file.", + "$ref": "#/definitions/externalPropertyFileReferences" + }, + + "threadFlowLocations": { + "description": "An array of threadFlowLocation objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/threadFlowLocation" + } + }, + + "taxonomies": { + "description": "An array of toolComponent objects relevant to a taxonomy in which results are categorized.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "addresses": { + "description": "Addresses associated with this run instance, if any.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "$ref": "#/definitions/address" + } + }, + + "translations": { + "description": "The set of available translations of the localized data provided by the tool.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "policies": { + "description": "Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line).", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponent" + } + }, + + "webRequests": { + "description": "An array of request objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webRequest" + } + }, + + "webResponses": { + "description": "An array of response objects cached at run level.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/webResponse" + } + }, + + "specialLocations": { + "description": "A specialLocations object that defines locations of special significance to SARIF consumers.", + "$ref": "#/definitions/specialLocations" }, - "kind": { - "description": "The type of construct this logicalLocationComponent refers to. Should be one of 'function', 'member', 'module', 'namespace', 'package', 'resource', or 'type', if any of those accurately describe the construct.", - "type": "string" + "properties": { + "description": "Key/value pairs that provide additional information about the run.", + "$ref": "#/definitions/propertyBag" } - } + }, + + "required": [ "tool" ] }, - "notification": { - "type": "object", - "description": "Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool.", + + "runAutomationDetails": { + "description": "Information that describes a run's identity and role within an engineering system process.", "additionalProperties": false, + "type": "object", "properties": { - "id": { - "description": "An identifier for the condition that was encountered.", - "type": "string" - }, - - "ruleId": { - "description": "The stable, unique identifier of the rule (if any) to which this notification is relevant. If 'ruleKey' is not specified, this member can be used to retrieve rule metadata from the rules dictionary, if it exists.", - "type": "string" + "description": { + "description": "A description of the identity and role played within the engineering system by this object's containing run object.", + "$ref": "#/definitions/message" }, - "ruleKey": { - "description": "A key used to retrieve the rule metadata from the rules dictionary that is relevant to the notificationn.", + "id": { + "description": "A hierarchical string that uniquely identifies this object's containing run object.", "type": "string" }, - "physicalLocation": { - "description": "The file and region relevant to this notification.", - "$ref": "#/definitions/physicalLocation" - }, - - "message": { - "description": "A string that describes the condition that was encountered.", - "type": "string" + "guid": { + "description": "A stable, unique identifer for this object's containing run object in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, - "level": { - "description": "A value specifying the severity level of the notification.", - "default": "warning", - "enum": [ "note", "warning", "error" ] + "correlationGuid": { + "description": "A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, - "threadId": { - "description": "The thread identifier of the code that generated the notification.", - "type": "integer" - }, + "properties": { + "description": "Key/value pairs that provide additional information about the run automation details.", + "$ref": "#/definitions/propertyBag" + } + } + }, - "time": { - "description": "The date and time at which the analysis tool generated the notification.", - "type": "string", - "format": "date-time" - }, + "specialLocations": { + "description": "Defines locations of special significance to SARIF consumers.", + "type": "object", + "additionalProperties": false, + "properties": { - "exception": { - "description": "The runtime exception, if any, relevant to this notification.", - "$ref": "#/definitions/exception" + "displayBase": { + "description": "Provides a suggestion to SARIF consumers to display file paths relative to the specified location.", + "$ref": "#/definitions/artifactLocation" }, "properties": { - "description": "Key/value pairs that provide additional information about the notification.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the special locations.", + "$ref": "#/definitions/propertyBag" } - }, - "required": [ "message" ] + } }, - "physicalLocation": { - "description": "A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact.", + + "stack": { + "description": "A call stack that is relevant to a result.", "additionalProperties": false, "type": "object", "properties": { - "uri": { - "description": "The location of the file as a valid URI.", - "type": "string", - "format": "uri" + "message": { + "description": "A message relevant to this call stack.", + "$ref": "#/definitions/message" }, - "uriBaseId": { - "description": "A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.", - "type": "string" + "frames": { + "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "items": { + "$ref": "#/definitions/stackFrame" + } }, - "region": { - "description": "The region within the file where the result was detected.", - "$ref": "#/definitions/region" + "properties": { + "description": "Key/value pairs that provide additional information about the stack.", + "$ref": "#/definitions/propertyBag" } }, - - "required": [ "uri" ], - "dependencies": { - "uriBaseId": [ "uri" ] - } + "required": [ "frames" ] }, - "region": { - "description": "A region within a file where a result was detected.", + + "stackFrame": { + "description": "A function call within a stack trace.", "additionalProperties": false, "type": "object", "properties": { - "startLine": { - "description": "The line number of the first character in the region.", - "type": "integer", - "minimum": 1 - }, - - "startColumn": { - "description": "The column number of the first character in the region.", - "type": "integer", - "minimum": 1 + "location": { + "description": "The location to which this stack frame refers.", + "$ref": "#/definitions/location" }, - "endLine": { - "description": "The line number of the last character in the region.", - "type": "integer", - "minimum": 1 + "module": { + "description": "The name of the module that contains the code of this stack frame.", + "type": "string" }, - "endColumn": { - "description": "The column number of the last character in the region.", - "type": "integer", - "minimum": 1 + "threadId": { + "description": "The thread identifier of the stack frame.", + "type": "integer" }, - "offset": { - "description": "The zero-based offset from the beginning of the file of the first byte or character in the region.", - "type": "integer", - "minimum": 0 + "parameters": { + "description": "The parameters of the call that is executing.", + "type": "array", + "minItems": 0, + "uniqueItems": false, + "default": [], + "items": { + "type": "string", + "default": [] + } }, - "length": { - "description": "The length of the region in bytes or characters.", - "type": "integer", - "minimum": 0 + "properties": { + "description": "Key/value pairs that provide additional information about the stack frame.", + "$ref": "#/definitions/propertyBag" } } }, - "replacement": { - "description": "The replacement of a single range of bytes in a file. Specifies the location within the file where the replacement is to be made, the number of bytes to remove at that location, and a sequence of bytes to insert at that location.", + + "suppression": { + "description": "A suppression that is relevant to a result.", "additionalProperties": false, "type": "object", "properties": { - "offset": { - "description": "A non-negative integer specifying the offset in bytes from the beginning of the file at which bytes are to be removed, inserted or both. An offset of 0 shall denote the first byte in the file.", - "type": "integer", - "minimum": 0 + "guid": { + "description": "A stable, unique identifer for the suprression in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, - "deletedLength": { - "description": "The number of bytes to delete, starting at the byte offset specified by offset, measured from the beginning of the file.", - "type": "integer", - "minimum": 1 + "kind": { + "description": "A string that indicates where the suppression is persisted.", + "enum": [ + "inSource", + "external" + ] + }, + + "status": { + "description": "A string that indicates the review status of the suppression.", + "enum": [ + "accepted", + "underReview", + "rejected" + ] }, - "insertedBytes": { - "description": "The MIME Base64-encoded byte sequence to be inserted at the byte offset specified by the 'offset' property, measured from the beginning of the file.", + "justification": { + "description": "A string representing the justification for the suppression.", "type": "string" + }, + + "location": { + "description": "Identifies the location associated with the suppression.", + "$ref": "#/definitions/location" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the suppression.", + "$ref": "#/definitions/propertyBag" } }, - "required": [ "offset" ] + "required": [ "kind" ] }, - "result": { - "description": "A result produced by an analysis tool.", - "additionalProperties": false, + + "threadFlow": { + "description": "Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber.", "type": "object", + "additionalProperties": false, "properties": { - "ruleId": { - "description": "The stable, unique identifier of the rule (if any) to which this notification is relevant. If 'ruleKey' is not specified, this member can be used to retrieve rule metadata from the rules dictionary, if it exists.", + "id": { + "description": "An string that uniquely identifies the threadFlow within the codeFlow in which it occurs.", "type": "string" }, - "ruleKey": { - "description": "A key used to retrieve the rule metadata from the rules dictionary that is relevant to the notificationn.", - "type": "string" + "message": { + "description": "A message relevant to the thread flow.", + "$ref": "#/definitions/message" }, - "level": { - "description": "A value specifying the severity level of the result. If this property is not present, its implied value is 'warning'.", - "default": "warning", - "enum": [ "notApplicable", "pass", "note", "warning", "error" ] - }, - "message": { - "description": "A string that describes the result. The first sentence of the message only will be displayed when visible space is limited.", - "type": "string" + "initialState": { + "description": "Values of relevant expressions at the start of the thread flow that may change during thread flow execution.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } }, - "formattedRuleMessage": { - "description": "A 'formattedRuleMessage' object that can be used to construct a formatted message that describes the result. If the 'formattedMessage' property is present on a result, the 'fullMessage' property shall not be present. If the 'fullMessage' property is present on an result, the 'formattedMessage' property shall not be present", - "$ref": "#/definitions/formattedRuleMessage" + "immutableState": { + "description": "Values of relevant expressions at the start of the thread flow that remain constant.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" + } }, "locations": { - "description": "One or more locations where the result occurred. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", + "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.", "type": "array", "minItems": 1, - "uniqueItems": true, + "uniqueItems": false, "items": { - "$ref": "#/definitions/location" + "$ref": "#/definitions/threadFlowLocation" } }, - "snippet": { - "description": "A source code or other file fragment that illustrates the result.", - "type": "string" + "properties": { + "description": "Key/value pairs that provide additional information about the thread flow.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "locations" ] + }, + + "threadFlowLocation": { + "description": "A location visited by an analysis tool while simulating or monitoring the execution of a program.", + "additionalProperties": false, + "type": "object", + "properties": { + + "index": { + "description": "The index within the run threadFlowLocations array.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "id": { - "description": "A unique identifer for the result.", - "type": "string" + "location": { + "description": "The code location.", + "$ref": "#/definitions/location" }, - "toolFingerprintContribution": { - "description": "A string that contributes to the unique identity of the result.", - "type": "string" + "stack": { + "description": "The call stack leading to this location.", + "$ref": "#/definitions/stack" }, - "stacks": { - "description": "An array of 'stack' objects relevant to the result.", + "kinds": { + "description": "A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'.", "type": "array", - "minItems": 1, + "minItems": 0, "uniqueItems": true, + "default": [], "items": { - "$ref": "#/definitions/stack" + "type": "string" } }, - "codeFlows": { - "description": "An array of 'codeFlow' objects relevant to the result.", + "taxa": { + "description": "An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location.", "type": "array", - "minItems": 1, + "default": [], + "minItems": 0, "uniqueItems": true, "items": { - "$ref": "#/definitions/codeFlow" + "$ref": "#/definitions/reportingDescriptorReference" } }, - "relatedLocations": { - "description": "A grouped set of locations and messages, if available, that represent code areas that are related to this result.", - "type": "array", - "minItems": 1, - "uniqueItems": true, - "items": { - "$ref": "#/definitions/annotatedCodeLocation" - } + "module": { + "description": "The name of the module that contains the code that is executing.", + "type": "string" }, - "suppressionStates": { - "type": "array", - "items": { - "description": "A flag value indicating one or more suppression conditions.", - "enum": [ - "suppressedInSource", - "suppressedExternally" - ] + "state": { + "description": "A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/multiformatMessageString" } }, - "baselineState": { - "description": "The state of a result relative to a baseline of a previous run.", - "enum": [ - "new", - "existing", - "absent" - ] + "nestingLevel": { + "description": "An integer representing a containment hierarchy within the thread flow.", + "type": "integer", + "minimum": 0 }, - "fixes": { - "description": "An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result.", + "executionOrder": { + "description": "An integer representing the temporal order in which execution reached this location.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "executionTimeUtc": { + "description": "The Coordinated Universal Time (UTC) date and time at which this location was executed.", + "type": "string", + "format": "date-time" + }, + + "importance": { + "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".", + "enum": [ "important", "essential", "unimportant" ], + "default": "important" + }, + + "webRequest": { + "description": "A web request associated with this thread flow location.", + "$ref": "#/definitions/webRequest" + }, + + "webResponse": { + "description": "A web response associated with this thread flow location.", + "$ref": "#/definitions/webResponse" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the threadflow location.", + "$ref": "#/definitions/propertyBag" + } + } + }, + + "tool": { + "description": "The analysis tool that was run.", + "additionalProperties": false, + "type": "object", + "properties": { + + "driver": { + "description": "The analysis tool that was run.", + "$ref": "#/definitions/toolComponent" + }, + + "extensions": { + "description": "Tool extensions that contributed to or reconfigured the analysis tool that was run.", "type": "array", - "minItems": 1, + "minItems": 0, "uniqueItems": true, + "default": [], "items": { - "$ref": "#/definitions/fix" + "$ref": "#/definitions/toolComponent" } }, "properties": { - "description": "Key/value pairs that provide additional information about the result.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the tool.", + "$ref": "#/definitions/propertyBag" } - } + }, + + "required": [ "driver" ] }, - "rule": { - "description": "Describes an analysis rule.", + + "toolComponent": { + "description": "A component, such as a plug-in or the driver, of the analysis tool that was run.", "additionalProperties": false, "type": "object", "properties": { - "id": { - "description": "A stable, opaque identifier for the rule.", - "type": "string" + "guid": { + "description": "A unique identifer for the tool component in the form of a GUID.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "name": { - "description": "A rule identifier that is understandable to an end user.", + "description": "The name of the tool component.", "type": "string" }, - "shortDescription": { - "description": "A concise description of the rule. Should be a single sentence that is understandable when visible space is limited to a single line of text.", + "organization": { + "description": "The organization or company that produced the tool component.", + "type": "string" + }, + + "product": { + "description": "A product suite to which the tool component belongs.", "type": "string" }, + "productSuite": { + "description": "A localizable string containing the name of the suite of products to which the tool component belongs.", + "type": "string" + }, + + "shortDescription": { + "description": "A brief description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + "fullDescription": { - "description": "A string that describes the rule. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.", + "description": "A comprehensive description of the tool component.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullName": { + "description": "The name of the tool component along with its version and any other useful identifying information, such as its locale.", "type": "string" }, - "messageFormats": { - "description": "A set of name/value pairs with arbitrary names. The value within each name/value pair shall consist of plain text interspersed with placeholders, which can be used to format a message in combination with an arbitrary number of additional string arguments.", - "type": "object" + "version": { + "description": "The tool component version, in whatever format the component natively provides.", + "type": "string" }, - "defaultLevel": { - "description": "A value specifying the default severity level of the result.", - "default": "warning", - "enum": [ "note", "warning", "error" ] + "semanticVersion": { + "description": "The tool component version in the format specified by Semantic Versioning 2.0.", + "type": "string" }, - "helpUri": { - "description": "A URI where the primary documentation for the rule can be found.", + "dottedQuadFileVersion": { + "description": "The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way).", "type": "string", - "format": "uri" + "pattern": "[0-9]+(\\.[0-9]+){3}" }, - "properties": { - "description": "Key/value pairs that provide additional information about the rule.", - "type": "object", - "additionalProperties": true, - "properties": { - "tags": { - - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } - } - }, - "required": [ "id" ] - }, - "run": { - "description": "Describes a single run of an analysis tool, and contains the output of that run.", - "additionalProperties": false, - "type": "object", - "properties": { + "releaseDateUtc": { + "description": "A string specifying the UTC date (and optionally, the time) of the component's release.", + "type": "string" + }, - "tool": { - "description": "Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files.", - "$ref": "#/definitions/tool" + "downloadUri": { + "description": "The absolute URI from which the tool component can be downloaded.", + "type": "string", + "format": "uri" }, - "invocation": { - "description": "Describes the runtime environment, including parameterization, of the analysis tool run.", - "$ref": "#/definitions/invocation" + "informationUri": { + "description": "The absolute URI at which information about this version of the tool component can be found.", + "type": "string", + "format": "uri" }, - "files": { - "description": "A dictionary, each of whose keys is a URI and each of whose values is an array of file objects representing the location of a single file scanned during the run.", + "globalMessageStrings": { + "description": "A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments.", "type": "object", "additionalProperties": { - "$ref": "#/definitions/file" + "$ref": "#/definitions/multiformatMessageString" } }, - "logicalLocations": { - "description": "A dictionary, each of whose keys specifies a logical location such as a namespace, type or function.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/logicalLocation" + "notifications": { + "description": "An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/reportingDescriptor" } }, - "results": { - "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) in the event that a log file represents an actual scan.", + "rules": { + "description": "An array of reportingDescriptor objects relevant to the analysis performed by the tool component.", "type": "array", "minItems": 0, "uniqueItems": true, + "default": [], "items": { - "$ref": "#/definitions/result" + "$ref": "#/definitions/reportingDescriptor" } }, - "toolNotifications": { - "description": "A list of runtime conditions detected by the tool in the course of the analysis.", + "taxa": { + "description": "An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies.", "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], "items": { - "$ref": "#/definitions/notification" + "$ref": "#/definitions/reportingDescriptor" } }, - "configurationNotifications": { - "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.", + "locations": { + "description": "An array of the artifactLocation objects associated with the tool component.", "type": "array", + "minItems": 0, + "default": [], "items": { - "$ref": "#/definitions/notification" + "$ref": "#/definitions/artifactLocation" } }, - "rules": { - "description": "A dictionary, each of whose keys is a string and each of whose values is a 'rule' object, that describe all rules associated with an analysis tool or a specific run of an analysis tool.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/rule" + "language": { + "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", + "type": "string", + "default": "en-US", + "pattern": "^[a-zA-Z]{2}|^[a-zA-Z]{2}-[a-zA-Z]{2}]?$" + }, + + "contents": { + "description": "The kinds of data contained in this object.", + "type": "array", + "uniqueItems": true, + "default": [ "localizedData", "nonLocalizedData" ], + "items": { + "enum": [ + "localizedData", + "nonLocalizedData" + ] } }, - "id": { - "description": "An identifier for the run.", - "type": "string" + "isComprehensive": { + "description": "Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file.", + "type": "boolean", + "default": false }, - "stableId": { - "description": "A stable identifier for a run, for example, 'nightly Clang analyzer run'. Multiple runs of the same type can have the same stableId.", + "localizedDataSemanticVersion": { + "description": "The semantic version of the localized strings defined in this component; maintained by components that provide translations.", "type": "string" }, - "automationId": { - "description": "A global identifier that allows the run to be correlated with other artifacts produced by a larger automation process.", + "minimumRequiredLocalizedDataSemanticVersion": { + "description": "The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations.", "type": "string" }, - "baselineId": { - "description": "The 'id' property of a separate (potentially external) SARIF 'run' instance that comprises the baseline that was used to compute result 'baselineState' properties for the run.", - "type": "string" + "associatedComponent": { + "description": "The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model.", + "$ref": "#/definitions/toolComponentReference" }, - "architecture": { - "description": "The hardware architecture for which the run was targeted.", - "type": "string" + "translationMetadata": { + "description": "Translation metadata, required for a translation, not populated by other component types.", + "$ref": "#/definitions/translationMetadata" + }, + + "supportedTaxonomies": { + "description": "An array of toolComponentReference objects to declare the taxonomies supported by the tool component.", + "type": "array", + "minItems": 0, + "uniqueItems": true, + "default": [], + "items": { + "$ref": "#/definitions/toolComponentReference" + } + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the tool component.", + "$ref": "#/definitions/propertyBag" } }, - "required": [ "tool" ] + + "required": [ "name" ] }, - "stack": { - "description": "A call stack that is relevant to a result.", - "additionalProperties": false, + + "toolComponentReference": { + "description": "Identifies a particular toolComponent object, either the driver or an extension.", "type": "object", + "additionalProperties": false, "properties": { - "message": { - "description": "A message relevant to this call stack.", + "name": { + "description": "The 'name' property of the referenced toolComponent.", "type": "string" }, - "frames": { - "description": "An array of stack frames that represent a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/stackFrame" - } + "index": { + "description": "An index into the referenced toolComponent in tool.extensions.", + "type": "integer", + "default": -1, + "minimum": -1 + }, + + "guid": { + "description": "The 'guid' property of the referenced toolComponent.", + "type": "string", + "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "properties": { - "description": "Key/value pairs that provide additional information about the stack.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the toolComponentReference.", + "$ref": "#/definitions/propertyBag" } - }, - "required": [ "frames" ] + } }, - "stackFrame": { - "description": "A function call within a stack trace.", - "additionalProperties": false, + + "translationMetadata": { + "description": "Provides additional metadata related to translation.", "type": "object", + "additionalProperties": false, "properties": { - "message": { - "description": "A message relevant to this stack frame.", + "name": { + "description": "The name associated with the translation metadata.", "type": "string" }, - "uri": { - "description": "The uri of the source code file to which this stack frame refers.", + "fullName": { + "description": "The full name associated with the translation metadata.", + "type": "string" + }, + + "shortDescription": { + "description": "A brief description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "fullDescription": { + "description": "A comprehensive description of the translation metadata.", + "$ref": "#/definitions/multiformatMessageString" + }, + + "downloadUri": { + "description": "The absolute URI from which the translation metadata can be downloaded.", "type": "string", "format": "uri" }, - "uriBaseId": { - "description": "A string that identifies the conceptual base for the 'uri' property (if it is relative), e.g.,'$(SolutionDir)' or '%SRCROOT%'.", - "type": "string" + "informationUri": { + "description": "The absolute URI from which information related to the translation metadata can be downloaded.", + "type": "string", + "format": "uri" }, - "line": { - "description": "The line of the location to which this stack frame refers.", - "type": "integer" + "properties": { + "description": "Key/value pairs that provide additional information about the translation metadata.", + "$ref": "#/definitions/propertyBag" + } + }, + "required": [ "name" ] + }, + + "versionControlDetails": { + "description": "Specifies the information necessary to retrieve a desired revision from a version control system.", + "type": "object", + "additionalProperties": false, + "properties": { + + "repositoryUri": { + "description": "The absolute URI of the repository.", + "type": "string", + "format": "uri" }, - "column": { - "description": "The line of the location to which this stack frame refers.", - "type": "integer" + "revisionId": { + "description": "A string that uniquely and permanently identifies the revision within the repository.", + "type": "string" }, - "module": { - "description": "The name of the module that contains the code of this stack frame.", + "branch": { + "description": "The name of a branch containing the revision.", "type": "string" }, - "threadId": { - "description": "The thread identifier of the stack frame.", - "type": "integer" + "revisionTag": { + "description": "A tag that has been applied to the revision.", + "type": "string" + }, + + "asOfTimeUtc": { + "description": "A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time.", + "type": "string", + "format": "date-time" + }, + + "mappedTo": { + "description": "The location in the local file system to which the root of the repository was mapped at the time of the analysis.", + "$ref": "#/definitions/artifactLocation" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the version control details.", + "$ref": "#/definitions/propertyBag" + } + }, + + "required": [ "repositoryUri" ] + }, + + "webRequest": { + "description": "Describes an HTTP request.", + "type": "object", + "additionalProperties": false, + "properties": { + + "index": { + "description": "The index within the run.webRequests array of the request object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 + }, - "fullyQualifiedLogicalName": { - "description": "The fully qualified name of the method or function that is executing.", + "protocol": { + "description": "The request protocol. Example: 'http'.", "type": "string" }, - "logicalLocationKey": { - "description": "A key used to retrieve the stack frame logicalLocation from the logicalLocations dictionary, when the 'fullyQualifiedLogicalName' is not unique.", + "version": { + "description": "The request version. Example: '1.1'.", "type": "string" }, - "address": { - "description": "The address of the method or function that is executing.", - "type": "integer" + "target": { + "description": "The target of the request.", + "type": "string" }, - "offset": { - "description": "The offset from the method or function that is executing.", - "type": "integer" + "method": { + "description": "The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'.", + "type": "string" }, - "parameters": { - "description": "The parameters of the call that is executing.", - "type": "array", - "items": { - "type": "string", - "default": [] + "headers": { + "description": "The request headers.", + "type": "object", + "additionalProperties": { + "type": "string" } }, - "properties": { - "description": "Key/value pairs that provide additional information about the stack frame.", + "parameters": { + "description": "The request parameters.", "type": "object", - "additionalProperties": true, - "properties": { - "tags": { - - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } + "additionalProperties": { + "type": "string" } - } - }, + }, - "required": [ "fullyQualifiedLogicalName" ], - "dependencies": { - "uriBaseId": [ "uri" ], - "line": [ "uri" ], - "column": [ "line" ] + "body": { + "description": "The body of the request.", + "$ref": "#/definitions/artifactContent" + }, + + "properties": { + "description": "Key/value pairs that provide additional information about the request.", + "$ref": "#/definitions/propertyBag" + } } }, - "tool": { - "description": "The analysis tool that was run.", - "additionalProperties": false, + + "webResponse": { + "description": "Describes the response to an HTTP request.", "type": "object", + "additionalProperties": false, "properties": { - "name": { - "description": "The name of the tool.", - "type": "string" + "index": { + "description": "The index within the run.webResponses array of the response object associated with this result.", + "type": "integer", + "default": -1, + "minimum": -1 }, - "fullName": { - "description": "The name of the tool along with its version and any other useful identifying information, such as its locale.", + "protocol": { + "description": "The response protocol. Example: 'http'.", "type": "string" }, "version": { - "description": "The tool version, in whatever format the tool natively provides.", + "description": "The response version. Example: '1.1'.", "type": "string" }, - "semanticVersion": { - "description": "The tool version in the format specified by Semantic Versioning 2.0.", + "statusCode": { + "description": "The response status code. Example: 451.", + "type": "integer" + }, + + "reasonPhrase": { + "description": "The response reason. Example: 'Not found'.", "type": "string" }, - "fileVersion": { - "description": "The binary version of the tool's primary executable file (for operating systems such as Windows that provide that information).", - "type": "string", - "pattern": "[0-9]+(\\.[0-9]+){3}" + "headers": { + "description": "The response headers.", + "type": "object", + "additionalProperties": { + "type": "string" + } }, - "sarifLoggerVersion": { - "description": "A version that uniquely identifies the SARIF logging component that generated this file, if it is versioned separately from the tool.", - "type": "string" + "body": { + "description": "The body of the response.", + "$ref": "#/definitions/artifactContent" }, - "language": { - "description": "The tool language (expressed as an ISO 649 two-letter lowercase culture code) and region (expressed as an ISO 3166 two-letter uppercase subculture code associated with a country or region).", - "type": "string" + "noResponseReceived": { + "description": "Specifies whether a response was received from the server.", + "type": "boolean", + "default": false }, "properties": { - "description": "Key/value pairs that provide additional information about the tool.", - "type": "object", - "additionalProperties": true, - "properties": { - - "tags": { - "description": "A set of distinct strings that provide additional information.", - "type": "array", - "uniqueItems": true, - "default": [], - "items": { - "type": "string" - } - } - } + "description": "Key/value pairs that provide additional information about the response.", + "$ref": "#/definitions/propertyBag" } - }, - "required": [ "name" ] + } } } -} \ No newline at end of file +} diff --git a/src/NVika/packages.config b/src/NVika/packages.config index e616e15d..5c84d3c4 100644 --- a/src/NVika/packages.config +++ b/src/NVika/packages.config @@ -7,7 +7,7 @@ - +