Modify rule S1065: Add Dart language

This commit is contained in:
Marharyta Nedzelska 2024-07-11 11:57:38 +02:00 committed by Marharyta
parent 4bcb4b6389
commit d0e28a6c60
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
}

View 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