Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

used_before_assignment_issue1081.py 757B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # pylint: disable=missing-docstring,invalid-name,too-few-public-methods
  2. x = 24
  3. def used_before_assignment_1(a):
  4. if x == a: # [used-before-assignment]
  5. for x in [1, 2]: # [redefined-outer-name]
  6. pass
  7. def used_before_assignment_2(a):
  8. if x == a: # [used-before-assignment]
  9. pass
  10. x = 2 # [redefined-outer-name]
  11. def used_before_assignment_3(a):
  12. if x == a: # [used-before-assignment]
  13. if x > 3:
  14. x = 2 # [redefined-outer-name]
  15. def not_used_before_assignment(a):
  16. if x == a:
  17. pass
  18. def not_used_before_assignment_2(a):
  19. x = 3 # [redefined-outer-name]
  20. if x == a:
  21. pass
  22. def func(something):
  23. return something ** 3
  24. class FalsePositive(object):
  25. x = func(x)