Modify rule S1065: Add Dart language
This commit is contained in:
parent
4bcb4b6389
commit
d0e28a6c60
3
rules/S1065/dart/metadata.json
Normal file
3
rules/S1065/dart/metadata.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
30
rules/S1065/dart/rule.adoc
Normal file
30
rules/S1065/dart/rule.adoc
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
== Why is this an issue?
|
||||||
|
|
||||||
|
include::../description.adoc[]
|
||||||
|
|
||||||
|
=== Noncompliant code example
|
||||||
|
|
||||||
|
[source,dart]
|
||||||
|
----
|
||||||
|
void foo() {
|
||||||
|
outer: //label is not used.
|
||||||
|
for(int i = 0; i < 10; i++) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
|
=== Compliant solution
|
||||||
|
|
||||||
|
[source,dart]
|
||||||
|
----
|
||||||
|
void foo() {
|
||||||
|
for(int i = 0; i < 10; i++) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
|
== Resources
|
||||||
|
|
||||||
|
* https://wiki.sei.cmu.edu/confluence/x/5dUxBQ[CERT, MSC12-C.] - Detect and remove code that has no effect or is never executed
|
Loading…
x
Reference in New Issue
Block a user