Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Feb 28, 2023

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 TwitHat February 28, 2023 19:07
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 28, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 5.23 ⭐ 5.11 ⭐ -0.12 👍
Method Length 66.11 🙂 66.05 🙂 -0.06 👍
Working memory 6.44 🙂 6.41 🙂 -0.03 👍
Quality 70.83% 🙂 71.01% 🙂 0.18% 👍
Other metrics Before After Change
Lines 8885 8816 -69
Changed files Quality Before Quality After Quality Change
diskcache/core.py 50.28% 🙂 50.28% 🙂 0.00%
diskcache/djangocache.py 79.07% ⭐ 79.05% ⭐ -0.02% 👎
diskcache/persistent.py 84.64% ⭐ 84.98% ⭐ 0.34% 👍
diskcache/recipes.py 68.24% 🙂 68.24% 🙂 0.00%
tests/benchmark_core.py 52.81% 🙂 53.66% 🙂 0.85% 👍
tests/benchmark_djangocache.py 60.56% 🙂 61.80% 🙂 1.24% 👍
tests/benchmark_glob.py 52.86% 🙂 52.93% 🙂 0.07% 👍
tests/benchmark_incr.py 69.82% 🙂 69.62% 🙂 -0.20% 👎
tests/plot.py 55.50% 🙂 55.62% 🙂 0.12% 👍
tests/stress_test_core.py 61.63% 🙂 61.88% 🙂 0.25% 👍
tests/stress_test_deque_mp.py 84.35% ⭐ 84.50% ⭐ 0.15% 👍
tests/stress_test_fanout.py 63.01% 🙂 63.31% 🙂 0.30% 👍
tests/stress_test_index_mp.py 84.58% ⭐ 84.09% ⭐ -0.49% 👎
tests/test_core.py 78.22% ⭐ 78.23% ⭐ 0.01% 👍
tests/test_deque.py 91.08% ⭐ 91.09% ⭐ 0.01% 👍
tests/test_djangocache.py 78.86% ⭐ 78.87% ⭐ 0.01% 👍
tests/test_fanout.py 76.86% ⭐ 76.89% ⭐ 0.03% 👍
tests/utils.py 79.03% ⭐ 80.15% ⭐ 1.12% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
diskcache/core.py Cache.get 33 ⛔ 272 ⛔ 25 ⛔ 14.53% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
diskcache/core.py Cache.check 39 ⛔ 370 ⛔ 16 ⛔ 15.03% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
diskcache/core.py Cache.peek 29 😞 216 ⛔ 16 ⛔ 24.89% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
diskcache/core.py Cache.pull 30 😞 216 ⛔ 14 😞 26.78% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
diskcache/core.py Cache.__init__ 18 🙂 371 ⛔ 15 😞 27.18% 😞 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!

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