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

Sourcery refactored master branch #1

Merged
merged 1 commit into from Nov 23, 2021
Merged

Sourcery refactored master branch #1

merged 1 commit into from Nov 23, 2021

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 23, 2021

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 adbar November 23, 2021 13:06
langid/langid.py Show resolved Hide resolved
langid/langid.py Show resolved Hide resolved
langid/langid.py Show resolved Hide resolved
langid/langid.py Show resolved Hide resolved
langid/langid.py Show resolved Hide resolved
langid/train/scanner.py Show resolved Hide resolved
langid/train/tokenize.py Show resolved Hide resolved
langid/train/tokenize.py Show resolved Hide resolved
langid/train/tokenize.py Show resolved Hide resolved
langid/train/tokenize.py Show resolved Hide resolved
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Nov 23, 2021

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 18.02 🙂 16.82 🙂 -1.20 👍
Method Length 59.56 ⭐ 58.94 ⭐ -0.62 👍
Working memory 10.38 😞 10.37 😞 -0.01 👍
Quality 56.27% 🙂 56.66% 🙂 0.39% 👍
Other metrics Before After Change
Lines 1938 1898 -40
Changed files Quality Before Quality After Quality Change
langid/langid.py 49.68% 😞 49.99% 😞 0.31% 👍
langid/examples/_twokenize.py 56.23% 🙂 55.85% 🙂 -0.38% 👎
langid/train/DFfeatureselect.py 72.90% 🙂 73.05% 🙂 0.15% 👍
langid/train/LDfeatureselect.py 60.15% 🙂 60.27% 🙂 0.12% 👍
langid/train/NBtrain.py 61.98% 🙂 61.60% 🙂 -0.38% 👎
langid/train/common.py 80.30% ⭐ 80.33% ⭐ 0.03% 👍
langid/train/index.py 62.75% 🙂 63.10% 🙂 0.35% 👍
langid/train/scanner.py 47.93% 😞 47.71% 😞 -0.22% 👎
langid/train/tokenize.py 52.12% 🙂 54.15% 🙂 2.03% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
langid/langid.py main 67 ⛔ 629 ⛔ 16 ⛔ 8.72% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
langid/train/scanner.py Scanner.build 44 ⛔ 358 ⛔ 11 😞 20.94% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
langid/train/tokenize.py pass_tokenize 39 ⛔ 313 ⛔ 12 😞 21.70% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
langid/langid.py application 21 😞 222 ⛔ 15 😞 30.40% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
langid/train/NBtrain.py pass_tokenize 25 😞 191 😞 11 😞 36.04% 😞 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!

@adbar adbar merged commit 2a06ca7 into master Nov 23, 2021
@adbar adbar deleted the sourcery/master branch November 23, 2021 13:11
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.

None yet

1 participant