Movatterモバイル変換


[0]ホーム

URL:


CodeQL documentation
CodeQL resources

Continue statement that does not continue

ID: java/continue-in-false-loopKind: problemSecurity severity: Severity: warningPrecision: highTags:   - quality   - reliability   - correctnessQuery suites:   - java-security-and-quality.qls

Click to see the query in the CodeQL repository

Acontinue statement only re-runs the loop if the loop condition is true. Therefore usingcontinue in a loop with a constant false condition will never cause the loop body to be re-run, which is misleading.

Recommendation

Replace thecontinue statement with abreak statement if the intent is to break from the loop.

References


[8]ページ先頭

©2009-2025 Movatter.jp