shtab icon indicating copy to clipboard operation
shtab copied to clipboard

Sourcery refactored master branch

Open sourcery-ai[bot] opened this issue 2 years ago • 2 comments

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[bot] avatar May 12 '22 15:05 sourcery-ai[bot]

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 28.94 😞 28.68 😞 -0.26 👍
Method Length 86.75 🙂 88.62 🙂 1.87 👎
Working memory 14.56 😞 14.31 😞 -0.25 👍
Quality 44.95% 😞 45.03% 😞 0.08% 👍
Other metrics Before After Change
Lines 1360 1427 67
Changed files Quality Before Quality After Quality Change
examples/docopt-greeter.py 85.62% ⭐ 82.58% ⭐ -3.04% 👎
shtab/init.py 29.55% 😞 29.61% 😞 0.06% 👍
shtab/main.py 67.87% 🙂 67.82% 🙂 -0.05% 👎
tests/test_shtab.py 78.96% ⭐ 78.86% ⭐ -0.10% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
shtab/init.py complete_zsh 61 ⛔ 756 ⛔ 27 ⛔ 3.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py get_bash_commands 78 ⛔ 535 ⛔ 24 ⛔ 3.20% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py get_bash_commands.recurse 58 ⛔ 482 ⛔ 24 ⛔ 4.82% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py complete_tcsh 53 ⛔ 407 ⛔ 19 ⛔ 8.68% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
shtab/init.py complete_zsh.recurse 17 🙂 213 ⛔ 16 ⛔ 32.81% 😞 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[bot] avatar May 12 '22 15:05 sourcery-ai[bot]

Codecov Report

Merging #76 (cf19980) into master (cf19980) will not change coverage. The diff coverage is n/a.

:exclamation: Current head cf19980 differs from pull request most recent head 5eac02b. Consider uploading reports for the commit 5eac02b to get more accurate results

@@           Coverage Diff           @@
##           master      #76   +/-   ##
=======================================
  Coverage   91.04%   91.04%           
=======================================
  Files           3        3           
  Lines         335      335           
=======================================
  Hits          305      305           
  Misses         30       30           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cf19980...5eac02b. Read the comment docs.

codecov-commenter avatar May 16 '22 09:05 codecov-commenter