rec / safer

๐Ÿงท A safer writer ๐Ÿงท
https://rec.github.io/safer/
MIT License
174 stars 9 forks source link

Work around mkdocstr issue (Sourcery refactored) #21

Closed sourcery-ai[bot] closed 1 year ago

sourcery-ai[bot] commented 1 year ago

Pull Request #20 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

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:

Review changes via command line

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

git fetch origin sourcery/front-page
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 1 year ago

Sourcery Code Quality Report

โŒ  Merging this PR will decrease code quality in the affected files by 0.46%.

Quality metrics Before After Change
Complexity 15.20 ๐Ÿ™‚ 15.33 ๐Ÿ™‚ 0.13 ๐Ÿ‘Ž
Method Length 65.50 ๐Ÿ™‚ 65.58 ๐Ÿ™‚ 0.08 ๐Ÿ‘Ž
Working memory 5.71 โญ 5.77 โญ 0.06 ๐Ÿ‘Ž
Quality 55.58% ๐Ÿ™‚ 55.12% ๐Ÿ™‚ -0.46% ๐Ÿ‘Ž
Other metrics Before After Change
Lines 684 683 -1
Changed files Quality Before Quality After Quality Change
safer.py 55.58% ๐Ÿ™‚ 55.12% ๐Ÿ™‚ -0.46% ๐Ÿ‘Ž

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

File Function Complexity Length Working Memory Quality Recommendation
safer.py open 32 ๐Ÿ˜ž 329 โ›” 16.74% โ›” Refactor to reduce nesting. Try splitting into smaller methods
safer.py writer 28 ๐Ÿ˜ž 230 โ›” 14 ๐Ÿ˜ž 26.91% ๐Ÿ˜ž Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
safer.py dump 24 ๐Ÿ˜ž 183 ๐Ÿ˜ž 9 ๐Ÿ™‚ 41.27% ๐Ÿ˜ž Refactor to reduce nesting. Try splitting into smaller methods
safer.py _FileCloser._make_stream 7 โญ 137 ๐Ÿ˜ž 8 ๐Ÿ™‚ 61.72% ๐Ÿ™‚ Try splitting into smaller methods

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!

Help us improve this quality report!