Skip to content

Commit 293bdd9

Browse files
SONARJAVA-5555 Update rule metadata (#5210)
Co-authored-by: tomasz-tylenda-sonarsource <tomasz-tylenda-sonarsource@users.noreply.github.com> Co-authored-by: Tomasz Tylenda <tomasz.tylenda@sonarsource.com>
1 parent 7d5b08e commit 293bdd9

29 files changed

Lines changed: 97 additions & 66 deletions

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1191.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ <h3>Noncompliant code example</h3>
1212
<pre>
1313
import sun.misc.BASE64Encoder; // Noncompliant
1414
</pre>
15-
<h2>Documentation</h2>
15+
<h2>Resources</h2>
16+
<h3>Documentation</h3>
1617
<ul>
1718
<li> <a href="https://www.oracle.com/java/technologies/faq-sun-packages.html">Sun Packages</a> </li>
1819
</ul>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1195.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ <h3>Compliant solution</h3>
1818
public int[][] getMatrix() { /* ... */ } // Compliant
1919
}
2020
</pre>
21-
<h2>Documentation</h2>
21+
<h2>Resources</h2>
22+
<h3>Documentation</h3>
2223
<ul>
2324
<li> <a href="https://docs.oracle.com/javase/specs/jls/se20/html/jls-10.html">Oracle Java Language Specification</a> - Arrays </li>
2425
</ul>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1313.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p>Hardcoding IP addresses is security-sensitive. It has led in the past to the following vulnerabilities:</p>
22
<ul>
3-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5901">CVE-2006-5901</a> </li>
4-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-3725">CVE-2005-3725</a> </li>
3+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2006-5901">CVE-2006-5901</a> </li>
4+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2005-3725">CVE-2005-3725</a> </li>
55
</ul>
66
<p>Today’s services have an ever-changing architecture due to their scaling and redundancy needs. It is a mistake to think that a service will always
77
have the same IP address. When it does change, the hardcoded IP will have to be modified too. This will have an impact on the product development,

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1643.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ <h3>Compliant solution</h3>
1818
}
1919
String str = bld.toString();
2020
</pre>
21+
<h2>Resources</h2>
22+
<h3>Benchmarks</h3>
2123
<table>
2224
<colgroup>
2325
<col style="width: 20%;">

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1710.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ <h4>Compliant solution</h4>
2424
...
2525
}
2626
</pre>
27-
<h2>References</h2>
27+
<h2>Resources</h2>
28+
<h3>Documentation</h3>
2829
<ul>
2930
<li> <a href="https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html">Repeating Annotations - The Java™ Tutorials</a> </li>
3031
</ul>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1844.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,25 @@ <h2>Why is this an issue?</h2>
44
nuanced <code>await</code> methods.</p>
55
<p>Consequently, calling the method <code>Object.wait</code> on a class implementing the <code>Condition</code> interface is contradictory and should
66
be avoided. Use <code>Condition.await</code> instead.</p>
7-
<h2>Code examples</h2>
8-
<h3>Noncompliant code example</h3>
7+
<h3>Code examples</h3>
8+
<h4>Noncompliant code example</h4>
99
<pre data-diff-id="1" data-diff-type="noncompliant">
1010
void doSomething(Condition condition) {
1111
condition.wait(); // Noncompliant, Object.wait is called
1212

1313
...
1414
}
1515
</pre>
16-
<h3>Compliant solution</h3>
16+
<h4>Compliant solution</h4>
1717
<pre data-diff-id="1" data-diff-type="compliant">
1818
void doSomething(Condition condition) {
1919
condition.await(); // Compliant, Condition.await is called
2020

2121
...
2222
}
2323
</pre>
24-
<h2>References</h2>
24+
<h2>Resources</h2>
25+
<h3>Documentation</h3>
2526
<ul>
2627
<li> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/Condition.html">Interface Condition - Java™ Platform SE 8, API
2728
Specification</a> </li>

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S1849.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ <h2>Why is this an issue?</h2>
55
<h2>How to fix it</h2>
66
<p>How to fix this issue strongly depends on the specific implementation of the iterator. Make sure that the logic of the <code>hasNext()</code>
77
implementation does not change the state of the iterator or any underlying data sources. Instead, it should merely return state information.</p>
8-
<h2>Code examples</h2>
9-
<h3>Noncompliant code example</h3>
8+
<h3>Code examples</h3>
9+
<h4>Noncompliant code example</h4>
1010
<pre data-diff-id="1" data-diff-type="noncompliant">
1111
class MyIterator implements Iterator&lt;Integer&gt; {
1212

@@ -30,7 +30,7 @@ <h3>Noncompliant code example</h3>
3030
}
3131
}
3232
</pre>
33-
<h3>Compliant solution</h3>
33+
<h4>Compliant solution</h4>
3434
<pre data-diff-id="1" data-diff-type="compliant">
3535
class MyIterator implements Iterator&lt;Integer&gt; {
3636

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2068.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
applications that are distributed or that are open-source.</p>
33
<p>In the past, it has led to the following vulnerabilities:</p>
44
<ul>
5-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13466">CVE-2019-13466</a> </li>
6-
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15389">CVE-2018-15389</a> </li>
5+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2019-13466">CVE-2019-13466</a> </li>
6+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2018-15389">CVE-2018-15389</a> </li>
77
</ul>
88
<p>Passwords should be stored outside of the code in a configuration file, a database, or a password management service.</p>
99
<p>This rule flags instances of hard-coded passwords used in database and LDAP connections. It looks for hard-coded passwords in connection strings,

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2245.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
values that must remain confidential and resistant to guessing attacks.</p>
88
<p>For example, the use of non-cryptographic PRNGs has led to vulnerabilities such as:</p>
99
<ul>
10-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-6386">CVE-2013-6386</a> </li>
11-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3419">CVE-2006-3419</a> </li>
12-
<li> <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-4102">CVE-2008-4102</a> </li>
10+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2013-6386">CVE-2013-6386</a> </li>
11+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2006-3419">CVE-2006-3419</a> </li>
12+
<li> <a href="https://www.cve.org/CVERecord?id=CVE-2008-4102">CVE-2008-4102</a> </li>
1313
</ul>
1414
<p>When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that
1515
will be generated, and use this guess to impersonate another user or access sensitive information. Therefore, it is critical to use CSPRNGs in any

sonar-java-plugin/src/main/resources/org/sonar/l10n/java/rules/java/S2273.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ <h4>Compliant solution</h4>
3030
}
3131
}
3232
</pre>
33-
<h2>References</h2>
33+
<h2>Resources</h2>
34+
<h3>Documentation</h3>
3435
<ul>
3536
<li> <a href="https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html">Java Documentation</a> - Synchronized methods </li>
3637
<li> <a href="https://docs.oracle.com/javase%2F7%2Fdocs%2Fapi%2F%2F/java/lang/Object.html#wait()">Java Documentation</a> - java.lang.Object class

0 commit comments

Comments
 (0)