Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1494: Smarter link-with-namespace filter #1530

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

lasconic
Copy link
Collaborator

@lasconic lasconic commented Jan 17, 2023

Fixes #1494

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 17, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 3.81 ⭐ 4.28 ⭐ 0.47 👎
Method Length 105.11 🙂 97.47 🙂 -7.64 👍
Working memory 8.25 🙂 8.72 🙂 0.47 👎
Quality 68.68% 🙂 64.38% 🙂 -4.30% 👎
Other metrics Before After Change
Lines 1069 696 -373
Changed files Quality Before Quality After Quality Change
scripts/all-namespaces.py 69.41% 🙂 60.27% 🙂 -9.14% 👎
wikidict/namespaces.py 68.14% 🙂 93.58% ⭐ 25.44% 👍
wikidict/utils.py 68.61% 🙂 64.59% 🙂 -4.02% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
wikidict/utils.py clean 4 ⭐ 316 ⛔ 11 😞 46.84% 😞 Try splitting into smaller methods. Extract out complex expressions
wikidict/utils.py process_templates 9 🙂 173 😞 8 🙂 56.14% 🙂 Try splitting into smaller methods
wikidict/utils.py transform 8 ⭐ 132 😞 10 😞 57.08% 🙂 Try splitting into smaller methods. Extract out complex expressions
wikidict/utils.py table2html 6 ⭐ 80 🙂 11 😞 64.02% 🙂 Extract out complex expressions
wikidict/utils.py get_word_of_the_day 1 ⭐ 142 😞 9 🙂 64.85% 🙂 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!

@BoboTiG
Copy link
Owner

BoboTiG commented Jan 17, 2023

Wow!
Can you add the problematic code from #1494 (comment) in our tests?

I guess some are missing still, in my PR I added a bunch of templates. Let me find those eventually problematic words.

@BoboTiG
Copy link
Owner

BoboTiG commented Jan 17, 2023

Well, it is OK on my side. Congrats! 🥂

wikidict/utils.py Outdated Show resolved Hide resolved
@BoboTiG BoboTiG merged commit a709b35 into BoboTiG:master Jan 17, 2023
@BoboTiG
Copy link
Owner

BoboTiG commented Jan 17, 2023

I feel lighter with your patch, mine was terribly heavier finally ^^

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.

Smarter link-with-namespace filter
2 participants