Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored master branch #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Apr 21, 2022

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^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from Jeklah April 21, 2022 10:44
Comment on lines -9 to -13
shipIndex = 0 # Index for the name of the ship in shipPartCounts
partIndex = 2 # Index for when partIndex is 2 in shipPartCounts.
minPrice = 2 # Index for minimum price at a market.i
shipList = [] # Initalising shipList.

Copy link
Author

Choose a reason for hiding this comment

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

Lines 9-62 refactored with the following changes:

This removes the following comments ( why? ):

# Index for the name of the ship in shipPartCounts
# Initalising shipList.

Comment on lines -166 to +172
click.echo(compare.capitalize() + ' costs ' + '{:,}'.format(cost) + ' ISK at ' + mrkt.capitalize())
click.echo(
f'{compare.capitalize()} costs '
+ '{:,}'.format(cost)
+ ' ISK at '
+ mrkt.capitalize()
)

Copy link
Author

Choose a reason for hiding this comment

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

Function main refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Apr 21, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.23%.

Quality metrics Before After Change
Complexity 4.89 ⭐ 4.66 ⭐ -0.23 👍
Method Length 83.75 🙂 83.50 🙂 -0.25 👍
Working memory 8.29 🙂 8.36 🙂 0.07 👎
Quality 65.74% 🙂 65.97% 🙂 0.23% 👍
Other metrics Before After Change
Lines 212 227 15
Changed files Quality Before Quality After Quality Change
scripts/eveConsts.py 68.71% 🙂 69.92% 🙂 1.21% 👍
scripts/ships.py 65.40% 🙂 65.59% 🙂 0.19% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
scripts/ships.py main 9 🙂 211 ⛔ 13 😞 43.62% 😞 Try splitting into smaller methods. Extract out complex expressions
scripts/ships.py ship_parts_cost 12 🙂 185 😞 11 😞 46.20% 😞 Try splitting into smaller methods. Extract out complex expressions
scripts/ships.py get_appraisal 0 ⭐ 114 🙂 10 😞 67.14% 🙂 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!

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.

0 participants