Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Moves (Sourcery refactored) - #84

Closed
sourcery-ai[bot] wants to merge 12 commits into
masterfrom
sourcery/pull-83
Closed

sourcery-ai[bot] wants to merge 12 commits into
masterfrom
sourcery/pull-83

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Nov 17, 2022 •

Copy link
Copy Markdown
Contributor

Pull Request #83 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to
    the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/Pokemon-PythonRed/Pokemon-PythonRed pull/83/head
    git merge --ff-only FETCH_HEAD
    git push

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

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

Help us improve this pull request!

@sourcery-ai

sourcery-ai Bot commented Nov 17, 2022 •

Copy link
Copy Markdown
Contributor Author

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 1.75%.

Quality metrics Before After Change
Complexity 159.88 β›” 148.54 β›” -11.34 πŸ‘
Method Length 145.69 😞 157.29 😞 11.60 πŸ‘Ž
Working memory 20.76 β›” 20.68 β›” -0.08 πŸ‘
Quality 29.13% 😞 27.38% 😞 -1.75% πŸ‘Ž
Other metrics Before After Change
Lines 701 785 84
Changed files Quality Before Quality After Quality Change
app/main.py 29.13% 😞 27.38% 😞 -1.75% πŸ‘Ž

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
app/main.py Pokemon.level_up 59 β›” 400 β›” 18 β›” 8.75% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
app/main.py Pokemon.deal_damage 33 β›” 264 β›” 27 β›” 14.36% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
app/main.py Pokemon.__init__ 14 πŸ™‚ 294 β›” 15 😞 32.31% 😞 Try splitting into smaller methods. Extract out complex expressions
app/main.py Pokemon.reset_stats 6 ⭐ 335 β›” 14 😞 39.67% 😞 Try splitting into smaller methods. Extract out complex expressions
app/main.py catch 13 πŸ™‚ 211 β›” 10 😞 45.23% 😞 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • πŸ™‚ good
  • 😞 poor
  • β›” very poor

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!

Help us improve this quality report!

@sourcery-ai sourcery-ai Bot closed this Nov 18, 2022
@sourcery-ai
sourcery-ai Bot deleted the sourcery/pull-83 branch November 18, 2022 04:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant