Skip to content

Commit

Permalink
Merge branch 'master' into Pavel/Automation
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-antognini-sonarsource authored Nov 7, 2024
2 parents 07d5d2a + ad2abce commit 97c904a
Show file tree
Hide file tree
Showing 469 changed files with 3,310 additions and 2,687 deletions.
12 changes: 10 additions & 2 deletions docs/description.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,22 @@ tsql:: use `sql`

In case no language is appropriate for a code block (for example shared examples between multiple languages), you can use `text` as the language.

=== References within code blocks
=== Comments within code blocks

Colon (`:`) should be used as separator between `Noncompliant`/`Compliant` comments and the text explanation that follows, if any.

[source,cpp]
----
int X = 2; // Noncompliant: variable should be in lowercase
----


When referencing a name within a comment in a code example, use double quotes to make it clear it refers to an existing element in the code.

[source,cpp]
----
int i = 0;
cout << noexcept(++i); // Noncompliant, "i" is not incremented
cout << noexcept(++i); // Noncompliant: "i" is not incremented
----

=== Diff view
Expand Down
2 changes: 1 addition & 1 deletion docs/metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ You can update the quickfix field using this GitHub Workflow: https://github.com

The code field is an object that contains information related to the clean code taxonomy. It is an object with two required properties:

* `impacts`: A nested object that is treated as a mapping from a software quality to a level (`"LOW"`, `"MEDIUM"` or `"HIGH"`). Note that at least one software quality has to be specified. The current list of allowed software qualities is `"MAINTAINABILITY"`, `"RELIABILITY"` and `"SECURITY"`.
* `impacts`: A nested object that is treated as a mapping from a software quality to a level (`"INFO"`, `"LOW"`, `"MEDIUM"`, `"HIGH"` or `"BLOCKER"`). Note that at least one software quality has to be specified. The current list of allowed software qualities is `"MAINTAINABILITY"`, `"RELIABILITY"` and `"SECURITY"`.

* `attribute`: A single clean code attribute that the rule aims to achieve. This has to be one of the following values: `"FORMATTED"`, `"CONVENTIONAL"`, `"IDENTIFIABLE"`, `"CLEAR"`, `"LOGICAL"`, `"COMPLETE"`, `"EFFICIENT"`, `"FOCUSED"`, `"DISTINCT"`, `"MODULAR"`, `"TESTED"`, `"LAWFUL"`, `"TRUSTWORTHY"`, `"RESPECTFUL"`.
222 changes: 156 additions & 66 deletions frontend/public/covered_rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,21 @@
"ANSIBLE": {
"S1135": "sonar-iac-enterprise 1.37.0.12742",
"S2260": "sonar-iac-enterprise 1.37.0.12742",
"S4830": "sonar-iac-enterprise master",
"S5332": "sonar-iac-enterprise master",
"S6321": "sonar-iac-enterprise master",
"S6428": "sonar-iac-enterprise master"
"S2612": "sonar-iac-enterprise 1.38.0.13264",
"S4830": "sonar-iac-enterprise 1.38.0.13264",
"S5332": "sonar-iac-enterprise 1.38.0.13264",
"S5849": "sonar-iac-enterprise 1.38.0.13264",
"S6321": "sonar-iac-enterprise 1.38.0.13264",
"S6428": "sonar-iac-enterprise 1.38.0.13264",
"S6429": "sonar-iac-enterprise 1.38.0.13264",
"S6430": "sonar-iac-enterprise 1.38.0.13264",
"S6431": "sonar-iac-enterprise 1.38.0.13264",
"S6433": "sonar-iac-enterprise 1.38.0.13264",
"S6437": "sonar-iac-enterprise 1.38.0.13264",
"S6473": "sonar-iac-enterprise 1.38.0.13264",
"S6596": "sonar-iac-enterprise 1.38.0.13264",
"S6867": "sonar-iac-enterprise 1.38.0.13264",
"S6868": "sonar-iac-enterprise 1.38.0.13264"
},
"APEX": {
"S100": "sonar-apex 1.17.0.87",
Expand Down Expand Up @@ -446,6 +457,7 @@
"S5982": "sonar-cpp 6.13.0.22261",
"S6069": "sonar-cpp 6.14.0.23970",
"S6200": "sonar-cpp 6.27.0.38122",
"S6418": "sonar-cpp master",
"S6655": "sonar-cpp 6.47.0.62356",
"S6871": "sonar-cpp 6.53.0.67215",
"S6936": "sonar-cpp 6.54.0.69031",
Expand Down Expand Up @@ -1279,6 +1291,7 @@
"S6369": "sonar-cpp 6.29.0.41127",
"S6372": "sonar-cpp 6.29.0.41127",
"S6391": "sonar-cpp 6.29.0.41127",
"S6418": "sonar-cpp master",
"S6427": "sonar-cpp 6.35.0.50389",
"S6456": "sonar-cpp 6.40.0.60592",
"S6458": "sonar-cpp 6.40.0.60592",
Expand Down Expand Up @@ -2051,6 +2064,7 @@
"S1206": "sonar-dart 0.1.0.1359",
"S121": "sonar-dart 0.1.0.1359",
"S1481": "sonar-dart 0.1.0.1359",
"S1541": "sonar-dart 0.4.0.1887",
"S1578": "sonar-dart 0.1.0.1359",
"S1679": "sonar-dart 0.1.0.1359",
"S1854": "sonar-dart 0.1.0.1359",
Expand Down Expand Up @@ -4352,6 +4366,7 @@
"S5982": "sonar-cpp 6.13.0.22261",
"S6069": "sonar-cpp 6.14.0.23970",
"S6200": "sonar-cpp 6.27.0.38122",
"S6418": "sonar-cpp master",
"S6871": "sonar-cpp 6.53.0.67215",
"S6936": "sonar-cpp 6.54.0.69031",
"S6991": "sonar-cpp 6.57.0.73017",
Expand Down Expand Up @@ -5463,96 +5478,171 @@
"S6292": "sonar-secrets 1.1.0.36766",
"S6334": "sonar-secrets 1.1.0.36766",
"S6335": "sonar-secrets 1.1.0.36766",
"S6336": "sonar-secrets 1.1.0.36766",
"S6337": "sonar-secrets 1.1.0.36766",
"S6336": {
"since": "sonar-secrets 1.1.0.36766",
"until": "sonar-text 2.5.0.2293"
},
"S6337": {
"since": "sonar-secrets 1.1.0.36766",
"until": "sonar-text 2.5.0.2293"
},
"S6338": "sonar-secrets 1.1.0.36766",
"S6652": {
"since": "sonar-text 2.2.0.1571",
"until": "sonar-text 2.2.0.1571"
},
"S6684": "sonar-text 2.3.0.1632",
"S6686": "sonar-text 2.3.0.1632",
"S6686": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6687": "sonar-text 2.3.0.1632",
"S6688": "sonar-text 2.3.0.1632",
"S6688": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6689": "sonar-text 2.3.0.1632",
"S6690": "sonar-text 2.3.0.1632",
"S6691": "sonar-text 2.3.0.1632",
"S6692": "sonar-text 2.3.0.1632",
"S6691": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6692": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6693": "sonar-text 2.3.0.1632",
"S6694": "sonar-text 2.3.0.1632",
"S6695": "sonar-text 2.3.0.1632",
"S6696": "sonar-text 2.3.0.1632",
"S6695": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6696": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6697": "sonar-text 2.3.0.1632",
"S6698": "sonar-text 2.3.0.1632",
"S6699": "sonar-text 2.3.0.1632",
"S6700": "sonar-text 2.3.0.1632",
"S6699": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6700": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6701": "sonar-text 2.3.0.1632",
"S6702": "sonar-text 2.3.0.1632",
"S6703": "sonar-text 2.3.0.1632",
"S6704": "sonar-text 2.3.0.1632",
"S6705": "sonar-text 2.3.0.1632",
"S6704": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6705": {
"since": "sonar-text 2.3.0.1632",
"until": "sonar-text 2.5.0.2293"
},
"S6706": "sonar-text 2.3.0.1632",
"S6708": "sonar-text 2.4.0.2120",
"S6710": "sonar-text 2.4.0.2120",
"S6713": "sonar-text 2.4.0.2120",
"S6717": "sonar-text 2.4.0.2120",
"S6718": "sonar-text 2.4.0.2120",
"S6719": "sonar-text 2.4.0.2120",
"S6720": "sonar-text 2.4.0.2120",
"S6721": "sonar-text 2.4.0.2120",
"S6722": "sonar-text 2.4.0.2120",
"S6723": "sonar-text 2.4.0.2120",
"S6731": "sonar-text 2.4.0.2120",
"S6732": "sonar-text 2.4.0.2120",
"S6733": "sonar-text 2.4.0.2120",
"S6736": "sonar-text 2.4.0.2120",
"S6710": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6713": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6717": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6718": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6719": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6720": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6721": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6722": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6723": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6731": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6732": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6733": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6736": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6739": "sonar-text 2.4.0.2120",
"S6751": "sonar-text 2.4.0.2120",
"S6752": "sonar-text 2.4.0.2120",
"S6753": "sonar-text 2.4.0.2120",
"S6755": "sonar-text 2.4.0.2120",
"S6753": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6755": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6758": "sonar-text 2.4.0.2120",
"S6760": "sonar-text 2.4.0.2120",
"S6760": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6762": "sonar-text 2.4.0.2120",
"S6764": "sonar-text 2.4.0.2120",
"S6765": "sonar-text 2.4.0.2120",
"S6768": "sonar-text 2.4.0.2120",
"S6769": "sonar-text 2.4.0.2120",
"S6764": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6765": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6768": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6769": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6771": "sonar-text 2.4.0.2120",
"S6773": "sonar-text 2.4.0.2120",
"S6777": "sonar-text 2.4.0.2120",
"S6773": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6777": {
"since": "sonar-text 2.4.0.2120",
"until": "sonar-text 2.5.0.2293"
},
"S6782": "sonar-text 2.4.0.2120",
"S6783": "sonar-text 2.4.0.2120",
"S6910": "sonar-text master",
"S6987": "sonar-secrets 1.1.0.36766",
"S6988": "sonar-text master",
"S6989": "sonar-text master",
"S6990": "sonar-text master",
"S6992": "sonar-text master",
"S6993": "sonar-text master",
"S6995": "sonar-text master",
"S6997": "sonar-text master",
"S6998": "sonar-text master",
"S6999": "sonar-text master",
"S7000": "sonar-text master",
"S7001": "sonar-text master",
"S7002": "sonar-text master",
"S7003": "sonar-text master",
"S7004": "sonar-text master",
"S7006": "sonar-text master",
"S7007": "sonar-text master",
"S7008": "sonar-text master",
"S7009": "sonar-text master",
"S7010": "sonar-text master",
"S7011": "sonar-text master",
"S7013": "sonar-text master",
"S7014": "sonar-text master",
"S7015": "sonar-text master",
"S7016": "sonar-text master",
"S7017": "sonar-text master",
"S7022": "sonar-text master",
"S7024": "sonar-text master",
"S7025": "sonar-text master"
"S7013": "sonar-text master"
},
"SWIFT": {
"S100": "sonar-swift 3.1.0.2067",
Expand Down
6 changes: 3 additions & 3 deletions rspec-tools/rspec_tools/validation/rule-metadata-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@
"properties": {
"MAINTAINABILITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
},
"RELIABILITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
},
"SECURITY": {
"type": "string",
"enum": ["LOW", "MEDIUM", "HIGH"]
"enum": ["INFO", "LOW", "MEDIUM", "HIGH", "BLOCKER"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion rspec-tools/tests/validation/test_metadata_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_rule_with_invalid_impacts(invalid_rules: RulesRepository):

def test_rule_with_invalid_impact_level(invalid_rules: RulesRepository):
s506 = invalid_rules.get_rule('S506')
with pytest.raises(RuleValidationError, match=re.escape("Rule S506 failed validation for these reasons:\n - Rule scala:S506 has invalid metadata in MAINTAINABILITY: 'INVALID' is not one of ['LOW', 'MEDIUM', 'HIGH']")):
with pytest.raises(RuleValidationError, match=re.escape("Rule S506 failed validation for these reasons:\n - Rule scala:S506 has invalid metadata in MAINTAINABILITY: 'INVALID' is not one of ['INFO', 'LOW', 'MEDIUM', 'HIGH', 'BLOCKER']")):
validate_rule_metadata(s506)


Expand Down
14 changes: 4 additions & 10 deletions rules/S1032/cfamily/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "CODE_SMELL",
"code": {
"impacts": {
"MAINTAINABILITY": "HIGH"
"MAINTAINABILITY": "BLOCKER"
},
"attribute": "CLEAR"
},
Expand All @@ -17,19 +17,13 @@
"based-on-misra"
],
"extra": {
"replacementRules": [

],
"legacyKeys": [

]
"replacementRules": [],
"legacyKeys": []
},
"defaultSeverity": "Blocker",
"ruleSpecification": "RSPEC-1032",
"sqKey": "S1032",
"scope": "Main",
"defaultQualityProfiles": [

],
"defaultQualityProfiles": [],
"quickfix": "unknown"
}
Loading

0 comments on commit 97c904a

Please sign in to comment.