Closed neomatrix369 closed 1 year ago
β Merging this PR will decrease code quality in the affected files by 3.04%.
Quality metrics | Before | After | Change |
---|---|---|---|
Complexity | 0.89 β | 0.75 β | -0.14 π |
Method Length | 37.16 β | 39.41 β | 2.25 π |
Working memory | 5.00 β | 5.96 β | 0.96 π |
Quality | 87.20% β | 84.16% β | -3.04% π |
Other metrics | Before | After | Change |
---|---|---|---|
Lines | 1997 | 2483 | 486 |
Changed files | Quality Before | Quality After | Quality Change |
---|---|---|---|
setup.py | 67.46% π | 67.46% π | 0.00% |
nlp_profiler/__init__.py | 100.00% β | 100.00% β | 0.00% |
nlp_profiler/constants.py | 80.17% β | 80.17% β | 0.00% |
nlp_profiler/core.py | 63.10% π | 64.79% π | 1.69% π |
nlp_profiler/generate_features/__init__.py | 71.82% π | 72.44% π | 0.62% π |
nlp_profiler/generate_features/parallelisation_methods/__init__.py | 90.29% β | 91.42% β | 1.13% π |
nlp_profiler/granular_features/__init__.py | 75.47% β | 75.47% β | 0.00% |
nlp_profiler/granular_features/alphanumeric.py | 97.09% β | 94.76% β | -2.33% π |
nlp_profiler/granular_features/chars_spaces_and_whitespaces.py | 94.66% β | 91.52% β | -3.14% π |
nlp_profiler/granular_features/dates.py | 90.18% β | 88.11% β | -2.07% π |
nlp_profiler/granular_features/emojis.py | 93.69% β | 93.93% β | 0.24% π |
nlp_profiler/granular_features/english_non_english_chars.py | 94.86% β | 90.69% β | -4.17% π |
nlp_profiler/granular_features/letters.py | 97.09% β | 94.76% β | -2.33% π |
nlp_profiler/granular_features/non_alphanumeric.py | 97.09% β | 94.76% β | -2.33% π |
nlp_profiler/granular_features/noun_phrase_count.py | 87.32% β | 85.95% β | -1.37% π |
nlp_profiler/granular_features/numbers.py | 97.09% β | 94.76% β | -2.33% π |
nlp_profiler/granular_features/punctuations.py | 90.93% β | 88.44% β | -2.49% π |
nlp_profiler/granular_features/stop_words.py | 93.13% β | 93.52% β | 0.39% π |
nlp_profiler/granular_features/words.py | 97.09% β | 94.76% β | -2.33% π |
nlp_profiler/high_level_features/__init__.py | 85.89% β | 85.89% β | 0.00% |
nlp_profiler/high_level_features/ease_of_reading_check.py | 85.73% β | 86.56% β | 0.83% π |
nlp_profiler/high_level_features/sentiment_polarity.py | 86.78% β | 87.66% β | 0.88% π |
nlp_profiler/high_level_features/sentiment_subjectivity.py | 86.78% β | 87.92% β | 1.14% π |
slow-tests/acceptance_tests/test_apply_text_profiling.py | 89.13% β | 89.13% β | 0.00% |
slow-tests/performance_tests/test_perf_ease_of_reading_check.py | 99.17% β | 99.17% β | 0.00% |
slow-tests/performance_tests/test_perf_grammar_check.py | 99.17% β | 99.17% β | 0.00% |
slow-tests/performance_tests/test_perf_granular_features.py | 98.83% β | 98.83% β | 0.00% |
slow-tests/performance_tests/test_perf_noun_phrase.py | 99.17% β | 99.17% β | 0.00% |
slow-tests/performance_tests/test_perf_spelling_check.py | 99.17% β | 99.17% β | 0.00% |
tests/common_functions.py | 72.84% π | 72.84% π | 0.00% |
tests/acceptance_tests/test_apply_text_profiling.py | 88.45% β | 88.45% β | 0.00% |
tests/granular/test_alphanumeric.py | 94.51% β | 94.11% β | -0.40% π |
tests/granular/test_chars_and_spaces.py | 80.81% β | 80.81% β | 0.00% |
tests/granular/test_dates.py | 94.84% β | 94.26% β | -0.58% π |
tests/granular/test_duplicates.py | 95.65% β | 94.85% β | -0.80% π |
tests/granular/test_emojis.py | 95.02% β | 94.50% β | -0.52% π |
tests/granular/test_english_non_english_characters.py | 90.40% β | 70.81% π | -19.59% π |
tests/granular/test_non_alphanumeric.py | 94.10% β | 93.24% β | -0.86% π |
tests/granular/test_nounphrase.py | % | 90.76% β | % |
tests/granular/test_numbers.py | 85.25% β | 85.20% β | -0.05% π |
tests/granular/test_punctuations.py | 90.73% β | 89.94% β | -0.79% π |
tests/granular/test_repeated_digits.py | 90.40% β | 77.69% β | -12.71% π |
tests/granular/test_repeated_letters.py | 90.40% β | 79.93% β | -10.47% π |
tests/granular/test_repeated_punctuations.py | 90.40% β | 70.55% π | -19.85% π |
tests/granular/test_sentences.py | 89.16% β | 89.02% β | -0.14% π |
tests/granular/test_stop_words.py | 95.02% β | 94.50% β | -0.52% π |
tests/granular/test_syllables.py | 90.40% β | 74.74% π | -15.66% π |
tests/granular/test_white_spaces.py | 80.81% β | 80.81% β | 0.00% |
tests/granular/test_words.py | 94.86% β | 94.37% β | -0.49% π |
tests/high_level/test_ease_of_reading_check.py | 87.93% β | 70.29% π | -17.64% π |
tests/high_level/test_grammar_check.py | 87.91% β | 87.04% β | -0.87% π |
tests/high_level/test_sentiment_polarity.py | 79.18% β | 79.18% β | 0.00% |
tests/high_level/test_sentiment_subjectivity.py | 79.18% β | 79.18% β | 0.00% |
tests/high_level/test_spelling_check.py | 74.59% π | 74.59% π | 0.00% |
Here are some functions in these files that still need a tune-up:
File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
---|---|---|---|---|---|---|
tests/common_functions.py | internal_assert_benchmark | 1 β | 136 π | 13 π | 58.26% π | Try splitting into smaller methods. Extract out complex expressions |
tests/common_functions.py | generate_data | 0 β | 80 π | 16 β | 62.86% π | Extract out complex expressions |
nlp_profiler/core.py | apply_text_profiling | 5 β | 148 π | 7 π | 64.79% π | Try splitting into smaller methods |
nlp_profiler/generate_features/__init__.py | generate_features | 2 β | 63 π | 10 π | 72.44% π | Extract out complex expressions |
nlp_profiler/granular_features/__init__.py | apply_granular_features | 0 β | 120 π | 6 β | 75.47% β | Try splitting into smaller methods |
The emojis denote the absolute quality of the code:
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!
Patch coverage: 100.00
% and no project coverage change.
Comparison is base (
a3538c6
) 100.00% compared to head (7caeb47
) 100.00%.:exclamation: Current head 7caeb47 differs from pull request most recent head def1ee8. Consider uploading reports for the commit def1ee8 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Currently blocked by Windows Unicode error which are failing the Windows runners, as per https://github.com/neomatrix369/nlp_profiler/actions/runs/4401367033/jobs/7707511237
https://github.com/neomatrix369/nlp_profiler/pull/73#issuecomment-1465494680 is fixed by 378458f, 44bcc4, 1771150
Pending: sourcery refactoring fixes to merge this PR and other checks mentioned in the body/description of the PR
https://github.com/neomatrix369/nlp_profiler/pull/73#issuecomment-1465516959 - now resolved, next manual checks of notebooks/smoke tests
Logged a regression issue #78 on the back of reviewing the notebooks
To be able to merge a pull request, there are a few checks:
Checklist
Please check the options that you have completed and strike-out the options that do not apply via this pull request:
./test-coverage "tests slow-tests"
) - this will also be visible via the Code coverage report and CI/CD task on the Pull Request- [ ] the notebooks are updated (seenotebooks
folder, read the Notebooks docs)Goal or purpose of the PR
Minor fixes and code formatting
Changes implemented in the PR
Formatting all python code and fixing minor typos in the docs. Running
black
all across the code base and making the code structure consistent. Apply refactorings suggested by Sourcery.ai across all the source files.