Skip to content
This repository was archived by the owner on Apr 26, 2023. It is now read-only.

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Nov 18, 2022

Pull Request #1 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/IgnisDa/Gitzer pull/1/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!

data = json.loads(response.read())
tag_name = data["tag_name"].lstrip("v")
gzip_name = "gitzer-{}.tar.gz".format(tag_name)
gzip_name = f"gitzer-{tag_name}.tar.gz"
Copy link
Author

Choose a reason for hiding this comment

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

Function Installer.get_download_url refactored with the following changes:

except HTTPError as e:
if e.code == 404:
raise RuntimeError("Could not find {} file".format(gzip_name))
raise RuntimeError(f"Could not find {gzip_name} file")
Copy link
Author

Choose a reason for hiding this comment

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

Function Installer.download_release refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Nov 18, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.40 ⭐ 3.31 ⭐ 0.91 👎
Method Length 55.75 ⭐ 63.67 🙂 7.92 👎
Working memory 5.58 ⭐ 4.34 ⭐ -1.24 👍
Quality 80.86% 75.20% -5.66% 👎
Other metrics Before After Change
Lines 138 157 19
Changed files Quality Before Quality After Quality Change
get-gitzer.py 80.86% ⭐ 75.20% ⭐ -5.66% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
get-gitzer.py Installer.install 5 ⭐ 183 😞 57.61% 🙂 Try splitting into smaller methods
get-gitzer.py Installer.download_release 6 ⭐ 121 😞 8 🙂 64.59% 🙂 Try splitting into smaller methods

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!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant