Skip to content

CPP-6157 Fix discrepancies between MQR and severity for CFamily rules #4669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rules/S6936/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"type": "CODE_SMELL",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
"MAINTAINABILITY": "BLOCKER"
},
"attribute": "CONVENTIONAL"
"attribute": "CLEAR"
},
"status": "ready",
"remediation": {
Expand Down
2 changes: 1 addition & 1 deletion rules/S6996/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"tags": [
"since-c++11"
],
"defaultSeverity": "Major",
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-6996",
"sqKey": "S6996",
"scope": "All",
Expand Down
2 changes: 1 addition & 1 deletion rules/S7032/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"quickfix": "infeasible",
"code": {
"impacts": {
"MAINTAINABILITY": "HIGH"
"MAINTAINABILITY": "MEDIUM"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HIGH seems ok for me here. I really don't understand the fact that HIGH and CRITICAL are related. Or to say in another way, in non-MQR mode, the names cover a 2 dimension design space, while in MQR mode, they convey a single dimension scale...

Anyways, I think there is a high impact / low likelihood risk there, in the case where the mutex is not locked.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it as MEDIUM because I disagree with the mutex not locked case: creating an unnamed lock would be exactly the same bug outside an if and we already catch it with S5184

},
"attribute": "CLEAR"
}
Expand Down
2 changes: 1 addition & 1 deletion rules/S7038/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"since-c++23",
"pitfall"
],
"defaultSeverity": "Major",
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-7038",
"sqKey": "S7038",
"scope": "All",
Expand Down
2 changes: 1 addition & 1 deletion rules/S7040/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"since-c++23",
"bad-practice"
],
"defaultSeverity": "Minor",
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-7040",
"sqKey": "S7040",
"scope": "All",
Expand Down
6 changes: 3 additions & 3 deletions rules/S7119/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
"tags": [
"unpredictable"
],
"defaultSeverity": "Major",
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-7119",
"sqKey": "S7119",
"scope": "All",
"defaultQualityProfiles": ["Sonar way"],
"quickfix": "infeasible",
"code": {
"impacts": {
"MAINTAINABILITY": "HIGH",
"RELIABILITY": "LOW"
"MAINTAINABILITY": "LOW",
"RELIABILITY": "HIGH"
},
"attribute": "LOGICAL"
}
Expand Down
6 changes: 3 additions & 3 deletions rules/S7127/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
},
"tags": [
],
"defaultSeverity": "Minor",
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-7127",
"sqKey": "S7127",
"scope": "All",
"defaultQualityProfiles": ["Sonar way"],
"quickfix": "covered",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM"
"MAINTAINABILITY": "HIGH"
},
"attribute": "CONVENTIONAL"
"attribute": "CLEAR"
}
}