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.

too_many_locals.py 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # pylint: disable=missing-docstring
  2. from __future__ import print_function
  3. def function(arg1, arg2, arg3, arg4, arg5): # [too-many-locals]
  4. arg6, arg7, arg8, arg9 = arg1, arg2, arg3, arg4
  5. print(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)
  6. loc1, loc2, loc3, loc4, loc5, loc6, loc7 = arg1, arg2, arg3, arg4, arg5, \
  7. arg6, arg7
  8. print(loc1, loc2, loc3, loc4, loc5, loc6, loc7)
  9. def too_many_locals_function(): # [too-many-locals]
  10. """pylint will complains about too many local variables"""
  11. args0 = 0
  12. args1 = args0 * 1
  13. args2 = args1 * 2
  14. args3 = args2 * 3
  15. args4 = args3 * 4
  16. args5 = args4 * 5
  17. args6 = args5 * 6
  18. args7 = args6 * 7
  19. args8 = args7 * 8
  20. args9 = args8 * 9
  21. args10 = args9 * 10
  22. args11 = args10 * 11
  23. args12 = args11 * 12
  24. args13 = args12 * 13
  25. args14 = args13 * 14
  26. args15 = args14 * 15
  27. return args15
  28. def too_many_arguments_function(arga, argu, argi, arge, argt, args): # [too-many-arguments]
  29. """pylint will complains about too many arguments."""
  30. arga = argu
  31. arga += argi
  32. arga += arge
  33. arga += argt
  34. arga += args
  35. return arga
  36. def ignored_arguments_function(arga, argu, argi,
  37. _arge=0, _argt=1, _args=None):
  38. """pylint will ignore _arge, _argt, _args.
  39. Consequently pylint will only coun 13 arguments.
  40. """
  41. arg0 = 0
  42. arg1 = arg0 * 1 + arga
  43. arg2 = arg1 * 2 + argu
  44. arg3 = arg2 * 3 + argi
  45. arg4 = arg3 * 4 + _arge
  46. arg5 = arg4 * 5 + _argt
  47. arg6 = arg5 * 6
  48. arg7 = arg6 * 7
  49. arg8 = arg7 * 8
  50. arg9 = arg8 * 9
  51. arg9 += arg0
  52. if _args:
  53. arg9 += sum(_args)
  54. return arg9