Skip to content

Commit

Permalink
docs: Update docs/HANDLED_RULES.md (#1034)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored May 4, 2023
1 parent 036c965 commit ea97917
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/HANDLED_RULES.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,17 @@ Example repair where a variable declared in a loop header is unused:
}
```

We also perform repair for unused variables in enhanced for-loop headers:

```diff
- for (String input : inputList) { // noncompliant
+ for (int inputIterator=0; inputIterator < inputList.size(); ++inputIterator) { // compliant
doSomething();
}
```

> Note that this repair strategy is not suggested by SonarSource.

-----

Expand Down

0 comments on commit ea97917

Please sign in to comment.