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 #1732: [DE] Support "Ref-behindthename" template, and others #1747

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

BoboTiG
Copy link
Owner

@BoboTiG BoboTiG commented Feb 3, 2023

Fixes #1732

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 3, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 112.97 ⛔ 112.62 ⛔ -0.35 👍
Method Length 134.94 😞 132.48 😞 -2.46 👍
Working memory 20.34 ⛔ 20.20 ⛔ -0.14 👍
Quality 35.90% 😞 36.52% 😞 0.62% 👍
Other metrics Before After Change
Lines 3646 3723 77
Changed files Quality Before Quality After Quality Change
tests/test_2_render.py 90.56% ⭐ 90.43% ⭐ -0.13% 👎
tests/test_4_check_word.py 87.23% ⭐ 87.22% ⭐ -0.01% 👎
tests/test_de.py 71.21% 🙂 70.92% 🙂 -0.29% 👎
wikidict/check_word.py 27.38% 😞 27.05% 😞 -0.33% 👎
wikidict/hiero_utils.py 51.65% 🙂 51.65% 🙂 0.00%
wikidict/render.py 43.61% 😞 46.41% 😞 2.80% 👍
wikidict/lang/de/__init__.py 64.15% 🙂 63.66% 🙂 -0.49% 👎
wikidict/lang/de/template_handlers.py 63.03% 🙂 63.09% 🙂 0.06% 👍
wikidict/lang/fr/arabiser.py 4.08% ⛔ 4.08% ⛔ 0.00%
wikidict/lang/ru/__init__.py 86.32% ⭐ 86.32% ⭐ 0.00%

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

File Function Complexity Length Working Memory Quality Recommendation
wikidict/lang/fr/arabiser.py appliquer 343 ⛔ 3576 ⛔ 46 ⛔ 0.07% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/lang/fr/arabiser.py arabiser 189 ⛔ 1069 ⛔ 39 ⛔ 0.21% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/check_word.py filter_html 168 ⛔ 1065 ⛔ 22 ⛔ 3.05% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/hiero_utils.py render_hiero 76 ⛔ 420 ⛔ 21 ⛔ 5.32% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/render.py find_etymology 45 ⛔ 377 ⛔ 15 😞 14.38% ⛔ Refactor to reduce nesting. 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!

It is disabled by default to speed-up the overall process, but enabled when
called from get_and_parse_word().
"""
def adjust_wikicode(code: str, locale: str) -> str:
Copy link
Owner Author

@BoboTiG BoboTiG Feb 3, 2023

Choose a reason for hiding this comment

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

Also way easier to add unit tests.

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.

[DE] Support "Ref-behindthename" template, and others
1 participant