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

fix: fixing bug with nlp on description (Sourcery refactored) #16

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #15 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 bugfix/stock-scan-logic branch, then run:

git fetch origin sourcery/bugfix/stock-scan-logic
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

βœ…  Merging this PR will increase code quality in the affected files by 0.97%.

Quality metrics Before After Change
Complexity 21.21 😞 19.17 😞 -2.04 πŸ‘
Method Length 99.78 πŸ™‚ 99.67 πŸ™‚ -0.11 πŸ‘
Working memory 12.72 😞 12.69 😞 -0.03 πŸ‘
Quality 41.42% 😞 42.39% 😞 0.97% πŸ‘
Other metrics Before After Change
Lines 201 203 2
Changed files Quality Before Quality After Quality Change
nlp_articles/app/nlp.py 12.68% β›” 14.23% β›” 1.55% πŸ‘
scrappers/parse_rss_cli.py 68.62% πŸ™‚ 68.65% πŸ™‚ 0.03% πŸ‘

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 33 β›” 480 β›” 18 β›” 14.23% β›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
scrappers/parse_rss_cli.py iterate_cnbc_feed 8 ⭐ 122 😞 10 😞 58.28% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions
scrappers/parse_rss_cli.py main 9 πŸ™‚ 138 😞 8 πŸ™‚ 59.72% πŸ™‚ 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!

codecov[bot] commented 2 years ago

Codecov Report

Merging #16 (6913836) into bugfix/stock-scan-logic (56e1ffd) will decrease coverage by 0.08%. The diff coverage is 100.00%.

Impacted file tree graph

@@                     Coverage Diff                     @@
##           bugfix/stock-scan-logic      #16      +/-   ##
===========================================================
- Coverage                    74.56%   74.47%   -0.09%     
===========================================================
  Files                            9        9              
  Lines                          287      286       -1     
===========================================================
- Hits                           214      213       -1     
  Misses                          73       73              
Flag Coverage Ξ”
ga_ci 74.47% <100.00%> (-0.09%) :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 56e1ffd...6913836. Read the comment docs.