laike9m / pdir2

Pretty dir() printing with joy:beer:
MIT License
1.33k stars 47 forks source link

Sourcery refactored master branch #55

Closed sourcery-ai[bot] closed 3 years ago

sourcery-ai[bot] commented 3 years ago

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^
sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 6.06 ⭐ 5.96 ⭐ -0.10 👍
Method Length 36.09 ⭐ 36.00 ⭐ -0.09 👍
Working memory 9.11 🙂 9.16 🙂 0.05 👎
Quality 72.92% 🙂 72.90% 🙂 -0.02% 👎
Other metrics Before After Change
Lines 342 342 0
Changed files Quality Before Quality After Quality Change
pdir/_internal_utils.py 83.22% ⭐ 82.80% ⭐ -0.42% 👎
pdir/api.py 65.43% 🙂 65.73% 🙂 0.30% 👍
pdir/color.py 85.61% ⭐ 87.61% ⭐ 2.00% 👍
pdir/format.py 75.29% ⭐ 74.97% 🙂 -0.32% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
pdir/api.py PrettyAttribute.get_oneline_doc 24 😞 148 😞 14 😞 35.96% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pdir/api.py PrettyDir.__init__ 5 ⭐ 92 🙂 12 😞 61.52% 🙂 Extract out complex expressions
pdir/_internal_utils.py is_slotted_attr 0 ⭐ 24 ⭐ 10 😞 80.74% ⭐ Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

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.