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 warning text "WARNING nosec encountered (X), but no failed test on line Y" incorrectly appears in some cases. It may also appear more than once for the same line number and test under specific circumstances.
Describe the bug
The warning text "WARNING nosec encountered (X), but no failed test on line Y" incorrectly appears in some cases. It may also appear more than once for the same line number and test under specific circumstances.
Reproduction steps
Consider this base code:
Since there are 2 function calls on this line of code, there are 2 calls to
run_tests
inbandit/core/issue.py
.If we include a
nosec
comment specifying the correct test to ignore (i.e.B603
):the following warning text displays:
If we include a
nosec
comment specifying something else (e.g.B602
):the following warning text displays:
Expected behavior
Bandit version
1.7.5 (Default)
Python version
3.10
Additional context
No response
The text was updated successfully, but these errors were encountered: