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/fauna data collection (Sourcery refactored) #38

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

Pull Request #36 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/fauna-data-collection branch, then run:

git fetch origin sourcery/feature/fauna-data-collection
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 1.38%.

Quality metrics Before After Change
Complexity 7.23 ⭐ 6.48 ⭐ -0.75 πŸ‘
Method Length 76.21 πŸ™‚ 74.84 πŸ™‚ -1.37 πŸ‘
Working memory 11.00 😞 10.83 😞 -0.17 πŸ‘
Quality 58.58% πŸ™‚ 59.96% πŸ™‚ 1.38% πŸ‘
Other metrics Before After Change
Lines 373 364 -9
Changed files Quality Before Quality After Quality Change
scrappers/spiders/yahoo_finance.py 62.27% πŸ™‚ 65.05% πŸ™‚ 2.78% πŸ‘
scrappers/spiders/yahoo_tickers_news.py 56.70% πŸ™‚ 57.56% πŸ™‚ 0.86% πŸ‘

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

File Function Complexity Length Working Memory Quality Recommendation
scrappers/spiders/yahoo_tickers_news.py YahooStockSpider.parse 25 😞 200 😞 16 β›” 28.24% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
scrappers/spiders/yahoo_finance.py ScraperForYahoo.handle_article 4 ⭐ 214 β›” 14 😞 46.81% 😞 Try splitting into smaller methods. Extract out complex expressions
scrappers/spiders/yahoo_tickers_news.py YahooStockSpider.handle_article 4 ⭐ 206 β›” 14 😞 47.37% 😞 Try splitting into smaller methods. Extract out complex expressions
scrappers/spiders/yahoo_tickers_news.py YahooStockSpider.parse_news_item 2 ⭐ 142.99 😞 12 😞 58.05% πŸ™‚ Try splitting into smaller methods. Extract out complex expressions
scrappers/spiders/yahoo_tickers_news.py YahooStockSpider.spider_closed 1 ⭐ 107.97 πŸ™‚ 10 😞 66.93% πŸ™‚ Extract out complex expressions

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 #38 (7a36e5d) into feature/fauna-data-collection (a571183) will decrease coverage by 1.53%. The diff coverage is 0.00%.

Impacted file tree graph

@@                        Coverage Diff                        @@
##           feature/fauna-data-collection      #38      +/-   ##
=================================================================
- Coverage                          67.82%   66.28%   -1.54%     
=================================================================
  Files                                 12       12              
  Lines                                345      353       +8     
=================================================================
  Hits                                 234      234              
- Misses                               111      119       +8     
Flag Coverage Ξ”
ga_ci 66.28% <0.00%> (-1.54%) :arrow_down:

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

Impacted Files Coverage Ξ”
nlp_articles/app/data_collection.py 0.00% <0.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 5b52b69...7a36e5d. Read the comment docs.