Modify rule S1134: Update to LaYC (#2189)
I removed abap, flex, pli and rpg dummy implementations since they're not implemented in the corresponding analyzer and there are no tickets open to do so.
This commit is contained in:
parent
afefc85dac
commit
aaa468bf3a
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
include::../rule.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
6
rules/S1134/apex/non-compliant-example.adoc
Normal file
6
rules/S1134/apex/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,apex]
|
||||||
|
----
|
||||||
|
Integer divide(Integer numerator, Integer denominator) {
|
||||||
|
return numerator / denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: apex/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,apex]
|
|
||||||
----
|
|
||||||
Integer divide(Integer numerator, Integer denominator) {
|
|
||||||
return numerator / denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
7
rules/S1134/cfamily/non-compliant-example.adoc
Normal file
7
rules/S1134/cfamily/non-compliant-example.adoc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[source,cpp]
|
||||||
|
----
|
||||||
|
int Divide(int numerator, int denominator)
|
||||||
|
{
|
||||||
|
return numerator / denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,16 +1,3 @@
|
|||||||
include::../rule.adoc[]
|
:nonCompliantExample: cfamily/non-compliant-example.adoc
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
4
rules/S1134/cobol/non-compliant-example.adoc
Normal file
4
rules/S1134/cobol/non-compliant-example.adoc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[source,cobol]
|
||||||
|
----
|
||||||
|
DIVIDE 5 BY DIVISOR GIVING QUOTIENT. *> FIXME ensure DIVISOR is not zero
|
||||||
|
----
|
@ -1,27 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: cobol/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,cobol]
|
|
||||||
----
|
|
||||||
DIVIDE 5 BY DIVISOR GIVING QUOTIENT. *> FIXME ensure DIVISOR is not zero
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,15 +0,0 @@
|
|||||||
=== on 23 Jul 2013, 13:08:27 Dinesh Bolkensteyn wrote:
|
|
||||||
Implemented by \http://jira.codehaus.org/browse/SONARJAVA-221
|
|
||||||
|
|
||||||
=== on 7 Jan 2014, 11:13:23 Freddy Mallet wrote:
|
|
||||||
Implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3369 for JavaScript
|
|
||||||
|
|
||||||
=== on 23 Feb 2014, 23:43:23 Freddy Mallet wrote:
|
|
||||||
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3517 for PHP
|
|
||||||
|
|
||||||
=== on 26 Nov 2015, 10:41:04 Elena Vilchik wrote:
|
|
||||||
\[~ann.campbell.2] Why there is no SQALE for this rule? (and for RSPEC-1135 too)
|
|
||||||
|
|
||||||
=== on 30 Nov 2015, 16:31:09 Ann Campbell wrote:
|
|
||||||
\[~elena.vilchik] because it could only be a guess; there's no way of knowing whether what needs fixing is related to security or maintainability.
|
|
||||||
|
|
7
rules/S1134/csharp/non-compliant-example.adoc
Normal file
7
rules/S1134/csharp/non-compliant-example.adoc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[source,csharp]
|
||||||
|
----
|
||||||
|
private int Divide(int numerator, int denominator)
|
||||||
|
{
|
||||||
|
return numerator / denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,30 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: csharp/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,csharp]
|
|
||||||
----
|
|
||||||
private int Divide(int numerator, int denominator)
|
|
||||||
{
|
|
||||||
return numerator / denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,5 +0,0 @@
|
|||||||
``++FIXME++`` tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.
|
|
||||||
|
|
||||||
Sometimes the developer will not have the time or will simply forget to get back to that tag.
|
|
||||||
|
|
||||||
This rule is meant to track those tags and to ensure that they do not go unnoticed.
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
include::../rule.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
6
rules/S1134/go/non-compliant-example.adoc
Normal file
6
rules/S1134/go/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,go]
|
||||||
|
----
|
||||||
|
func foo() {
|
||||||
|
// FIXME
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: go/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,go]
|
|
||||||
----
|
|
||||||
func foo() {
|
|
||||||
// FIXME
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
7
rules/S1134/html/non-compliant-example.adoc
Normal file
7
rules/S1134/html/non-compliant-example.adoc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[source,html]
|
||||||
|
----
|
||||||
|
<html>
|
||||||
|
<!-- FIXME support small device -->
|
||||||
|
...
|
||||||
|
</html>
|
||||||
|
----
|
@ -1,30 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: html/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,html]
|
|
||||||
----
|
|
||||||
<html>
|
|
||||||
<!-- FIXME support small device -->
|
|
||||||
...
|
|
||||||
</html>
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
6
rules/S1134/java/non-compliant-example.adoc
Normal file
6
rules/S1134/java/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,java]
|
||||||
|
----
|
||||||
|
int divide(int numerator, int denominator) {
|
||||||
|
return numerator / denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: java/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,java]
|
|
||||||
----
|
|
||||||
int divide(int numerator, int denominator) {
|
|
||||||
return numerator / denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
6
rules/S1134/javascript/non-compliant-example.adoc
Normal file
6
rules/S1134/javascript/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,javascript]
|
||||||
|
----
|
||||||
|
function divide(numerator, denominator) {
|
||||||
|
return numerator / denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: javascript/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,javascript]
|
|
||||||
----
|
|
||||||
function divide(numerator, denominator) {
|
|
||||||
return numerator / denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
5
rules/S1134/kotlin/non-compliant-example.adoc
Normal file
5
rules/S1134/kotlin/non-compliant-example.adoc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[source,kotlin]
|
||||||
|
----
|
||||||
|
// FIXME denominator value might be 0
|
||||||
|
fun divide(numerator: Int, denominator: Int): Int = numerator / denominator
|
||||||
|
----
|
@ -1,28 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: kotlin/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,kotlin]
|
|
||||||
----
|
|
||||||
// FIXME denominator value might be 0
|
|
||||||
fun divide(numerator: Int, denominator: Int): Int = numerator / denominator
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,4 +0,0 @@
|
|||||||
=== Message
|
|
||||||
|
|
||||||
Take the required action to fix the issue indicated by this "FIXME" comment.
|
|
||||||
|
|
@ -29,5 +29,5 @@
|
|||||||
"defaultQualityProfiles": [
|
"defaultQualityProfiles": [
|
||||||
"Sonar way"
|
"Sonar way"
|
||||||
],
|
],
|
||||||
"quickfix": "unknown"
|
"quickfix": "infeasible"
|
||||||
}
|
}
|
||||||
|
6
rules/S1134/php/non-compliant-example.adoc
Normal file
6
rules/S1134/php/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,php]
|
||||||
|
----
|
||||||
|
function divide($numerator, $denominator) {
|
||||||
|
return $numerator / $denominator; // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: php/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,php]
|
|
||||||
----
|
|
||||||
function divide($numerator, $denominator) {
|
|
||||||
return $numerator / $denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
include::../rule.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
5
rules/S1134/plsql/non-compliant-example.adoc
Normal file
5
rules/S1134/plsql/non-compliant-example.adoc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[source,sql]
|
||||||
|
----
|
||||||
|
CREATE TABLE mytable(col1 INTEGER NOT NULL);
|
||||||
|
INSERT INTO mytable VALUES (value) -- FIXME ensure value is not null
|
||||||
|
----
|
@ -1,28 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: plsql/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,sql]
|
|
||||||
----
|
|
||||||
CREATE TABLE mytable(col1 INTEGER NOT NULL);
|
|
||||||
INSERT INTO mytable VALUES (value) -- FIXME ensure value is not null
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
5
rules/S1134/python/non-compliant-example.adoc
Normal file
5
rules/S1134/python/non-compliant-example.adoc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[source,python]
|
||||||
|
----
|
||||||
|
def divide(numerator, denominator):
|
||||||
|
return numerator / denominator # FIXME denominator value might be 0
|
||||||
|
----
|
@ -1,28 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: python/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,python]
|
|
||||||
----
|
|
||||||
def divide(numerator, denominator):
|
|
||||||
return numerator / denominator # FIXME denominator value might be 0
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
5
rules/S1134/resources.adoc
Normal file
5
rules/S1134/resources.adoc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
== Resources
|
||||||
|
|
||||||
|
=== Documentation
|
||||||
|
|
||||||
|
* https://cwe.mitre.org/data/definitions/546[MITRE, CWE-546 - Suspicious Comment]
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
include::../rule.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
36
rules/S1134/rspecator.adoc
Normal file
36
rules/S1134/rspecator.adoc
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
ifdef::env-github,rspecator-view[]
|
||||||
|
|
||||||
|
'''
|
||||||
|
== Implementation Specification
|
||||||
|
(visible only on this page)
|
||||||
|
|
||||||
|
=== Message
|
||||||
|
|
||||||
|
Take the required action to fix the issue indicated by this "FIXME" comment.
|
||||||
|
|
||||||
|
'''
|
||||||
|
== Comments And Links
|
||||||
|
(visible only on this page)
|
||||||
|
|
||||||
|
=== on 23 Jul 2013, 13:08:27 Dinesh Bolkensteyn wrote:
|
||||||
|
Implemented by \http://jira.codehaus.org/browse/SONARJAVA-221
|
||||||
|
|
||||||
|
=== on 7 Jan 2014, 11:13:23 Freddy Mallet wrote:
|
||||||
|
Implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3369 for JavaScript
|
||||||
|
|
||||||
|
=== on 23 Feb 2014, 23:43:23 Freddy Mallet wrote:
|
||||||
|
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3517 for PHP
|
||||||
|
|
||||||
|
=== on 26 Nov 2015, 10:41:04 Elena Vilchik wrote:
|
||||||
|
\[~ann.campbell.2] Why there is no SQALE for this rule? (and for RSPEC-1135 too)
|
||||||
|
|
||||||
|
=== on 30 Nov 2015, 16:31:09 Ann Campbell wrote:
|
||||||
|
\[~elena.vilchik] because it could only be a guess; there's no way of knowing whether what needs fixing is related to security or maintainability.
|
||||||
|
|
||||||
|
=== on 30 Nov 2023, 16:31:09 Ann Campbell wrote:
|
||||||
|
\[~elena.vilchik] because it could only be a guess; there's no way of knowing whether what needs fixing is related to security or maintainability.
|
||||||
|
|
||||||
|
=== on 14 June 2023, 13:10:00 Cristian Ambrosini wrote:
|
||||||
|
During a LaYC sprint, I removed abap, flex, pli and rpg dummy implementations, since they're not implemented in the corresponding analyzer and there are no tickets open to do so.
|
||||||
|
|
||||||
|
endif::env-github,rspecator-view[]
|
6
rules/S1134/ruby/non-compliant-example.adoc
Normal file
6
rules/S1134/ruby/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,ruby]
|
||||||
|
----
|
||||||
|
def divide(numerator, denominator)
|
||||||
|
return numerator / denominator # FIXME denominator value might be 0
|
||||||
|
end
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: ruby/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,ruby]
|
|
||||||
----
|
|
||||||
def divide(numerator, denominator)
|
|
||||||
return numerator / denominator # FIXME denominator value might be 0
|
|
||||||
end
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,16 +1,13 @@
|
|||||||
== Why is this an issue?
|
== Why is this an issue?
|
||||||
|
|
||||||
include::description.adoc[]
|
`FIXME` tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.
|
||||||
|
|
||||||
=== Noncompliant code example
|
Sometimes the developer will not have the time or will simply forget to get back to that tag.
|
||||||
|
|
||||||
[source,text]
|
This rule is meant to track those tags and to ensure that they do not go unnoticed.
|
||||||
----
|
|
||||||
int divide(int numerator, int denominator) {
|
|
||||||
return numerator / denominator; // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
|
include::{nonCompliantExample}[]
|
||||||
|
|
||||||
include::see.adoc[]
|
include::resources.adoc[]
|
||||||
|
|
||||||
|
include::rspecator.adoc[]
|
4
rules/S1134/scala/non-compliant-example.adoc
Normal file
4
rules/S1134/scala/non-compliant-example.adoc
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[source,scala]
|
||||||
|
----
|
||||||
|
var result = numerator / denominator // FIXME denominator value might be 0
|
||||||
|
----
|
@ -1,27 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: scala/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,scala]
|
|
||||||
----
|
|
||||||
var result = numerator / denominator // FIXME denominator value might be 0
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
@ -1,3 +0,0 @@
|
|||||||
== Resources
|
|
||||||
|
|
||||||
* https://cwe.mitre.org/data/definitions/546[MITRE, CWE-546] - Suspicious Comment
|
|
6
rules/S1134/swift/non-compliant-example.adoc
Normal file
6
rules/S1134/swift/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,swift]
|
||||||
|
----
|
||||||
|
func divide(numerator:Int, denominator:Int) -> Int {
|
||||||
|
return numerator / denominator // FIXME denominator value might be 0
|
||||||
|
}
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: swift/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,swift]
|
|
||||||
----
|
|
||||||
func divide(numerator:Int, denominator:Int) -> Int {
|
|
||||||
return numerator / denominator // FIXME denominator value might be 0
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
5
rules/S1134/tsql/non-compliant-example.adoc
Normal file
5
rules/S1134/tsql/non-compliant-example.adoc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[source,sql]
|
||||||
|
----
|
||||||
|
CREATE TABLE notnull(col1 INTEGER NOT NULL)
|
||||||
|
INSERT notnull VALUES (@value) -- FIXME ensure @value is not null
|
||||||
|
----
|
@ -1,28 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: tsql/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,sql]
|
|
||||||
----
|
|
||||||
CREATE TABLE notnull(col1 INTEGER NOT NULL)
|
|
||||||
INSERT notnull VALUES (@value) -- FIXME ensure @value is not null
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
7
rules/S1134/vb6/non-compliant-example.adoc
Normal file
7
rules/S1134/vb6/non-compliant-example.adoc
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[source,vb6]
|
||||||
|
----
|
||||||
|
Rem FIXME: Add documentation - Noncompliant
|
||||||
|
Function Divide(ByVal Numerator As Integer, ByVal Denominator As Integer) As Integer
|
||||||
|
Divide = Numerator / Denominator ' FIXME: Denominator value might be 0 - Noncompliant
|
||||||
|
End Function
|
||||||
|
----
|
@ -1,30 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: vb6/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,vb6]
|
|
||||||
----
|
|
||||||
Rem FIXME: Add documentation - Noncompliant
|
|
||||||
Function Divide(ByVal Numerator As Integer, ByVal Denominator As Integer) As Integer
|
|
||||||
Divide = Numerator / Denominator ' FIXME: Denominator value might be 0 - Noncompliant
|
|
||||||
End Function
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
6
rules/S1134/vbnet/non-compliant-example.adoc
Normal file
6
rules/S1134/vbnet/non-compliant-example.adoc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[source,vbnet]
|
||||||
|
----
|
||||||
|
Function Divide(numerator As Integer, denominator As Integer) As Integer
|
||||||
|
Return numerator / denominator ' FIXME denominator value might be 0
|
||||||
|
End Function
|
||||||
|
----
|
@ -1,29 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: vbnet/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,vbnet]
|
|
||||||
----
|
|
||||||
Function Divide(ByVal numerator As Integer, ByVal denominator As Integer) As Integer
|
|
||||||
Return numerator / denominator ' FIXME denominator value might be 0
|
|
||||||
End Function
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
9
rules/S1134/xml/non-compliant-example.adoc
Normal file
9
rules/S1134/xml/non-compliant-example.adoc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[source,xml]
|
||||||
|
----
|
||||||
|
<!-- FIXME we should update version to 3.8.1 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.6</version>
|
||||||
|
</dependency>
|
||||||
|
----
|
@ -1,32 +1,3 @@
|
|||||||
== Why is this an issue?
|
:nonCompliantExample: xml/non-compliant-example.adoc
|
||||||
|
|
||||||
include::../description.adoc[]
|
include::../rule.adoc[]
|
||||||
|
|
||||||
=== Noncompliant code example
|
|
||||||
|
|
||||||
[source,xml]
|
|
||||||
----
|
|
||||||
<!-- FIXME we should update version to 3.8.1 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-lang3</artifactId>
|
|
||||||
<version>3.6</version>
|
|
||||||
</dependency>
|
|
||||||
----
|
|
||||||
|
|
||||||
include::../see.adoc[]
|
|
||||||
|
|
||||||
ifdef::env-github,rspecator-view[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Implementation Specification
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../message.adoc[]
|
|
||||||
|
|
||||||
'''
|
|
||||||
== Comments And Links
|
|
||||||
(visible only on this page)
|
|
||||||
|
|
||||||
include::../comments-and-links.adoc[]
|
|
||||||
endif::env-github,rspecator-view[]
|
|
Loading…
x
Reference in New Issue
Block a user