get-pytube / pytube3

A lightweight, dependency-free Python 3 library (and command-line utility) for downloading YouTube Videos.
https://pytube3.readthedocs.io
Other
178 stars 55 forks source link

Patch 1 #111

Closed anupamkayal closed 2 months ago

sourcery-ai[bot] commented 3 years ago

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.63%.

Quality metrics Before After Change
Complexity 0.74 ⭐ 0.73 ⭐ -0.01 👍
Method Length 38.28 ⭐ 39.49 ⭐ 1.21 👎
Working memory 6.41 🙂 6.64 🙂 0.23 👎
Quality 86.71% 86.08% -0.63% 👎
Other metrics Before After Change
Lines 4292 4785 493
Changed files Quality Before Quality After Quality Change
setup.py 48.38% 😞 48.26% 😞 -0.12% 👎
docs/conf.py 66.30% 🙂 66.30% 🙂 0.00%
pytube/main.py 85.15% ⭐ 86.64% ⭐ 1.49% 👍
pytube/captions.py 86.19% ⭐ 85.98% ⭐ -0.21% 👎
pytube/cipher.py 84.47% ⭐ 85.02% ⭐ 0.55% 👍
pytube/cli.py 77.57% ⭐ 77.67% ⭐ 0.10% 👍
pytube/exceptions.py 95.15% ⭐ 95.12% ⭐ -0.03% 👎
pytube/extract.py 84.19% ⭐ 81.25% ⭐ -2.94% 👎
pytube/helpers.py 84.34% ⭐ 83.25% ⭐ -1.09% 👎
pytube/monostate.py 96.71% ⭐ 96.71% ⭐ 0.00%
pytube/query.py 92.12% ⭐ 92.18% ⭐ 0.06% 👍
pytube/request.py 85.59% ⭐ 84.64% ⭐ -0.95% 👎
pytube/streams.py 87.12% ⭐ 87.22% ⭐ 0.10% 👍
pytube/version.py 96.01% ⭐ 96.01% ⭐ 0.00%
pytube/contrib/playlist.py 87.70% ⭐ 85.19% ⭐ -2.51% 👎
tests/conftest.py 92.14% ⭐ 89.17% ⭐ -2.97% 👎
tests/test_captions.py 79.26% ⭐ 75.31% ⭐ -3.95% 👎
tests/test_cli.py 82.57% ⭐ 82.07% ⭐ -0.50% 👎
tests/test_exceptions.py 97.75% ⭐ 97.75% ⭐ 0.00%
tests/test_extract.py 95.19% ⭐ 95.31% ⭐ 0.12% 👍
tests/test_helpers.py 92.76% ⭐ 89.88% ⭐ -2.88% 👎
tests/test_query.py 88.63% ⭐ 88.37% ⭐ -0.26% 👎
tests/test_request.py 91.51% ⭐ 91.51% ⭐ 0.00%
tests/test_streams.py 87.68% ⭐ 85.31% ⭐ -2.37% 👎
tests/contrib/test_playlist.py 87.90% ⭐ 88.04% ⭐ 0.14% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
pytube/query.py StreamQuery.filter 22 😞 237 ⛔ 22 ⛔ 23.34% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pytube/extract.py apply_descrambler 12 🙂 221 ⛔ 20 ⛔ 33.16% 😞 Try splitting into smaller methods. Extract out complex expressions
tests/test_query.py test_filters 0 ⭐ 155 😞 50 ⛔ 46.04% 😞 Try splitting into smaller methods. Extract out complex expressions
pytube/contrib/playlist.py Playlist._paginate 15 🙂 132 😞 11 😞 48.97% 😞 Try splitting into smaller methods. Extract out complex expressions
pytube/cli.py ffmpeg_process 11 🙂 160 😞 11 😞 49.38% 😞 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!

Let us know what you think of it by mentioning @sourcery-ai in a comment.