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.

function_redefined.py 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # pylint: disable=R0201,missing-docstring,using-constant-test,unused-import,wrong-import-position,reimported
  2. from __future__ import division
  3. __revision__ = ''
  4. class AAAA(object):
  5. """docstring"""
  6. def __init__(self):
  7. pass
  8. def method1(self):
  9. """docstring"""
  10. def method2(self):
  11. """docstring"""
  12. def method2(self): # [function-redefined]
  13. """docstring"""
  14. class AAAA(object): # [function-redefined]
  15. """docstring"""
  16. def __init__(self):
  17. pass
  18. def yeah(self):
  19. """hehehe"""
  20. def yoo(self):
  21. """yoo"""
  22. def func1():
  23. """docstring"""
  24. def func2():
  25. """docstring"""
  26. def func2(): # [function-redefined]
  27. """docstring"""
  28. __revision__ = 1 # [redefined-outer-name]
  29. return __revision__
  30. if __revision__:
  31. def exclusive_func():
  32. "docstring"
  33. else:
  34. def exclusive_func():
  35. "docstring"
  36. try:
  37. def exclusive_func2():
  38. "docstring"
  39. except TypeError:
  40. def exclusive_func2():
  41. "docstring"
  42. else:
  43. def exclusive_func2(): # [function-redefined]
  44. "this one redefine the one defined line 42"
  45. def with_inner_function_1():
  46. """docstring"""
  47. def callback():
  48. """callback docstring"""
  49. pass
  50. return callback
  51. def with_inner_function_2():
  52. """docstring"""
  53. def callback():
  54. """does not redefine callback returned by with_inner_function_1"""
  55. pass
  56. return callback
  57. def some_func():
  58. """Don't emit if we defined a variable with the same name as a
  59. __future__ directive.
  60. """
  61. division = 2
  62. return division
  63. def dummy_func():
  64. """First dummy function"""
  65. pass
  66. def dummy_func():
  67. """Second dummy function, don't emit function-redefined message
  68. because of the dummy name"""
  69. pass
  70. from math import ceil
  71. def ceil(): # [function-redefined]
  72. pass
  73. import math
  74. def math(): # [function-redefined]
  75. pass
  76. import math as _
  77. def _():
  78. pass