Modify rule S1065: Unused labels should be removed (WarningCode.UNUSED_LABEL)

This commit is contained in:
Antonio Aversa 2024-07-25 17:47:10 +02:00
parent ca50289cd6
commit f7e4334515

View File

@ -4,7 +4,7 @@ include::../description.adoc[]
=== Noncompliant code example
[source,dart]
[source,dart,diff-id=1,diff-type=noncompliant]
----
void foo() {
outer: //label is not used.
@ -16,7 +16,7 @@ void foo() {
=== Compliant solution
[source,dart]
[source,dart,diff-id=1,diff-type=compliant]
----
void foo() {
for(int i = 0; i < 10; i++) {
@ -27,5 +27,29 @@ void foo() {
== Resources
* https://wiki.sei.cmu.edu/confluence/x/5dUxBQ[CERT, MSC12-C.] - Detect and remove code that has no effect or is never executed
* https://dart.dev/tools/diagnostic-messages?utm_source=dartdev&utm_medium=redir&utm_id=diagcode&utm_content=unnecessary_cast#unused_label[Dart Linter - unused label]
* CERT - https://wiki.sei.cmu.edu/confluence/x/5dUxBQ[CERT, MSC12-C.] - Detect and remove code that has no effect or is never executed
* Dart Docs - https://dart.dev/tools/diagnostic-messages?utm_source=dartdev&utm_medium=redir&utm_id=diagcode&utm_content=unnecessary_cast#unused_label[Dart Linter rules - unused_label]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* The label '<labelName>' isn't used.
`<labelName>` doesn't include the semicolon.
=== Highlighting
The label name, including the semicolon.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]