1

I am trying to skip multiple line queries using bandit in my python query. I have tried to use #nosec but still there is bandit issue showing

Example:

"""#nosec""" ;Query = f"""Select username,id,email_id,address from User where username ='John'"""
Jens
  • 8,423
  • 9
  • 58
  • 78

1 Answers1

0

The example code you show doesn’t handle Bandit warnings: the first part is a string expression """#nosec""" followed by an assignment statement (and I can’t see why Bandit would complain about that.

Anyway, according to the docs you can exclude specific lines of code using a special comment:

time.sleep(random.random())  # nosec B311
Jens
  • 8,423
  • 9
  • 58
  • 78