Skip to content

Commit

Permalink
Fix tests and severity display
Browse files Browse the repository at this point in the history
  • Loading branch information
frederic-tingaud-sonarsource committed Feb 20, 2025
1 parent a27c13b commit b44ed7c
Show file tree
Hide file tree
Showing 21 changed files with 276 additions and 42 deletions.
190 changes: 158 additions & 32 deletions frontend/src/__tests__/__snapshots__/RulePage.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,61 @@ var res = string.Format("{0} {1}", array); // Compliant we don't know the size o
</span>
,
<span
class="hljs-attr"
>
"code"
</span>
: {
<span
class="hljs-attr"
>
"impacts"
</span>
: {
<span
class="hljs-attr"
>
"MAINTAINABILITY"
</span>
:
<span
class="hljs-string"
>
"MEDIUM"
</span>
},
<span
class="hljs-attr"
>
"attribute"
</span>
:
<span
class="hljs-string"
>
"CLEAR"
</span>
},
<span
class="hljs-attr"
>
"severity"
</span>
:
<span
class="hljs-string"
>
"MEDIUM"
</span>
,
<span
class="hljs-attr"
>
Expand Down Expand Up @@ -939,19 +994,6 @@ var res = string.Format("{0} {1}", array); // Compliant we don't know the size o
</span>
,
<span
class="hljs-attr"
>
"defaultSeverity"
</span>
:
<span
class="hljs-string"
>
"Major"
</span>
,
<span
class="hljs-attr"
>
Expand Down Expand Up @@ -1887,6 +1929,48 @@ exports[`renders cfamily version of S1000 1`] = `
</span>
,
<span
class="hljs-attr"
>
"code"
</span>
: {
<span
class="hljs-attr"
>
"impacts"
</span>
: {
<span
class="hljs-attr"
>
"MAINTAINABILITY"
</span>
:
<span
class="hljs-string"
>
"MEDIUM"
</span>
},
<span
class="hljs-attr"
>
"attribute"
</span>
:
<span
class="hljs-string"
>
"CLEAR"
</span>
},
<span
class="hljs-attr"
>
Expand Down Expand Up @@ -1990,39 +2074,39 @@ exports[`renders cfamily version of S1000 1`] = `
<span
class="hljs-attr"
>
"defaultSeverity"
"ruleSpecification"
</span>
:
<span
class="hljs-string"
>
"Major"
"RSPEC-1000"
</span>
,
<span
class="hljs-attr"
>
"ruleSpecification"
"sqKey"
</span>
:
<span
class="hljs-string"
>
"RSPEC-1000"
"UnnamedNamespaceInHeader"
</span>
,
<span
class="hljs-attr"
>
"sqKey"
"severity"
</span>
:
<span
class="hljs-string"
>
"UnnamedNamespaceInHeader"
"MEDIUM"
</span>
,
Expand Down Expand Up @@ -3561,6 +3645,61 @@ var res = string.Format("{0} {1}", array); // Compliant we don't know the size o
</span>
,
<span
class="hljs-attr"
>
"code"
</span>
: {
<span
class="hljs-attr"
>
"impacts"
</span>
: {
<span
class="hljs-attr"
>
"MAINTAINABILITY"
</span>
:
<span
class="hljs-string"
>
"MEDIUM"
</span>
},
<span
class="hljs-attr"
>
"attribute"
</span>
:
<span
class="hljs-string"
>
"CLEAR"
</span>
},
<span
class="hljs-attr"
>
"severity"
</span>
:
<span
class="hljs-string"
>
"MEDIUM"
</span>
,
<span
class="hljs-attr"
>
Expand Down Expand Up @@ -3653,19 +3792,6 @@ var res = string.Format("{0} {1}", array); // Compliant we don't know the size o
</span>
,
<span
class="hljs-attr"
>
"defaultSeverity"
</span>
:
<span
class="hljs-string"
>
"Major"
</span>
,
<span
class="hljs-attr"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"type": "CODE_SMELL",
"status": "ready",
"quickfix": "unknown",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"remediation": {
"func": "Constant/Issue",
"constantCost": "1h"
Expand All @@ -21,6 +27,7 @@
},
"ruleSpecification": "RSPEC-1000",
"sqKey": "UnnamedNamespaceInHeader",
"severity": "MEDIUM",
"scope": "Main",
"securityStandards": {
"CERT": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"func": "Constant/Issue",
"constantCost": "1h"
},
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"tags": [
"cert",
"misra-c++2008",
Expand All @@ -20,6 +26,7 @@
},
"ruleSpecification": "RSPEC-1000",
"sqKey": "UnnamedNamespaceInHeader",
"severity": "MEDIUM",
"scope": "Main",
"securityStandards": {
"CERT": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"title": "Printf-style format strings should be used correctly",
"type": "CODE_SMELL",
"status": "ready",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
Expand Down Expand Up @@ -31,6 +37,7 @@
"FIO47-C."
]
},
"severity": "MEDIUM",
"languagesSupport": [
{
"name": "cfamily",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"title": "Composite format strings should be used correctly",
"type": "CODE_SMELL",
"status": "ready",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"severity": "MEDIUM",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "10min"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"title": "Printf-style format strings should be used correctly",
"type": "CODE_SMELL",
"status": "ready",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"severity": "MEDIUM",
"remediation": {
"func": "Constant/Issue",
"constantCost": "10min"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
"CERT": [
"FIO47-C."
]
}, "ruleSpecification": "RSPEC-3457",
},
"code": {
"attribute": "CLEAR",
"impacts": {
"MAINTAINABILITY": "MEDIUM"
}
},
"severity": "MEDIUM",
"ruleSpecification": "RSPEC-3457",
"sqKey": "S3457",
"scope": "All",
"languagesSupport": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
"allKeys": [
"S3457"
],
"code": {
"attribute": "CLEAR",
"impacts": {
"MAINTAINABILITY": "MEDIUM"
}
},
"severity": "MEDIUM",
"ruleSpecification": "RSPEC-3457",
"sqKey": "S3457",
"scope": "All",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"title": "Database queries should not be vulnerable to injection attacks",
"type": "VULNERABILITY",
"status": "ready",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
},
"attribute": "CLEAR"
},
"severity": "MEDIUM",
"remediation": {
"func": "Constant\/Issue",
"constantCost": "30min"
Expand Down
Loading

0 comments on commit b44ed7c

Please sign in to comment.