625 lines
21 KiB
JSON
625 lines
21 KiB
JSON
{
|
|
"$schema": "http://json.schemastore.org/sarif-1.0.0",
|
|
"version": "1.0.0",
|
|
"runs": [
|
|
{
|
|
"tool": {
|
|
"name": "Microsoft (R) Visual C# Compiler",
|
|
"version": "4.14.0.0",
|
|
"fileVersion": "4.14.0-3.25413.5 (b828a8df)",
|
|
"semanticVersion": "4.14.0",
|
|
"language": "en-US"
|
|
},
|
|
"results": [
|
|
{
|
|
"ruleId": "S125",
|
|
"level": "warning",
|
|
"message": "Remove this commented out code.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 147,
|
|
"startColumn": 17,
|
|
"endLine": 147,
|
|
"endColumn": 97
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S125",
|
|
"level": "warning",
|
|
"message": "Remove this commented out code.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Program.cs",
|
|
"region": {
|
|
"startLine": 11,
|
|
"startColumn": 1,
|
|
"endLine": 11,
|
|
"endColumn": 53
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S2068",
|
|
"level": "warning",
|
|
"message": "\"password\" detected here, make sure this is not a hard-coded credential.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/appsettings.json",
|
|
"region": {
|
|
"startLine": 6,
|
|
"startColumn": 18,
|
|
"endLine": 6,
|
|
"endColumn": 24
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S1144",
|
|
"level": "warning",
|
|
"message": "Remove the unused private field 'LibraryNamePattern'.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 152,
|
|
"startColumn": 5,
|
|
"endLine": 152,
|
|
"endColumn": 125
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S101",
|
|
"level": "warning",
|
|
"message": "Rename class 'ORDUAGEndpoint' to match pascal case naming rules, consider using 'OrduagEndpoint'.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 15,
|
|
"startColumn": 21,
|
|
"endLine": 15,
|
|
"endColumn": 35
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S6444",
|
|
"level": "warning",
|
|
"message": "Pass a timeout to limit the execution time.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 152,
|
|
"startColumn": 56,
|
|
"endLine": 152,
|
|
"endColumn": 124
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "SYSLIB1045",
|
|
"level": "note",
|
|
"message": "Use 'GeneratedRegexAttribute' to generate the regular expression implementation at compile-time.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 152,
|
|
"startColumn": 56,
|
|
"endLine": 152,
|
|
"endColumn": 124
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S3776",
|
|
"level": "warning",
|
|
"message": "Refactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 16,
|
|
"startColumn": 37,
|
|
"endLine": 16,
|
|
"endColumn": 54
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"relatedLocations": [
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 24,
|
|
"startColumn": 17,
|
|
"endLine": 24,
|
|
"endColumn": 19
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 36,
|
|
"startColumn": 13,
|
|
"endLine": 36,
|
|
"endColumn": 18
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 59,
|
|
"startColumn": 13,
|
|
"endLine": 59,
|
|
"endColumn": 18
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 74,
|
|
"startColumn": 17,
|
|
"endLine": 74,
|
|
"endColumn": 19
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 92,
|
|
"startColumn": 13,
|
|
"endLine": 92,
|
|
"endColumn": 18
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 107,
|
|
"startColumn": 17,
|
|
"endLine": 107,
|
|
"endColumn": 19
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 107,
|
|
"startColumn": 60,
|
|
"endLine": 107,
|
|
"endColumn": 62
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 135,
|
|
"startColumn": 21,
|
|
"endLine": 135,
|
|
"endColumn": 26
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 138,
|
|
"startColumn": 25,
|
|
"endLine": 138,
|
|
"endColumn": 28
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/As400Endpoints.cs",
|
|
"region": {
|
|
"startLine": 154,
|
|
"startColumn": 13,
|
|
"endLine": 154,
|
|
"endColumn": 18
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1,
|
|
"customProperties": {
|
|
"0": "+2 (incl 1 for nesting)",
|
|
"1": "+2 (incl 1 for nesting)",
|
|
"2": "+2 (incl 1 for nesting)",
|
|
"3": "+2 (incl 1 for nesting)",
|
|
"4": "+2 (incl 1 for nesting)",
|
|
"5": "+2 (incl 1 for nesting)",
|
|
"6": "+1",
|
|
"7": "+2 (incl 1 for nesting)",
|
|
"8": "+3 (incl 2 for nesting)",
|
|
"9": "+2 (incl 1 for nesting)"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "S3776",
|
|
"level": "warning",
|
|
"message": "Refactor this method to reduce its Cognitive Complexity from 19 to the 15 allowed.",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 154,
|
|
"startColumn": 37,
|
|
"endLine": 154,
|
|
"endColumn": 55
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"relatedLocations": [
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 167,
|
|
"startColumn": 21,
|
|
"endLine": 167,
|
|
"endColumn": 23
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 177,
|
|
"startColumn": 21,
|
|
"endLine": 177,
|
|
"endColumn": 23
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 192,
|
|
"startColumn": 21,
|
|
"endLine": 192,
|
|
"endColumn": 23
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 198,
|
|
"startColumn": 21,
|
|
"endLine": 198,
|
|
"endColumn": 23
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 204,
|
|
"startColumn": 21,
|
|
"endLine": 204,
|
|
"endColumn": 23
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 219,
|
|
"startColumn": 21,
|
|
"endLine": 219,
|
|
"endColumn": 28
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 229,
|
|
"startColumn": 25,
|
|
"endLine": 229,
|
|
"endColumn": 30
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 232,
|
|
"startColumn": 29,
|
|
"endLine": 232,
|
|
"endColumn": 32
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"physicalLocation": {
|
|
"uri": "file:///workspaces/AS400API/Endpoints/AS400_CP3FPRD/ORDUAG.cs",
|
|
"region": {
|
|
"startLine": 254,
|
|
"startColumn": 17,
|
|
"endLine": 254,
|
|
"endColumn": 22
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1,
|
|
"customProperties": {
|
|
"0": "+2 (incl 1 for nesting)",
|
|
"1": "+2 (incl 1 for nesting)",
|
|
"2": "+2 (incl 1 for nesting)",
|
|
"3": "+2 (incl 1 for nesting)",
|
|
"4": "+2 (incl 1 for nesting)",
|
|
"5": "+2 (incl 1 for nesting)",
|
|
"6": "+2 (incl 1 for nesting)",
|
|
"7": "+3 (incl 2 for nesting)",
|
|
"8": "+2 (incl 1 for nesting)"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "ASP0025",
|
|
"level": "note",
|
|
"message": "Use AddAuthorizationBuilder to register authorization services and construct policies",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Program.cs",
|
|
"region": {
|
|
"startLine": 100,
|
|
"startColumn": 1,
|
|
"endLine": 106,
|
|
"endColumn": 3
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1
|
|
}
|
|
},
|
|
{
|
|
"ruleId": "CA1861",
|
|
"level": "note",
|
|
"message": "Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array",
|
|
"locations": [
|
|
{
|
|
"resultFile": {
|
|
"uri": "file:///workspaces/AS400API/Infrastructure/DatabaseRowFormatter.cs",
|
|
"region": {
|
|
"startLine": 48,
|
|
"startColumn": 20,
|
|
"endLine": 48,
|
|
"endColumn": 43
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"properties": {
|
|
"warningLevel": 1,
|
|
"customProperties": {
|
|
"paramName": "separator"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"rules": {
|
|
"ASP0025": {
|
|
"id": "ASP0025",
|
|
"shortDescription": "Use AddAuthorizationBuilder",
|
|
"defaultLevel": "note",
|
|
"helpUri": "https://aka.ms/aspnet/analyzers",
|
|
"properties": {
|
|
"category": "Usage",
|
|
"isEnabledByDefault": true
|
|
}
|
|
},
|
|
"CA1861": {
|
|
"id": "CA1861",
|
|
"shortDescription": "Avoid constant arrays as arguments",
|
|
"fullDescription": "Constant arrays passed as arguments are not reused when called repeatedly, which implies a new array is created each time. Consider extracting them to 'static readonly' fields to improve performance if the passed array is not mutated within the called method.",
|
|
"defaultLevel": "note",
|
|
"helpUri": "https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1861",
|
|
"properties": {
|
|
"category": "Performance",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"Telemetry",
|
|
"EnabledRuleInAggressiveMode"
|
|
]
|
|
}
|
|
},
|
|
"S101": {
|
|
"id": "S101",
|
|
"shortDescription": "Types should be named in PascalCase",
|
|
"fullDescription": "Shared naming conventions allow teams to collaborate efficiently. This rule checks whether or not type names are using PascalCase. To reduce noise, two consecutive upper case characters are allowed unless they form the whole type name. So, MyXClass is compliant, but XC on its own is not.",
|
|
"defaultLevel": "warning",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-101",
|
|
"properties": {
|
|
"category": "Minor Code Smell",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"TestSourceScope",
|
|
"SonarWay"
|
|
]
|
|
}
|
|
},
|
|
"S1144": {
|
|
"id": "S1144",
|
|
"shortDescription": "Unused private types or members should be removed",
|
|
"fullDescription": "private or internal types or private members that are never executed or referenced are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.",
|
|
"defaultLevel": "note",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-1144",
|
|
"properties": {
|
|
"category": "Major Code Smell",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"TestSourceScope",
|
|
"SonarWay",
|
|
"Unnecessary"
|
|
]
|
|
}
|
|
},
|
|
"S125": {
|
|
"id": "S125",
|
|
"shortDescription": "Sections of code should not be commented out",
|
|
"fullDescription": "Programmers should not comment out code as it bloats programs and reduces readability.",
|
|
"defaultLevel": "warning",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-125",
|
|
"properties": {
|
|
"category": "Major Code Smell",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"TestSourceScope",
|
|
"SonarWay"
|
|
]
|
|
}
|
|
},
|
|
"S2068": {
|
|
"id": "S2068",
|
|
"shortDescription": "Hard-coded credentials are security-sensitive",
|
|
"fullDescription": "Because it is easy to extract strings from an application source code or binary, credentials should not be hard-coded. This is particularly true for applications that are distributed or that are open-source.",
|
|
"defaultLevel": "warning",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-2068",
|
|
"properties": {
|
|
"category": "Blocker Security Hotspot",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"SonarWay"
|
|
]
|
|
}
|
|
},
|
|
"S3776": {
|
|
"id": "S3776",
|
|
"shortDescription": "Cognitive Complexity of methods should not be too high",
|
|
"fullDescription": "Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.",
|
|
"defaultLevel": "warning",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-3776",
|
|
"properties": {
|
|
"category": "Critical Code Smell",
|
|
"isEnabledByDefault": false,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"TestSourceScope",
|
|
"SonarWay"
|
|
]
|
|
}
|
|
},
|
|
"S6444": {
|
|
"id": "S6444",
|
|
"shortDescription": "Not specifying a timeout for regular expressions is security-sensitive",
|
|
"fullDescription": "Not specifying a timeout for regular expressions can lead to a Denial-of-Service attack. Pass a timeout when using System.Text.RegularExpressions to process untrusted input because a malicious user might craft a value for which the evaluation lasts excessively long.",
|
|
"defaultLevel": "warning",
|
|
"helpUri": "https://rules.sonarsource.com/csharp/RSPEC-6444",
|
|
"properties": {
|
|
"category": "Major Security Hotspot",
|
|
"isEnabledByDefault": true,
|
|
"tags": [
|
|
"C#",
|
|
"MainSourceScope",
|
|
"SonarWay"
|
|
]
|
|
}
|
|
},
|
|
"SYSLIB1045": {
|
|
"id": "SYSLIB1045",
|
|
"shortDescription": "Convert to 'GeneratedRegexAttribute'.",
|
|
"defaultLevel": "note",
|
|
"helpUri": "https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1045",
|
|
"properties": {
|
|
"category": "Performance",
|
|
"isEnabledByDefault": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
} |