You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The false positive is caused because of our limited support for loops - the rule cannot detect that you are filling the dictionary with items a few lines above, hence it raises an issue.
valhristov
changed the title
S4158 False Positive
Fix S4158: "Empty collections" raises false positive on collections populated within a loop
Sep 12, 2017
Apparently I diagnosed the problem wrong, it is caused because the method has rather many branches and our dataflow analysis engine reaches the limit of explorations count (1000). We would like to avoid increasing the limit for now because it could have performance impact. The rule will currently not report if it detects that the exploded graph exploration did not finish correctly (exactly as the condition evaluates to constant rule).
valhristov
changed the title
Fix S4158: "Empty collections" raises false positive on collections populated within a loop
Fix S4158: "Empty collections" raises false positive when analyzed method has too many branches
Feb 1, 2018
A false positive S4158 is thrown on the line:
The text was updated successfully, but these errors were encountered: