ultralytics / flickr_scraper

Simple Flickr Image Scraper
https://ultralytics.com
GNU Affero General Public License v3.0
207 stars 62 forks source link

Sourcery refactored master branch #10

Closed sourcery-ai[bot] closed 2 years ago

sourcery-ai[bot] commented 2 years ago

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!

๐Ÿ› ๏ธ PR Summary

Made with โค๏ธ by Ultralytics Actions

๐ŸŒŸ Summary

Modernization and improvement of code quality in Flickr scraper and image cleaning utilities.

๐Ÿ“Š Key Changes

๐ŸŽฏ Purpose & Impact

sourcery-ai[bot] commented 2 years ago

Sourcery Code Quality Report

โŒ  Merging this PR will decrease code quality in the affected files by 0.61%.

Quality metrics Before After Change
Complexity 29.96 ๐Ÿ˜ž 29.96 ๐Ÿ˜ž 0.00
Method Length 146.33 ๐Ÿ˜ž 148.56 ๐Ÿ˜ž 2.23 ๐Ÿ‘Ž
Working memory 10.05 ๐Ÿ˜ž 10.32 ๐Ÿ˜ž 0.27 ๐Ÿ‘Ž
Quality 38.47% ๐Ÿ˜ž 37.86% ๐Ÿ˜ž -0.61% ๐Ÿ‘Ž
Other metrics Before After Change
Lines 259 257 -2
Changed files Quality Before Quality After Quality Change
flickr_scraper.py 58.30% ๐Ÿ™‚ 55.66% ๐Ÿ™‚ -2.64% ๐Ÿ‘Ž
utils/clean_images.py 29.27% ๐Ÿ˜ž 29.19% ๐Ÿ˜ž -0.08% ๐Ÿ‘Ž
utils/general.py 66.67% ๐Ÿ™‚ 66.54% ๐Ÿ™‚ -0.13% ๐Ÿ‘Ž

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

File Function Complexity Length Working Memory Quality Recommendation
utils/clean_images.py scan 59 โ›” 500 โ›” 12 ๐Ÿ˜ž 15.14% โ›” Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
utils/clean_images.py scan.scan_one_file 18 ๐Ÿ™‚ 306 โ›” 9 ๐Ÿ™‚ 38.64% ๐Ÿ˜ž Try splitting into smaller methods
flickr_scraper.py get_urls 16 ๐Ÿ™‚ 174 ๐Ÿ˜ž 13 ๐Ÿ˜ž 40.49% ๐Ÿ˜ž Try splitting into smaller methods. 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!