Skip to content

Sourcery Starbot ⭐ refactored jefftriplett/kindlestrip #5

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

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

Conversation

SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

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

git fetch https://github.com/sourcery-ai-bot/kindlestrip master
git merge --ff-only FETCH_HEAD
git reset HEAD^

if argvencoding == None:
if argvencoding is None:
Copy link
Author

Choose a reason for hiding this comment

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

Function utf8_argv refactored with the following changes:

  • Use x is None rather than x == None (none-compare)

dout=[]
dout.append(datain[:off])
dout.append(new)
dout.append(datain[off+len(new):])
dout = [datain[:off], new, datain[off+len(new):]]
Copy link
Author

Choose a reason for hiding this comment

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

Function patchdata refactored with the following changes:

  • Merge append into list declaration (merge-list-append)

Comment on lines -197 to +194
dout=[]
dout.append(datain)
dout.append(new)
dout = [datain, new]
Copy link
Author

Choose a reason for hiding this comment

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

Function joindata refactored with the following changes:

  • Merge append into list declaration (merge-list-append)

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 3, 2020

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.00 ⭐ 2.00 ⭐ 0.00
Method Length 31.00 ⭐ 29.89 ⭐ -1.11 👍
Working memory 4.78 ⭐ 4.67 ⭐ -0.11 👍
Quality 89.66% 90.13% 0.47% 👍
Other metrics Before After Change
Lines 138 133 -5
Changed files Quality Before Quality After Quality Change
kindlestrip.py 89.66% ⭐ 90.13% ⭐ 0.47% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
kindlestrip.py utf8_argv 14 🙂 151 😞 10 😞 49.59% 😞 Try splitting into smaller methods. Extract out complex expressions
kindlestrip.py SRCSStripper.sec_info 2 ⭐ 53 ⭐ 14 😞 67.40% 🙂 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

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