diff options
| author | Amaury Levé | 2018-06-25 11:05:10 +0200 | 
|---|---|---|
| committer | Elena Vilchik | 2018-06-25 11:05:10 +0200 | 
| commit | b401bc78e686ba19219b3192280de2feee5b3845 (patch) | |
| tree | 1269a82c4c800e6b2768fefce5823963f2cb7d48 /sonar-css-plugin/src/main/resources/org | |
| parent | fe28c13adda562ba53fbdd90bc072ceb1585cd73 (diff) | |
| download | sonar-css-b401bc78e686ba19219b3192280de2feee5b3845.tar.bz2 | |
Rule S1128: Useless imports should be removed (#64)
Diffstat (limited to 'sonar-css-plugin/src/main/resources/org')
3 files changed, 29 insertions, 0 deletions
diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.html b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.html new file mode 100644 index 0000000..8dde5aa --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.html @@ -0,0 +1,12 @@ +<p>The imports part of a file should be handled by the Integrated Development Environment (IDE), not manually by the developer.</p> +<p>Unused and useless imports should not occur if that is the case.</p> +<p>Leaving them in reduces the code's readability, since their presence can be confusing.</p> +<h2>Noncompliant Code Example</h2> +<pre> +@import 'a.css'; +@import 'a.css'; // Noncompliant + +@import url("a.css"); +@import url("a.css"); // Noncompliant +</pre> + diff --git a/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.json b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.json new file mode 100644 index 0000000..1f7d8bc --- /dev/null +++ b/sonar-css-plugin/src/main/resources/org/sonar/l10n/css/rules/css/S1128.json @@ -0,0 +1,16 @@ +{ +  "title": "Useless imports should be removed", +  "type": "CODE_SMELL", +  "status": "ready", +  "remediation": { +    "func": "Constant\/Issue", +    "constantCost": "2min" +  }, +  "tags": [ +    "unused" +  ], +  "defaultSeverity": "Minor", +  "ruleSpecification": "RSPEC-1128", +  "sqKey": "S1128", +  "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 14b9668..4455af6 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": [ +    "S1128",      "S4647",      "S4652",      "S4653",  | 
