Sourcery refactored main branch - #1
Conversation
| squares = [[first_x, 0], [second_x, 0], [third_x, 0], [fourth_x, 0], | ||
| [first_x, first_y], [second_x, first_y], [third_x, first_y], [fourth_x, first_y], | ||
| [first_x, second_y], [second_x, second_y], [third_x, second_y], [fourth_x, second_y]] | ||
| return squares | ||
| return [ | ||
| [first_x, 0], | ||
| [second_x, 0], | ||
| [third_x, 0], | ||
| [fourth_x, 0], | ||
| [first_x, first_y], | ||
| [second_x, first_y], | ||
| [third_x, first_y], | ||
| [fourth_x, first_y], | ||
| [first_x, second_y], | ||
| [second_x, second_y], | ||
| [third_x, second_y], | ||
| [fourth_x, second_y], | ||
| ] |
There was a problem hiding this comment.
Function MemoryGameData.square_start refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| prompts = { | ||
| "Pencil": "Click On the square where you saw the yellow Pencil.", | ||
| "Mountain": "Click On the square where you saw the Tall White Mountain.", | ||
| "Numbers": "Click On the square where you saw the Numbers surronded by the red circles.", | ||
| "Letters": "Click On the square where you saw the the letters in the yellow box." | ||
| return { | ||
| "Pencil": | ||
| "Click On the square where you saw the yellow Pencil.", | ||
| "Mountain": | ||
| "Click On the square where you saw the Tall White Mountain.", | ||
| "Numbers": | ||
| "Click On the square where you saw the Numbers surronded by the red circles.", | ||
| "Letters": | ||
| "Click On the square where you saw the the letters in the yellow box.", | ||
| } | ||
| return prompts |
There was a problem hiding this comment.
Function MemoryGameData.prompts refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
|
|
||
| prompt = self.prompts[random_image_choice] | ||
|
|
||
| return prompt | ||
|
|
||
| return self.prompts[random_image_choice] |
There was a problem hiding this comment.
Function Game.draw_random_image refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| amount_of_guesses = 1 | ||
|
|
There was a problem hiding this comment.
Function Game.drawscreen refactored with the following changes:
- Use x is None rather than x == None (
none-compare) - Move assignments closer to their usage (
move-assign) - Merge nested if conditions (
merge-nested-ifs)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.85%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. 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 by mentioning @sourcery-ai in a comment. |
Branch
mainrefactored 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
mainbranch, then run: