New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False nosec encountered warning #1041
Labels
bug
Something isn't working
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: