Skip to content

Commit

Permalink
SONARJAVA-4045 Update rules metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-jaquier-sonarsource authored Oct 18, 2021
1 parent 3bec31c commit 3b1a383
Show file tree
Hide file tree
Showing 604 changed files with 1,332 additions and 867 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-100",
"sqKey": "S100",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-101",
"sqKey": "S101",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-103",
"sqKey": "S103",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-104",
"sqKey": "S104",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-105",
"sqKey": "S105",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ruleSpecification": "RSPEC-1065",
"sqKey": "S1065",
"scope": "All",
"quickfix": "unknown",
"securityStandards": {
"CERT": [
"MSC12-C."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1066",
"sqKey": "S1066",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1067",
"sqKey": "S1067",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1068",
"sqKey": "S1068",
"scope": "All"
"scope": "All",
"quickfix": "covered"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
"sqKey": "S106",
"scope": "Main",
"securityStandards": {
"OWASP": [
"A3"
],
"CERT": [
"ERR02-J."
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ruleSpecification": "RSPEC-1075",
"sqKey": "S1075",
"scope": "Main",
"quickfix": "unknown",
"securityStandards": {
"CERT": [
"MSC03-J."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-107",
"sqKey": "S107",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-108",
"sqKey": "S108",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-109",
"sqKey": "S109",
"scope": "Main"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1104",
"sqKey": "ClassVariableVisibilityCheck",
"sqKey": "S1104",
"scope": "Main",
"securityStandards": {
"CWE": [
493
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1105",
"sqKey": "S1105",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1106",
"sqKey": "LeftCurlyBraceStartLineCheck",
"scope": "All"
"sqKey": "S1106",
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1107",
"sqKey": "RightCurlyBraceSameLineAsNextBlockCheck",
"scope": "All"
"sqKey": "S1107",
"scope": "All",
"quickfix": "covered"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1108",
"sqKey": "RightCurlyBraceDifferentLineAsNextBlockCheck",
"scope": "All"
"sqKey": "S1108",
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1109",
"sqKey": "S1109",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-110",
"sqKey": "S110",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1110",
"sqKey": "S1110",
"scope": "All"
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1111",
"sqKey": "ObjectFinalizeCheck",
"sqKey": "S1111",
"scope": "Main",
"securityStandards": {
"CWE": [
Expand All @@ -21,5 +21,6 @@
"CERT": [
"MET12-J."
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
],
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1113",
"sqKey": "ObjectFinalizeOverridenCheck",
"sqKey": "S1113",
"scope": "Main",
"securityStandards": {
"CERT": [
"MET12-J."
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"defaultSeverity": "Critical",
"ruleSpecification": "RSPEC-1114",
"sqKey": "ObjectFinalizeOverridenCallsSuperFinalizeCheck",
"sqKey": "S1114",
"scope": "All",
"securityStandards": {
"CWE": [
Expand All @@ -21,5 +21,6 @@
"CERT": [
"MET12-J."
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1116",
"sqKey": "S1116",
"scope": "All",
"scope": "Main",
"quickfix": "covered",
"securityStandards": {
"CERT": [
"MSC12-C.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1117",
"sqKey": "S1117",
"scope": "All",
"scope": "Main",
"quickfix": "unknown",
"securityStandards": {
"CERT": [
"DCL51-J.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1118",
"sqKey": "S1118",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1119",
"sqKey": "LabelsShouldNotBeUsedCheck",
"scope": "All"
"sqKey": "S1119",
"scope": "Main",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1120",
"sqKey": "S1120",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1121",
"sqKey": "S1121",
"scope": "All",
"scope": "Main",
"securityStandards": {
"CWE": [
481
],
"CERT": [
"EXP45-C.",
"EXP51-J.",
"EXP19-CPP."
]
}
},
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
<p>Deprecation should be marked with both the <code>@Deprecated</code> annotation and @deprecated Javadoc tag. The annotation enables tools such as
IDEs to warn about referencing deprecated elements, and the tag can be used to explain when it was deprecated, why, and how references should be
refactored.</p>
<p>Further, Java 9 adds two additional arguments to the annotation:</p>
<ul>
<li> <code>since</code> allows you to describe when the deprecation took place </li>
<li> <code>forRemoval</code>, indicates whether the deprecated element will be removed at some future date </li>
</ul>
<p>If your compile level is Java 9 or higher, you should be using one or both of these arguments.</p>
<h2>Noncompliant Code Example</h2>
<pre>
class MyClass {

@Deprecated
public void foo1() {
public void foo1() { // Noncompliant: Add the missing @deprecated Javadoc tag.
}

/**
* @deprecated
*/
public void foo2() { // Noncompliant
public void foo2() { // Noncompliant: Add the missing @Deprecated annotation.
}

}
Expand All @@ -34,22 +28,6 @@ <h2>Compliant Solution</h2>
public void foo1() {
}

/**
* Java &gt;= 9
* @deprecated (when, why, refactoring advice...)
*/
@Deprecated(since="5.1")
public void foo2() {
}

/**
* Java &gt;= 9
* @deprecated (when, why, refactoring advice...)
*/
@Deprecated(since="4.2", forRemoval=true)
public void foo3() {
}

}
</pre>
<h2>Exceptions</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"defaultSeverity": "Major",
"ruleSpecification": "RSPEC-1123",
"sqKey": "S1123",
"scope": "All"
"scope": "All",
"quickfix": "unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<li> volatile </li>
<li> synchronized </li>
<li> native </li>
<li> default </li>
<li> strictfp </li>
</ol>
<p>Not following this convention has no technical impact, but will reduce the code’s readability because most developers are used to the standard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1124",
"sqKey": "ModifiersOrderCheck",
"scope": "All"
"sqKey": "S1124",
"scope": "All",
"quickfix": "covered"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"defaultSeverity": "Minor",
"ruleSpecification": "RSPEC-1125",
"sqKey": "S1125",
"scope": "All"
"scope": "Main",
"quickfix": "partial"
}
Loading

0 comments on commit 3b1a383

Please sign in to comment.