Skip to content

Commit

Permalink
SONARJAVA-3510 Update metadata before 6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-jaquier-sonarsource authored and Wohops committed Aug 28, 2020
1 parent 302289a commit 3d4657a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ <h2>Compliant Solution</h2>
public void testDoTheThing() {
// ...
</pre>
<h2>Exceptions</h2>
<p>None</p>

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"tags": [
"junit",
"tests",
"bad-practice",
"confusing",
"suspicious"
],
"defaultSeverity": "Major",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ <h2>Compliant Solution</h2>
</pre>
<h2>See</h2>
<ul>
<li> MISRA C:2004, 13.7 - Boolean operations whose results are invariant shall not be permitted. </li>
<li> MISRA C:2012, 14.3 - Controlling expressions shall not be invariant </li>
<li> <a href="http://cwe.mitre.org/data/definitions/571">MITRE, CWE-571</a> - Expression is Always True </li>
<li> <a href="http://cwe.mitre.org/data/definitions/570">MITRE, CWE-570</a> - Expression is Always False </li>
<li> <a href="http://cwe.mitre.org/data/definitions/489">MITRE, CWE-489</a> - Leftover Debug Code </li>
<li> <a href="https://www.securecoding.cert.org/confluence/x/NYA5">CERT, MSC12-C.</a> - Detect and remove code that has no effect or is never
executed </li>
</ul>

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ <h2>See</h2>
</li>
<li> <a href="http://cwe.mitre.org/data/definitions/20">MITRE, CWE-20</a> - Improper Input Validation </li>
<li> <a href="http://cwe.mitre.org/data/definitions/400">MITRE, CWE-400</a> - Uncontrolled Resource Consumption ('Resource Exhaustion') </li>
<li> <a href="http://cwe.mitre.org/data/definitions/200">MITRE, CWE-200</a> - Information Exposure </li>
<li> <a href="http://cwe.mitre.org/data/definitions/200">MITRE, CWE-200</a> - Exposure of Sensitive Information to an Unauthorized Actor </li>
<li> <a href="https://www.sans.org/top25-software-errors/#cat2">SANS Top 25</a> - Risky Resource Management </li>
<li> <a href="https://www.sans.org/top25-software-errors/#cat3">SANS Top 25</a> - Porous Defenses </li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p>Assertions of dissimilar types always fail, and negative assertions always pass. At best, negative assertions are useless. At worst, the developer
loses time trying to fix his code logic before noticing wrong assertions.</p>
<p>Assertions comparing incompatible types always fail, and negative assertions always pass. At best, negative assertions are useless. At worst, the
developer loses time trying to fix his code logic before noticing wrong assertions.</p>
<p>Dissimilar types are:</p>
<ul>
<li> comparing a primitive with null </li>
Expand All @@ -15,7 +15,7 @@
<ul>
<li> JUnit4 </li>
<li> JUnit5 </li>
<li> AsserJ </li>
<li> AssertJ </li>
</ul>
<h2>Noncompliant Code Example</h2>
<pre>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Assertions of dissimilar types should not be made",
"title": "Assertions comparing incompatible types should not be made",
"type": "BUG",
"status": "ready",
"remediation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ <h2>Compliant Solution</h2>

// ...
System.out.println(containsEmptyLines("a\n\nb")); // correctly prints 'true'
System.out.println(containsEmptyLines("")); // also correctly prints 'false'
System.out.println(containsEmptyLines("")); // also correctly prints 'true'
</pre>

2 changes: 1 addition & 1 deletion sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"languages": [
"JAVA"
],
"latest-update": "2020-07-15T12:00:39.489532200Z",
"latest-update": "2020-08-27T14:58:46.476813600Z",
"options": {
"no-language-in-filenames": false,
"preserve-filenames": false
Expand Down

0 comments on commit 3d4657a

Please sign in to comment.