Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

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 main branch, then run:

git fetch https://github.com/sourcery-ai-bot/django-simple-svg main
git merge --ff-only FETCH_HEAD
git reset HEAD^

test_runner = DiscoverRunner(verbosity=1)
failures = test_runner.run_tests(["simple_svg"], verbosity=1)
if failures:
if failures := test_runner.run_tests(["simple_svg"], verbosity=1):
Copy link
Author

Choose a reason for hiding this comment

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

Lines 56-57 refactored with the following changes:

Comment on lines -42 to +45
# Raise exception if DEBUG is True, else just log a warning.
if settings.DEBUG:
raise SVGNotFound(message)
else:
logger.warning(message)
return ""
logger.warning(message)
return ""
Copy link
Author

Choose a reason for hiding this comment

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

Function svg refactored with the following changes:

This removes the following comments ( why? ):

# Raise exception if DEBUG is True, else just log a warning.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 6, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 10.33 🙂 9.86 🙂 -0.47 👍
Method Length 138.67 😞 139.00 😞 0.33 👎
Working memory 9.00 🙂 8.97 🙂 -0.03 👍
Quality 53.34% 🙂 53.66% 🙂 0.32% 👍
Other metrics Before After Change
Lines 118 115 -3
Changed files Quality Before Quality After Quality Change
runtests.py 60.60% 🙂 60.70% 🙂 0.10% 👍
simple_svg/templatetags/svg.py 51.27% 🙂 51.90% 🙂 0.63% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
simple_svg/templatetags/svg.py svg 13 🙂 184 😞 9 🙂 49.37% 😞 Try splitting into smaller methods

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant