Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Jul 31, 2020

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Comment on lines -25 to 32
x, y = player
if move == "LEFT":
if move == "DOWN":
y += 1
elif move == "LEFT":
x -= 1
if move == "RIGHT":
elif move == "RIGHT":
x += 1
if move == "UP":
elif move == "UP":
y -= 1
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_player refactored with the following changes:

  • Simplify conditional into switch-like form (switch)

Comment on lines -44 to +48
if x == 4:
elif x == 4:
moves.remove("RIGHT")
if y == 0:
moves.remove("UP")
if y == 4:
elif y == 4:
Copy link
Author

Choose a reason for hiding this comment

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

Function get_moves refactored with the following changes:

  • Simplify conditional into switch-like form (switch)

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Jul 31, 2020

Sourcery Code Quality Report (beta)

Merging this PR leaves code quality unchanged.

Quality metrics Before After Change
Complexity 3.55 3.55 0.00
Method Length 38.72 38.72 0.00
Quality 8.74 8.74 0.00
Other metrics Before After Change
Lines 128 128 0
Changed files Quality Before Quality After Quality Change
grid_game.py 8.74 8.74 0.00

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it via email or our Gitter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant