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

Genders refactoring #1385

Merged
merged 1 commit into from
Sep 4, 2022
Merged

Genders refactoring #1385

merged 1 commit into from
Sep 4, 2022

Conversation

BoboTiG
Copy link
Owner

@BoboTiG BoboTiG commented Sep 4, 2022

Same work as done for pronunciations in #1377.

Maybe the new code, and the one for pronunciations, could be refactored more to automatically get rid of duplicates (and still keeping the retrieval order).

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 4, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 24.09 😞 24.01 😞 -0.08 👍
Method Length 119.87 😞 122.01 😞 2.14 👎
Working memory 10.45 😞 10.42 😞 -0.03 👍
Quality 47.15% 😞 47.35% 😞 0.20% 👍
Other metrics Before After Change
Lines 6790 6830 40
Changed files Quality Before Quality After Quality Change
tests/test_ca.py 66.47% 🙂 61.10% 🙂 -5.37% 👎
tests/test_de.py 74.87% 🙂 71.69% 🙂 -3.18% 👎
tests/test_el.py 77.55% ⭐ 74.94% 🙂 -2.61% 👎
tests/test_en.py 67.56% 🙂 62.38% 🙂 -5.18% 👎
tests/test_es.py 66.12% 🙂 61.05% 🙂 -5.07% 👎
tests/test_fr.py 59.42% 🙂 53.10% 🙂 -6.32% 👎
tests/test_it.py 78.42% ⭐ 75.47% ⭐ -2.95% 👎
tests/test_pt.py 69.22% 🙂 64.36% 🙂 -4.86% 👎
tests/test_ru.py 73.68% 🙂 69.58% 🙂 -4.10% 👎
tests/test_sv.py 81.28% ⭐ 78.43% ⭐ -2.85% 👎
wikidict/convert.py 57.52% 🙂 57.52% 🙂 0.00%
wikidict/get_word.py 35.13% 😞 35.13% 😞 0.00%
wikidict/render.py 37.24% 😞 37.37% 😞 0.13% 👍
wikidict/stubs.py 75.24% ⭐ 75.97% ⭐ 0.73% 👍
wikidict/utils.py 66.95% 🙂 67.42% 🙂 0.47% 👍
wikidict/lang/init.py 79.80% ⭐ 79.02% ⭐ -0.78% 👎
wikidict/lang/defaults.py 64.99% 🙂 66.24% 🙂 1.25% 👍
wikidict/lang/ca/init.py 19.26% ⛔ 23.26% ⛔ 4.00% 👍
wikidict/lang/de/init.py 64.95% 🙂 65.59% 🙂 0.64% 👍
wikidict/lang/el/init.py 73.01% 🙂 73.03% 🙂 0.02% 👍
wikidict/lang/en/init.py 23.96% ⛔ 24.02% ⛔ 0.06% 👍
wikidict/lang/es/init.py 30.53% 😞 30.59% 😞 0.06% 👍
wikidict/lang/fr/init.py 20.62% ⛔ 24.62% ⛔ 4.00% 👍
wikidict/lang/it/init.py 83.75% ⭐ 83.71% ⭐ -0.04% 👎
wikidict/lang/pt/init.py 19.01% ⛔ 20.05% ⛔ 1.04% 👍
wikidict/lang/ru/init.py 87.49% ⭐ 84.66% ⭐ -2.83% 👎
wikidict/lang/sv/init.py 48.90% 😞 48.23% 😞 -0.67% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
wikidict/lang/en/init.py last_template_handler 63 ⛔ 397 ⛔ 25 ⛔ 4.77% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/lang/ca/init.py last_template_handler 53 ⛔ 479 ⛔ 4.90% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
wikidict/lang/pt/init.py last_template_handler 58 ⛔ 528 ⛔ 22 ⛔ 5.41% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/convert.py KoboFormat.save_html 85 ⛔ 429 ⛔ 19 ⛔ 6.18% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
wikidict/lang/fr/init.py last_template_handler 64 ⛔ 573 ⛔ 18 ⛔ 7.19% ⛔ 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!

@BoboTiG BoboTiG merged commit 419fa86 into master Sep 4, 2022
@BoboTiG BoboTiG deleted the fix-993 branch September 4, 2022 13:10
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.

[EL] Regex to match gender
1 participant