dli-invest / fin_news_nlp

Financial nlp project to scan news sites for information built using spacy, fastapi, scrapy, cookercutter and various news sources.
Apache License 2.0
9 stars 4 forks source link

Feature/improve rss (Sourcery refactored) #7

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #6 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will re-run and update (force-push) this Pull Request with new refactorings as necessary. If Sourcery finds no refactorings at any point, this Pull Request will be closed automatically.

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 feature/improve-rss branch, then run:

git fetch origin sourcery/feature/improve-rss
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

codecov[bot] commented 2 years ago

Codecov Report

Merging #7 (51f3501) into feature/improve-rss (253ee1a) will decrease coverage by 0.04%. The diff coverage is 100.00%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           feature/improve-rss       #7      +/-   ##
=======================================================
- Coverage                89.95%   89.90%   -0.05%     
=======================================================
  Files                        7        7              
  Lines                      209      208       -1     
=======================================================
- Hits                       188      187       -1     
  Misses                      21       21              
Flag Coverage Δ
ga_ci 89.90% <100.00%> (-0.05%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
nlp_articles/app/nlp.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0e23e4d...51f3501. Read the comment docs.

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 15.71 🙂 14.27 🙂 -1.44 👍
Method Length 92.89 🙂 92.22 🙂 -0.67 👍
Working memory 11.56 😞 11.48 😞 -0.08 👍
Quality 46.17% 😞 47.35% 😞 1.18% 👍
Other metrics Before After Change
Lines 192 190 -2
Changed files Quality Before Quality After Quality Change
nlp_articles/app/nlp.py 19.53% ⛔ 21.28% ⛔ 1.75% 👍
scrappers/parse_rss_cli.py 68.50% 🙂 68.84% 🙂 0.34% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
nlp_articles/app/nlp.py init_nlp 24 😞 418 ⛔ 16 ⛔ 21.28% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
scrappers/parse_rss_cli.py iterate_cnbc_feed 8 ⭐ 127 😞 10 😞 57.67% 🙂 Try splitting into smaller methods. Extract out complex expressions
scrappers/parse_rss_cli.py main 9 🙂 128 😞 8 🙂 60.88% 🙂 Try splitting into smaller methods

Legend and Explanation

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!