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

Fixed wrong title error (Sourcery refactored) #97

Open sourcery-ai[bot] opened 4 years ago

sourcery-ai[bot] commented 4 years ago

Pull Request #95 refactored by Sourcery.

Since the original Pull Request was opened as a fork in a contributor's repository, we are unable to create a Pull Request branching from it.

To incorporate these changes, you can either:

  1. Merge this Pull Request instead of the original, or

  2. Ask your contributor to locally incorporate these commits and push them to the original Pull Request

    Incorporate changes via command line
    git fetch https://github.com/get-pytube/pytube3 pull/95/head
    git merge --ff-only FETCH_HEAD
    git push

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:

sourcery-ai[bot] commented 4 years ago

Sourcery Code Quality Report (beta)

❌  Merging this PR will decrease code quality in the affected files by 0.01 out of 10.

Quality metrics Before After Change
Complexity 0.75 0.75 0.00
Method Length 39.07 39.25 0.18 🔴
Quality 9.00 8.99 -0.01 🔴
Other metrics Before After Change
Lines 4247 4495 248
Changed files Quality Before Quality After Quality Change
setup.py 7.08 7.08 0.00
docs/conf.py 7.02 7.02 0.00
pytube/main.py 8.79 8.79 0.00
pytube/captions.py 8.88 8.90 0.02 🔵
pytube/cipher.py 8.95 8.94 -0.01 🔴
pytube/cli.py 8.18 8.17 -0.01 🔴
pytube/exceptions.py 9.61 9.60 -0.01 🔴
pytube/extract.py 8.81 8.79 -0.02 🔴
pytube/helpers.py 8.99 8.98 -0.01 🔴
pytube/monostate.py 9.67 9.67 0.00
pytube/query.py 9.29 9.29 0.00
pytube/request.py 8.82 8.81 -0.01 🔴
pytube/streams.py 8.94 8.94 0.00
pytube/contrib/playlist.py 8.91 8.90 -0.01 🔴
tests/conftest.py 9.30 9.30 0.00
tests/generate_fixture.py 7.73 7.73 0.00
tests/test_captions.py 8.88 8.87 -0.01 🔴
tests/test_cli.py 8.79 8.78 -0.01 🔴
tests/test_exceptions.py 9.48 9.47 -0.01 🔴
tests/test_extract.py 9.61 9.61 0.00
tests/test_helpers.py 9.44 9.43 -0.01 🔴
tests/test_query.py 9.35 9.35 0.00
tests/test_streams.py 9.09 9.09 0.00
tests/contrib/test_playlist.py 9.09 9.09 0.00

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

File Function Complexity Length Overall Recommendation
pytube/query.py StreamQuery.filter 22 236.81 3.79 Split out functionality
pytube/main.py YouTube.descramble 17 225.84 4.31 Split out functionality
pytube/cli.py ffmpeg_process 11 160.82 5.59 Split out functionality
pytube/extract.py apply_descrambler 5 210.59 5.59 Split out functionality
tests/test_query.py test_filters 0 151.31 6.80 Split out functionality

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 via email or our Gitter!