From 0105e87be8d99a8e9c99faa0a278fc3a2d676a20 Mon Sep 17 00:00:00 2001
From: Amaury Levé
Date: Mon, 25 Jun 2018 11:55:11 +0200
Subject: Rule S1116: Empty statements should be removed
---
.../resources/org/sonar/l10n/css/rules/css/S1116.html | 19 +++++++++++++++++++
.../resources/org/sonar/l10n/css/rules/css/S1116.json | 18 ++++++++++++++++++
.../sonar/l10n/css/rules/css/Sonar_way_profile.json | 1 +
3 files changed, 38 insertions(+)
create mode 100644 sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.html
create mode 100644 sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1116.json
(limited to 'sonar-css-plugin/src/main/resources')
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 @@
+
Empty statements, i.e. ;, are usually introduced by mistake, for example because:
+
+ - It was meant to be replaced by an actual statement, but this was forgotten.
+ - There was a typo which lead the semicolon to be doubled, i.e.
;;.
+
+See
+
+ - 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.
+ - 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.
+ - CERT, MSC12-C. - Detect and remove code that has no effect or is never
+ executed
+ - CERT, MSC51-J. - Do not place a semicolon immediately following an if, for,
+ or while condition
+ - CERT, EXP15-C. - Do not place a semicolon on the same line as an if, for,
+ or while statement
+
+
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",
--
cgit v1.2.3