aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-css-plugin/src/main/resources/org
diff options
context:
space:
mode:
authorAmaury Levé2018-06-22 16:22:04 +0200
committerGitHub2018-06-22 16:22:04 +0200
commit7385260825c79419a920bdf835e925cef916b404 (patch)
tree0d50a28fc9e2eb0de3169c602651617c6d2a8c13 /sonar-css-plugin/src/main/resources/org
parent08d6560282dcd46710d7ad2db4ab8a4bb969e116 (diff)
downloadsonar-css-7385260825c79419a920bdf835e925cef916b404.tar.bz2
Rule S4656: Properties should not be duplicated (#63)
Diffstat (limited to 'sonar-css-plugin/src/main/resources/org')
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.html19
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.json16
-rw-r--r--sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/Sonar_way_profile.json1
3 files changed, 36 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.html
new file mode 100644
index 0000000..d852e29
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.html
@@ -0,0 +1,19 @@
+<p>CSS allows duplicate property names but only the last instance of a duplicated name determines the actual value that will be used for it.
+Therefore, changing values of other occurrences of a duplicated name will have no effect and may cause misunderstandings and bugs.</p>
+<p>This rule ignores <code>$sass</code>, <code>@less</code>, and <code>var(--custom-property)</code> variable syntaxes.</p>
+<h2>Noncompliant Code Example</h2>
+<pre>
+a {
+ color: pink;
+ background: orange;
+ color: orange
+}
+</pre>
+<h2>Compliant Solution</h2>
+<pre>
+a {
+ color: pink;
+ background: orange
+}
+</pre>
+
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.json
new file mode 100644
index 0000000..895ddb2
--- /dev/null
+++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S4656.json
@@ -0,0 +1,16 @@
+{
+ "title": "Properties should not be duplicated",
+ "type": "BUG",
+ "status": "ready",
+ "remediation": {
+ "func": "Constant\/Issue",
+ "constantCost": "1min"
+ },
+ "tags": [
+
+ ],
+ "defaultSeverity": "Major",
+ "ruleSpecification": "RSPEC-4656",
+ "sqKey": "S4656",
+ "scope": "Main"
+}
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 8f0de75..14b9668 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
@@ -5,6 +5,7 @@
"S4652",
"S4653",
"S4655",
+ "S4656",
"S4663",
"S4667"
]