diff options
| author | Amaury Levé | 2018-06-25 11:55:11 +0200 | 
|---|---|---|
| committer | Amaury Levé | 2018-06-25 15:05:03 +0200 | 
| commit | 0105e87be8d99a8e9c99faa0a278fc3a2d676a20 (patch) | |
| tree | 09f6c39469ecc29714e0b466a6a27e1e26332285 /sonar-css-plugin/src/main/resources/org | |
| parent | 99ba1731fae85f49ae6bd9462a7d52070f104b52 (diff) | |
| download | sonar-css-0105e87be8d99a8e9c99faa0a278fc3a2d676a20.tar.bz2 | |
Rule S1116: Empty statements should be removed
Diffstat (limited to 'sonar-css-plugin/src/main/resources/org')
3 files changed, 38 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.html new file mode 100644 index 0000000..b2bc4a3 --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.html @@ -0,0 +1,19 @@ +<p>Empty statements, i.e. <code>;</code>, are usually introduced by mistake, for example because:</p> +<ul> +  <li> It was meant to be replaced by an actual statement, but this was forgotten. </li> +  <li> There was a typo which lead the semicolon to be doubled, i.e. <code>;;</code>. </li> +</ul> +<h2>See</h2> +<ul> +  <li> MISRA C:2004, 14.3 - Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment provided that +  the first character following the null statement is a white-space character. </li> +  <li> MISRA C++:2008, 6-2-3 - Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment, provided +  that the first character following the null statement is a white-space character. </li> +  <li> <a href="https://www.securecoding.cert.org/confluence/x/NYA5">CERT, MSC12-C.</a> - Detect and remove code that has no effect or is never +  executed </li> +  <li> <a href="https://www.securecoding.cert.org/confluence/x/7gCTAw">CERT, MSC51-J.</a> - Do not place a semicolon immediately following an if, for, +  or while condition </li> +  <li> <a href="https://www.securecoding.cert.org/confluence/x/i4FtAg">CERT, EXP15-C.</a> - Do not place a semicolon on the same line as an if, for, +  or while statement </li> +</ul> + diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.json new file mode 100644 index 0000000..d2937b8 --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.json @@ -0,0 +1,18 @@ +{ +  "title": "Empty statements should be removed", +  "type": "CODE_SMELL", +  "status": "ready", +  "remediation": { +    "func": "Constant\/Issue", +    "constantCost": "2min" +  }, +  "tags": [ +    "misra", +    "cert", +    "unused" +  ], +  "defaultSeverity": "Minor", +  "ruleSpecification": "RSPEC-1116", +  "sqKey": "S1116", +  "scope": "All" +} diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json index 64ab8d6..0a7d005 100644 --- a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json @@ -1,6 +1,7 @@  {    "name": "Sonar way",    "ruleKeys": [ +    "S1116",      "S1128",      "S4647",      "S4648",  | 
