Skip to content

Sourcery refactored master branch #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Dec 23, 2022

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!

@sourcery-ai sourcery-ai bot requested a review from Vad1mo December 23, 2022 16:23
@sourcery-ai
Copy link
Author

sourcery-ai bot commented Dec 23, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.10%.

Quality metrics Before After Change
Complexity 10.53 🙂 10.00 🙂 -0.53 👍
Method Length 60.03 ⭐ 59.85 ⭐ -0.18 👍
Working memory 6.85 🙂 6.96 🙂 0.11 👎
Quality 65.48% 🙂 65.58% 🙂 0.10% 👍
Other metrics Before After Change
Lines 38384 37659 -725
Changed files Quality Before Quality After Quality Change
strip-harbor/sync/MailerSendNewApiClientAPI.py 64.75% 🙂 64.77% 🙂 0.02% 👍
strip-harbor/sync/harbor.py 89.21% ⭐ 88.75% ⭐ -0.46% 👎
strip-harbor/sync/views.py 80.73% ⭐ 80.82% ⭐ 0.09% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/build_env.py 65.96% 🙂 66.02% 🙂 0.06% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cache.py 78.87% ⭐ 79.00% ⭐ 0.13% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/configuration.py 79.36% ⭐ 78.97% ⭐ -0.39% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/exceptions.py 89.91% ⭐ 89.44% ⭐ -0.47% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/locations.py 56.09% 🙂 57.15% 🙂 1.06% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/pyproject.py 46.62% 😞 46.23% 😞 -0.39% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/self_outdated_check.py 64.72% 🙂 63.28% 🙂 -1.44% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/wheel_builder.py 69.99% 🙂 70.33% 🙂 0.34% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py 24.07% ⛔ 28.78% 😞 4.71% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py 52.75% 🙂 53.94% 🙂 1.19% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py 83.84% ⭐ 83.42% ⭐ -0.42% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/parser.py 68.76% 🙂 67.77% 🙂 -0.99% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/progress_bars.py 88.59% ⭐ 88.14% ⭐ -0.45% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/cli/req_command.py 67.12% 🙂 66.42% 🙂 -0.70% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/__init__.py 82.00% ⭐ 81.79% ⭐ -0.21% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/cache.py 80.19% ⭐ 80.15% ⭐ -0.04% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/check.py 66.07% 🙂 66.90% 🙂 0.83% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/completion.py 78.92% ⭐ 79.53% ⭐ 0.61% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/configuration.py 79.37% ⭐ 79.03% ⭐ -0.34% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/debug.py 80.68% ⭐ 80.26% ⭐ -0.42% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/freeze.py 78.10% ⭐ 77.03% ⭐ -1.07% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/hash.py 88.95% ⭐ 88.56% ⭐ -0.39% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/install.py 44.61% 😞 44.61% 😞 0.00%
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/list.py 66.53% 🙂 67.15% 🙂 0.62% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/search.py 59.14% 🙂 57.95% 🙂 -1.19% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/show.py 33.91% 😞 32.57% 😞 -1.34% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/commands/uninstall.py 62.65% 🙂 63.02% 🙂 0.37% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/distributions/sdist.py 66.31% 🙂 65.34% 🙂 -0.97% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/index/collector.py 71.29% 🙂 71.98% 🙂 0.69% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/index/package_finder.py 64.29% 🙂 63.92% 🙂 -0.37% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/direct_url.py 88.83% ⭐ 89.08% ⭐ 0.25% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/format_control.py 80.00% ⭐ 79.64% ⭐ -0.36% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/link.py 90.46% ⭐ 89.66% ⭐ -0.80% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/models/search_scope.py 65.23% 🙂 65.23% 🙂 0.00%
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/network/auth.py 65.68% 🙂 65.68% 🙂 0.00%
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/network/download.py 70.39% 🙂 71.04% 🙂 0.65% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/network/session.py 55.52% 🙂 55.26% 🙂 -0.26% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/network/utils.py 75.17% ⭐ 71.89% 🙂 -3.28% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/check.py 65.14% 🙂 65.16% 🙂 0.02% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/freeze.py 40.87% 😞 38.91% 😞 -1.96% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/prepare.py 72.75% 🙂 72.45% 🙂 -0.30% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py 39.44% 😞 38.87% 😞 -0.57% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/constructors.py 50.14% 🙂 50.29% 🙂 0.15% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/req_file.py 64.48% 🙂 64.84% 🙂 0.36% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/req_install.py 64.06% 🙂 63.87% 🙂 -0.19% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/req_set.py 62.20% 🙂 61.45% 🙂 -0.75% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/req_tracker.py 81.78% ⭐ 81.78% ⭐ 0.00%
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.py 60.26% 🙂 59.74% 🙂 -0.52% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/base.py 95.59% ⭐ 95.34% ⭐ -0.25% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py 84.99% ⭐ 84.87% ⭐ -0.12% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py 51.35% 🙂 51.74% 🙂 0.39% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py 87.46% ⭐ 86.93% ⭐ -0.53% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/provider.py 74.40% 🙂 75.13% ⭐ 0.73% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/requirements.py 95.89% ⭐ 95.93% ⭐ 0.04% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py 34.00% 😞 33.27% 😞 -0.73% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/compat.py 77.38% ⭐ 78.35% ⭐ 0.97% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/compatibility_tags.py 79.60% ⭐ 80.48% ⭐ 0.88% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/deprecation.py 81.24% ⭐ 83.88% ⭐ 2.64% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/direct_url_helpers.py 67.98% 🙂 65.05% 🙂 -2.93% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/distutils_args.py 86.35% ⭐ 86.71% ⭐ 0.36% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/encoding.py 63.97% 🙂 64.08% 🙂 0.11% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/filesystem.py 79.02% ⭐ 79.35% ⭐ 0.33% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/filetypes.py 87.21% ⭐ 86.94% ⭐ -0.27% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/glibc.py 90.68% ⭐ 90.14% ⭐ -0.54% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/hashes.py 84.38% ⭐ 84.22% ⭐ -0.16% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/logging.py 77.63% ⭐ 77.28% ⭐ -0.35% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/misc.py 85.09% ⭐ 84.82% ⭐ -0.27% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/models.py 96.51% ⭐ 96.97% ⭐ 0.46% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/setuptools_build.py 71.80% 🙂 72.85% 🙂 1.05% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/subprocess.py 30.96% 😞 31.07% 😞 0.11% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py 82.17% ⭐ 82.60% ⭐ 0.43% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/urls.py 82.76% ⭐ 80.61% ⭐ -2.15% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/utils/wheel.py 81.46% ⭐ 81.02% ⭐ -0.44% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/vcs/bazaar.py 83.47% ⭐ 84.19% ⭐ 0.72% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/vcs/git.py 76.15% ⭐ 75.52% ⭐ -0.63% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/vcs/mercurial.py 83.54% ⭐ 83.58% ⭐ 0.04% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/vcs/subversion.py 74.11% 🙂 74.47% 🙂 0.36% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/vcs/versioncontrol.py 77.67% ⭐ 77.00% ⭐ -0.67% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/appdirs.py 62.50% 🙂 63.17% 🙂 0.67% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/contextlib2.py 86.11% ⭐ 86.03% ⭐ -0.08% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distro.py 77.14% ⭐ 77.18% ⭐ 0.04% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/pyparsing.py 63.42% 🙂 63.75% 🙂 0.33% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/retrying.py 58.41% 🙂 58.25% 🙂 -0.16% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/six.py 74.84% 🙂 74.86% 🙂 0.02% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/adapter.py 50.74% 🙂 50.39% 🙂 -0.35% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/controller.py 43.21% 😞 43.06% 😞 -0.15% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/heuristics.py 81.28% ⭐ 80.61% ⭐ -0.67% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/cachecontrol/serialize.py 72.88% 🙂 73.39% 🙂 0.51% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/__init__.py 53.77% 🙂 56.71% 🙂 2.94% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/chardistribution.py 87.14% ⭐ 87.91% ⭐ 0.77% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/charsetgroupprober.py 74.41% 🙂 73.28% 🙂 -1.13% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/escprober.py 74.48% 🙂 73.47% 🙂 -1.01% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/eucjpprober.py 65.90% 🙂 67.52% 🙂 1.62% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/hebrewprober.py 80.25% ⭐ 81.47% ⭐ 1.22% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/latin1prober.py 75.80% ⭐ 76.16% ⭐ 0.36% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/mbcharsetprober.py 68.48% 🙂 70.05% 🙂 1.57% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/sbcharsetprober.py 61.96% 🙂 64.28% 🙂 2.32% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/sjisprober.py 65.49% 🙂 67.12% 🙂 1.63% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/universaldetector.py 33.90% 😞 35.18% 😞 1.28% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/utf8prober.py 78.84% ⭐ 80.58% ⭐ 1.74% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/chardet/cli/chardetect.py 77.78% ⭐ 76.31% ⭐ -1.47% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/colorama/ansi.py 67.03% 🙂 67.02% 🙂 -0.01% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/colorama/ansitowin32.py 72.41% 🙂 72.76% 🙂 0.35% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/colorama/winterm.py 78.47% ⭐ 78.96% ⭐ 0.49% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/compat.py 72.01% 🙂 72.32% 🙂 0.31% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/database.py 60.73% 🙂 60.91% 🙂 0.18% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/index.py 64.88% 🙂 64.59% 🙂 -0.29% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/locators.py 52.63% 🙂 53.24% 🙂 0.61% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/manifest.py 53.97% 🙂 55.40% 🙂 1.43% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/markers.py 67.61% 🙂 67.96% 🙂 0.35% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/metadata.py 52.94% 🙂 53.72% 🙂 0.78% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/resources.py 79.09% ⭐ 79.60% ⭐ 0.51% 👍
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/scripts.py 52.57% 🙂 52.02% 🙂 -0.55% 👎
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/util.py 57.79% 🙂 57.66% 🙂 -0.13% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/util.py parse_requirement 93 ⛔ 591 ⛔ 0.67% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/pyparsing.py ParserElement._parseNoCache 74 ⛔ 423 ⛔ 20 ⛔ 5.95% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
template/python-waitress/venv/lib/python3.6/site-packages/pip/_internal/operations/install/wheel.py _install_wheel 42 ⛔ 1041 ⛔ 7.45% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/locators.py DependencyFinder.find 65 ⛔ 438 ⛔ 18 ⛔ 7.78% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
template/python-waitress/venv/lib/python3.6/site-packages/pip/_vendor/distlib/util.py parse_marker 46 ⛔ 408 ⛔ 7.79% ⛔ Refactor to reduce nesting. Try splitting into smaller methods

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants