Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 21 additions & 30 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,37 @@



if True:
pass

if False:
pass
pass
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 5-9 refactored with the following changes:

  • Remove redundant conditional (remove-redundant-if)



def function():
if False:
pass

if x == None:
if x is None:
do_x()

return None
do_x()
Comment on lines -13 to -20
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function function refactored with the following changes:

  • Remove redundant conditional (remove-redundant-if)
  • Remove unreachable code (remove-unreachable-code)
  • Use x is None rather than x == None (none-compare)



def func2():
if False:
pass
pass
Comment on lines -24 to +16
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function func2 refactored with the following changes:

  • Remove redundant conditional (remove-redundant-if)




def move_assign(cond1, cond2):
a_var = 10
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
if cond1:
c_var = 30
if cond2:
print(a_var)
print(a_var)
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
b_var = 20
if cond1:
c_var = 30
a_var = 10
if cond2:
print(a_var)
print(a_var)
Comment on lines -30 to +38
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function move_assign refactored with the following changes:

  • Move assignments closer to their usage (move-assign)