Skip to content

Commit 8022194

Browse files
benzonicosaberduck
authored andcommitted
SONARJAVA-2554 Update rule description and metadata
1 parent 7f57080 commit 8022194

46 files changed

Lines changed: 97 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1166_java.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ <h2>Exceptions</h2>
6060
<h2>See</h2>
6161
<ul>
6262
<li> <a href="https://www.securecoding.cert.org/confluence/x/6gEqAQ">CERT, ERR00-J.</a> - Do not suppress or ignore checked exceptions </li>
63+
<li> OWASP Top 10 2017 Category A10 - Insufficient Logging &amp; Monitoring </li>
6364
</ul>
6465

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1166_java.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"tags": [
1010
"error-handling",
11+
"owasp-a10",
1112
"cert",
1213
"suspicious"
1314
],

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1176_java.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</ul>
1010
<p>Furthermore the following guidelines should be followed:</p>
1111
<ul>
12-
<li> At least 1 line of description which should have more than one word. </li>
12+
<li> At least 1 line of description. </li>
1313
<li> All parameters documented with <code>@param</code>, and names should match. </li>
1414
<li> All checked exceptions documented with <code>@throws</code> </li>
1515
<li> <code>@return</code> present and documented when not <code>void</code>. </li>

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1212_java.html

Lines changed: 0 additions & 11 deletions
This file was deleted.

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1212_java.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1226_java.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<h2>Noncompliant Code Example</h2>
55
<pre>
66
public void doTheThing(String str, int i, List&lt;String&gt; strings) {
7-
str = Integer.toString(i); // Noncompliant
7+
str = Integer.toString(i); // Noncompliant
88

99
for (String s : strings) {
10-
s = "hello world"; // Noncompliant
10+
s = "hello world"; // Noncompliant
1111
}
1212
}
1313
</pre>

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1312_java.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<p>Loggers should be:</p>
1+
<p>Regardless of the logging framework in use (logback, log4j, commons-logging, java.util.logging, ...), loggers should be:</p>
22
<ul>
3-
<li> <code>private</code>: not accessible outside of their parent classes. If another class needs to log something, it should instantiate its own
3+
<li> <code>private</code>: never be accessible outside of its parent class. If another class needs to log something, it should instantiate its own
44
logger. </li>
5-
<li> <code>static</code>: not dependent on an instance of a class (an object). When logging something, contextual information can of course be
5+
<li> <code>static</code>: not be dependent on an instance of a class (an object). When logging something, contextual information can of course be
66
provided in the messages but the logger should be created at class level to prevent creating a logger along with each object. </li>
7-
<li> <code>final</code>: created once and only once per class. </li>
7+
<li> <code>final</code>: be created once and only once per class. </li>
88
</ul>
99
<h2>Noncompliant Code Example</h2>
1010
<p>With a default regular expression of <code>LOG(?:GER)?</code>:</p>

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1641_java.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ <h2>Noncompliant Code Example</h2>
1010

1111
public void doSomething() {
1212
Set&lt;COLOR&gt; warm = new HashSet&lt;COLOR&gt;();
13-
warm.add(COLORS.RED);
14-
warm.add(COLORS.ORANGE);
13+
warm.add(COLOR.RED);
14+
warm.add(COLOR.ORANGE);
1515
}
1616
}
1717
</pre>
@@ -24,7 +24,7 @@ <h2>Compliant Solution</h2>
2424
}
2525

2626
public void doSomething() {
27-
EnumSet&lt;COLOR&gt; warm = EnumSet.of(COLOR.RED, COLOR.ORANGE);
27+
Set&lt;COLOR&gt; warm = EnumSet.of(COLOR.RED, COLOR.ORANGE);
2828
}
2929
}
3030
</pre>

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1989_java.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ <h2>See</h2>
3131
<li> <a href="http://cwe.mitre.org/data/definitions/600.html">MITRE, CWE-600</a> - Uncaught Exception in Servlet </li>
3232
<li> <a href="https://www.securecoding.cert.org/confluence/x/s4EVAQ">CERT, ERR01-J.</a> - Do not allow exceptions to expose sensitive information
3333
</li>
34-
<li> <a href="https://www.owasp.org/index.php/Top_10_2013-A6-Sensitive_Data_Exposure">OWASP Top Ten Category A6</a> - Sensitive Data Exposure </li>
34+
<li> OWASP Top 10 2017 Category A3 - Sensitive Data Exposure </li>
3535
</ul>
3636

java-checks/src/main/resources/org/sonar/l10n/java/rules/squid/S1989_java.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cwe",
1111
"error-handling",
1212
"cert",
13-
"owasp-a6"
13+
"owasp-a3"
1414
],
1515
"standards": [
1616
"CWE",

0 commit comments

Comments
 (0)