Fix S2583 FP/FN: Conditionally executed code should be reachable #9580
Labels
Area: C#
C# rules related issues.
Area: VB.NET
VB.NET rules related issues.
Type: CFG/SE FPs
Rule IS triggered when it shouldn't be for CFG and SE rules.
Description
Block of code with an if statement at the end that allows control to flow when a collection count is equal to zero is being flagged as "unreachable code" for rule S2583
Repro steps
Expected behavior
The above collection could be empty, so it is likely that the block within the above if statement would be executed.
Actual behavior
S2583 rule is flagged as a warning in the pipeline running the analysis.
Known workarounds
We could suppress the warning in code or in our project configuration, but we want the warning for other instances of this issue. This appears to be a false-positive.
Related information
The text was updated successfully, but these errors were encountered: