Skip to content

Sourcery refactored main branch - #1

Open
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main
Open

Sourcery refactored main branch#1
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main

Conversation

@sourcery-ai

@sourcery-ai sourcery-ai Bot commented Feb 14, 2023

Copy link
Copy Markdown

Branch main 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 main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai
sourcery-ai Bot requested a review from styluxlive February 14, 2023 21:10

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

Comment thread pipenv/core.py
Comment on lines -119 to -120
if e.errno == errno.ENOENT:
pass

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function do_clear refactored with the following changes:

Comment thread pipenv/core.py
Comment on lines -151 to +149
with open(r) as f:
contents = f.read()
contents = Path(r).read_text()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function import_requirements refactored with the following changes:

Comment thread pipenv/core.py
Comment on lines -209 to +211
if os.name != "nt":
if "LANG" not in os.environ:
click.echo(
"{}: the environment variable {} is not set!"
"\nWe recommend setting this in {} (or equivalent) for "
"proper expected behavior.".format(
click.style("Warning", fg="red", bold=True),
click.style("LANG", bold=True),
click.style("~/.profile", fg="green"),
),
err=True,
)
if os.name != "nt" and "LANG" not in os.environ:
click.echo(
"{}: the environment variable {} is not set!"
"\nWe recommend setting this in {} (or equivalent) for "
"proper expected behavior.".format(
click.style("Warning", fg="red", bold=True),
click.style("LANG", bold=True),
click.style("~/.profile", fg="green"),
),
err=True,
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ensure_environment refactored with the following changes:

Comment thread pipenv/core.py
Comment on lines -228 to +221
project._which("python")
if not (project.s.USING_DEFAULT_PYTHON or system)
else None
None
if (project.s.USING_DEFAULT_PYTHON or system)
else project._which("python")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ensure_pipfile refactored with the following changes:

This removes the following comments ( why? ):

# Write changes out to disk.

Comment thread pipenv/core.py
Comment on lines -313 to +302
python_entry = find_python(finder, line)
return python_entry
return find_python(finder, line)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function find_a_system_python refactored with the following changes:

Comment thread pipenv/core.py
Comment on lines -1622 to +1594
if not allow_global:
src_dir = os.getenv(
"PIP_SRC", os.getenv("PIP_SRC_DIR", project.virtualenv_src_location)
src_dir = (
os.getenv("PIP_SRC", os.getenv("PIP_SRC_DIR"))
if allow_global
else os.getenv(
"PIP_SRC",
os.getenv("PIP_SRC_DIR", project.virtualenv_src_location),
)
else:
src_dir = os.getenv("PIP_SRC", os.getenv("PIP_SRC_DIR"))
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function pip_install_deps refactored with the following changes:

Comment thread pipenv/core.py
Comment on lines -1813 to +1779
result = find_python(finder, command)
if result:
if result := find_python(finder, command):
return result
result = finder.which(command)
if result:
return result.path.as_posix()
return ""
return result.path.as_posix() if (result := finder.which(command)) else ""

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function fallback_which refactored with the following changes:

Comment thread pipenv/environment.py
super().__init__()
self._modules = {"pkg_resources": pkg_resources, "pipenv": pipenv}
self.base_working_set = base_working_set if base_working_set else BASE_WORKING_SET
self.base_working_set = base_working_set or BASE_WORKING_SET

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.__init__ refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -89 to +96
dist = next(
iter(dist for dist in self.base_working_set if dist.project_name == name),
if dist := next(
iter(
dist
for dist in self.base_working_set
if dist.project_name == name
),
None,
)
if dist:
):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.safe_import refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -112 to +115
deps = set()
deps.add(dist)
deps = {dist}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.resolve_dist refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -143 to +145
py_version = sysconfig.get_python_version()
return py_version
return sysconfig.get_python_version()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.python_version refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -154 to -161
include_dirs = self.get_include_path()
if include_dirs:
include_path = include_dirs.get(
if include_dirs := self.get_include_path():
if include_path := include_dirs.get(
"include", include_dirs.get("platinclude")
)
if not include_path:
):
include_dir = Path(include_path)
else:
return {}
include_dir = Path(include_path)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.python_info refactored with the following changes:

Comment thread pipenv/environment.py
lib_dirs = purelib
else:
lib_dirs = purelib + os.pathsep + platlib
lib_dirs = purelib if purelib == platlib else purelib + os.pathsep + platlib

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.base_paths refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -350 to +355
for key in ("purelib", "platlib", "stdlib", "platstdlib"):
pylib_lines.append(
f"u'{key}': u'{{0}}'.format({sysconfig_line.format(key)})"
)
pylib_lines.extend(
f"u'{key}': u'{{0}}'.format({sysconfig_line.format(key)})"
for key in ("purelib", "platlib", "stdlib", "platstdlib")
)
if python_inc:
for key in ("include", "platinclude"):
pyinc_lines.append(
f"u'{key}': u'{{0}}'.format({sysconfig_line.format(key)})"
)
pyinc_lines.extend(
f"u'{key}': u'{{0}}'.format({sysconfig_line.format(key)})"
for key in ("include", "platinclude")
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.build_command refactored with the following changes:

Comment thread pipenv/environment.py
Comment on lines -486 to +483
sys_prefix = Path(c.stdout.strip()).as_posix()
return sys_prefix
return Path(c.stdout.strip()).as_posix()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Environment.sys_prefix refactored with the following changes:

Comment thread pipenv/environments.py
Comment on lines -408 to +411
if getattr(sys, "real_prefix", None) is not None:
# virtualenv venvs
result = True
else:
# PEP 405 venvs
result = sys.prefix != getattr(sys, "base_prefix", sys.prefix)
return result
return (
True
if getattr(sys, "real_prefix", None) is not None
else sys.prefix != getattr(sys, "base_prefix", sys.prefix)
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function is_using_venv refactored with the following changes:

This removes the following comments ( why? ):

# virtualenv venvs
# PEP 405 venvs

Comment thread pipenv/environments.py
Comment on lines -428 to +425
return virtual_env and not (pipenv_active or ignore_virtualenvs)
return virtual_env and not pipenv_active and not ignore_virtualenvs

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function is_in_virtualenv refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

Comment thread pipenv/environments.py
Comment on lines -431 to +429
PIPENV_SPINNER_FAIL_TEXT = "{0}" if not PIPENV_HIDE_EMOJIS else "{0}"
PIPENV_SPINNER_OK_TEXT = "{0}" if not PIPENV_HIDE_EMOJIS else "{0}"
PIPENV_SPINNER_FAIL_TEXT = "{0}" if PIPENV_HIDE_EMOJIS else "{0}"
PIPENV_SPINNER_OK_TEXT = "{0}" if PIPENV_HIDE_EMOJIS else "{0}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 431-432 refactored with the following changes:

Comment thread pipenv/exceptions.py
line = f" {line}"
else:
line = f" {line}"
line = f" {line}" if line.startswith("File") else f" {line}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function handle_exception refactored with the following changes:

Comment thread pipenv/exceptions.py
Comment on lines -103 to +102
click.echo(
"{} {}".format("OUTPUT: ", self.out),
file=file,
err=True,
)
click.echo(f"OUTPUT: {self.out}", file=file, err=True)
if self.err:
click.echo(
"{} {}".format("STDERR: ", self.err),
file=file,
err=True,
)
click.echo(f"STDERR: {self.err}", file=file, err=True)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PipenvCmdError.show refactored with the following changes:

Comment thread pipenv/exceptions.py
Comment on lines -154 to +143
color = None
if self.ctx is not None:
color = self.ctx.color
color = self.ctx.color if self.ctx is not None else None

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PipenvUsageError.show refactored with the following changes:

Comment thread pipenv/exceptions.py
Comment on lines -439 to +427
search_string = exc.match_string if exc.match_string else exc.exception_name
split_string = (
exc.show_from_string if exc.show_from_string else exc.exception_name
)
search_string = exc.match_string or exc.exception_name
split_string = exc.show_from_string or exc.exception_name

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function prettify_exc refactored with the following changes:

Comment thread pipenv/installers.py
Comment on lines -31 to +33
major = int(match.group(1))
minor = int(match.group(2))
patch = match.group(3)
major = int(match[1])
minor = int(match[2])
patch = match[3]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Version.parse refactored with the following changes:

Comment thread pipenv/installers.py
Comment on lines -226 to -232
c = self._run(
return self._run(
"install",
"python",
str(version),
timeout=self.project.s.PIPENV_INSTALL_TIMEOUT,
)
return c

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Asdf.install refactored with the following changes:

Comment thread pipenv/project.py
if isinstance(f.newlines, str):
return f.newlines
return DEFAULT_NEWLINES
return f.newlines if isinstance(f.newlines, str) else DEFAULT_NEWLINES

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function preferred_newlines refactored with the following changes:

Comment thread pipenv/project.py
Comment on lines -719 to +707
lockfile_dict = {}
categories = self.get_package_categories(for_lockfile=True)
_lockfile = self._lockfile(categories=categories)
for category in categories:
lockfile_dict[category] = _lockfile.get(category, {}).copy()
lockfile_dict.update({"_meta": self.get_lockfile_meta()})
lockfile_dict = {
category: _lockfile.get(category, {}).copy()
for category in categories
}
lockfile_dict["_meta"] = self.get_lockfile_meta()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Project.get_or_create_lockfile refactored with the following changes:

Comment thread pipenv/project.py
Comment on lines -834 to +820
if self.lockfile_exists and hasattr(self.lockfile_content, "keys"):
meta_ = self.lockfile_content.get("_meta", {})
sources_ = meta_.get("sources")
if sources_:
return sources_

else:
if not self.lockfile_exists or not hasattr(self.lockfile_content, "keys"):
return self.pipfile_sources()
meta_ = self.lockfile_content.get("_meta", {})
if sources_ := meta_.get("sources"):
return sources_

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Project.sources refactored with the following changes:

Comment thread pipenv/project.py
Comment on lines -903 to +885
for name in section.keys():
if pep423_name(name) == package_name:
return name
return None
return next(
(name for name in section.keys() if pep423_name(name) == package_name),
None,
)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Project.get_package_name_in_pipfile refactored with the following changes:

  • Use the built-in function next instead of a for-loop (use-next)

Comment thread pipenv/project.py
Comment on lines -909 to +891
# Read and append Pipfile.
name = self.get_package_name_in_pipfile(package_name, category=category)
p = self.parsed_pipfile
if name:
if name := self.get_package_name_in_pipfile(
package_name, category=category
):
p = self.parsed_pipfile

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Project.remove_package_from_pipfile refactored with the following changes:

This removes the following comments ( why? ):

# Read and append Pipfile.

Comment thread pipenv/project.py
Comment on lines -920 to +904
packages = set([pep423_name(pkg) for pkg in packages])
packages = {pep423_name(pkg) for pkg in packages}
for category in self.get_package_categories():
pipfile_section = parsed.get(category, {})
pipfile_packages = set(
[pep423_name(pkg_name) for pkg_name in pipfile_section.keys()]
)
pipfile_packages = {
pep423_name(pkg_name) for pkg_name in pipfile_section.keys()
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Project.remove_packages_from_pipfile refactored with the following changes:

@sourcery-ai

sourcery-ai Bot commented Feb 14, 2023

Copy link
Copy Markdown
Author

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 10.82 🙂 10.56 🙂 -0.26 👍
Method Length 64.83 🙂 64.55 🙂 -0.28 👍
Working memory 7.60 🙂 7.69 🙂 0.09 👎
Quality 64.79% 🙂 64.74% 🙂 -0.05% 👎
Other metrics Before After Change
Lines 36504 35906 -598
Changed files Quality Before Quality After Quality Change
pipenv/core.py 26.58% 😞 26.66% 😞 0.08% 👍
pipenv/environment.py 64.85% 🙂 64.70% 🙂 -0.15% 👎
pipenv/environments.py 48.76% 😞 48.46% 😞 -0.30% 👎
pipenv/exceptions.py 70.13% 🙂 70.91% 🙂 0.78% 👍
pipenv/installers.py 86.94% ⭐ 87.04% ⭐ 0.10% 👍
pipenv/project.py 72.72% 🙂 72.96% 🙂 0.24% 👍
pipenv/resolver.py 63.03% 🙂 63.15% 🙂 0.12% 👍
pipenv/shells.py 81.12% ⭐ 80.57% ⭐ -0.55% 👎
pipenv/cli/command.py 40.59% 😞 40.29% 😞 -0.30% 👎
pipenv/cli/options.py 86.92% ⭐ 86.85% ⭐ -0.07% 👎
pipenv/patched/pip/__pip-runner__.py 90.58% ⭐ 88.51% ⭐ -2.07% 👎
pipenv/patched/pip/_internal/build_env.py 67.80% 🙂 67.48% 🙂 -0.32% 👎
pipenv/patched/pip/_internal/cache.py 78.41% ⭐ 78.49% ⭐ 0.08% 👍
pipenv/patched/pip/_internal/configuration.py 79.37% ⭐ 79.08% ⭐ -0.29% 👎
pipenv/patched/pip/_internal/exceptions.py 80.65% ⭐ 80.81% ⭐ 0.16% 👍
pipenv/patched/pip/_internal/pyproject.py 43.52% 😞 43.13% 😞 -0.39% 👎
pipenv/patched/pip/_internal/self_outdated_check.py 77.60% ⭐ 77.38% ⭐ -0.22% 👎
pipenv/patched/pip/_internal/wheel_builder.py 62.78% 🙂 62.92% 🙂 0.14% 👍
pipenv/patched/pip/_internal/cli/autocompletion.py 22.75% ⛔ 24.86% ⛔ 2.11% 👍
pipenv/patched/pip/_internal/cli/base_command.py 36.38% 😞 37.48% 😞 1.10% 👍
pipenv/patched/pip/_internal/cli/cmdoptions.py 83.34% ⭐ 82.94% ⭐ -0.40% 👎
pipenv/patched/pip/_internal/cli/main_parser.py 51.56% 🙂 52.42% 🙂 0.86% 👍
pipenv/patched/pip/_internal/cli/parser.py 67.63% 🙂 66.61% 🙂 -1.02% 👎
pipenv/patched/pip/_internal/cli/req_command.py 67.10% 🙂 66.85% 🙂 -0.25% 👎
pipenv/patched/pip/_internal/commands/__init__.py 83.57% ⭐ 83.61% ⭐ 0.04% 👍
pipenv/patched/pip/_internal/commands/cache.py 79.10% ⭐ 79.01% ⭐ -0.09% 👎
pipenv/patched/pip/_internal/commands/check.py 65.13% 🙂 66.01% 🙂 0.88% 👍
pipenv/patched/pip/_internal/commands/completion.py 77.98% ⭐ 78.53% ⭐ 0.55% 👍
pipenv/patched/pip/_internal/commands/configuration.py 78.36% ⭐ 78.01% ⭐ -0.35% 👎
pipenv/patched/pip/_internal/commands/debug.py 80.28% ⭐ 79.84% ⭐ -0.44% 👎
pipenv/patched/pip/_internal/commands/freeze.py 80.98% ⭐ 79.83% ⭐ -1.15% 👎
pipenv/patched/pip/_internal/commands/hash.py 89.42% ⭐ 89.01% ⭐ -0.41% 👎
pipenv/patched/pip/_internal/commands/index.py 74.60% 🙂 74.64% 🙂 0.04% 👍
pipenv/patched/pip/_internal/commands/install.py 38.93% 😞 38.99% 😞 0.06% 👍
pipenv/patched/pip/_internal/commands/list.py 62.88% 🙂 64.89% 🙂 2.01% 👍
pipenv/patched/pip/_internal/commands/search.py 68.48% 🙂 68.37% 🙂 -0.11% 👎
pipenv/patched/pip/_internal/commands/show.py 57.91% 🙂 57.85% 🙂 -0.06% 👎
pipenv/patched/pip/_internal/commands/uninstall.py 57.09% 🙂 57.42% 🙂 0.33% 👍
pipenv/patched/pip/_internal/index/collector.py 75.27% ⭐ 74.96% 🙂 -0.31% 👎
pipenv/patched/pip/_internal/index/package_finder.py 62.87% 🙂 62.71% 🙂 -0.16% 👎
pipenv/patched/pip/_internal/locations/__init__.py 64.92% 🙂 63.91% 🙂 -1.01% 👎
pipenv/patched/pip/_internal/locations/_distutils.py 48.91% 😞 50.05% 🙂 1.14% 👍
pipenv/patched/pip/_internal/locations/_sysconfig.py 71.32% 🙂 70.63% 🙂 -0.69% 👎
pipenv/patched/pip/_internal/locations/base.py 80.99% ⭐ 82.82% ⭐ 1.83% 👍
pipenv/patched/pip/_internal/metadata/__init__.py 93.13% ⭐ 93.20% ⭐ 0.07% 👍
pipenv/patched/pip/_internal/metadata/_json.py 39.11% 😞 41.18% 😞 2.07% 👍
pipenv/patched/pip/_internal/metadata/base.py 86.75% ⭐ 86.17% ⭐ -0.58% 👎
pipenv/patched/pip/_internal/metadata/pkg_resources.py 84.97% ⭐ 84.66% ⭐ -0.31% 👎
pipenv/patched/pip/_internal/metadata/importlib/_dists.py 86.64% ⭐ 86.00% ⭐ -0.64% 👎
pipenv/patched/pip/_internal/metadata/importlib/_envs.py 81.95% ⭐ 81.25% ⭐ -0.70% 👎
pipenv/patched/pip/_internal/models/direct_url.py 88.65% ⭐ 89.04% ⭐ 0.39% 👍
pipenv/patched/pip/_internal/models/format_control.py 79.81% ⭐ 79.43% ⭐ -0.38% 👎
pipenv/patched/pip/_internal/models/link.py 82.59% ⭐ 82.57% ⭐ -0.02% 👎
pipenv/patched/pip/_internal/models/search_scope.py 63.64% 🙂 63.68% 🙂 0.04% 👍
pipenv/patched/pip/_internal/network/auth.py 70.85% 🙂 71.02% 🙂 0.17% 👍
pipenv/patched/pip/_internal/network/download.py 70.20% 🙂 70.34% 🙂 0.14% 👍
pipenv/patched/pip/_internal/network/session.py 55.01% 🙂 55.60% 🙂 0.59% 👍
pipenv/patched/pip/_internal/network/utils.py 71.78% 🙂 71.07% 🙂 -0.71% 👎
pipenv/patched/pip/_internal/operations/freeze.py 44.13% 😞 42.37% 😞 -1.76% 👎
pipenv/patched/pip/_internal/operations/prepare.py 70.21% 🙂 70.07% 🙂 -0.14% 👎
pipenv/patched/pip/_internal/operations/build/build_tracker.py 81.93% ⭐ 81.93% ⭐ 0.00%
pipenv/patched/pip/_internal/operations/build/metadata_legacy.py 77.65% ⭐ 77.72% ⭐ 0.07% 👍
pipenv/patched/pip/_internal/operations/build/wheel_legacy.py 71.77% 🙂 71.94% 🙂 0.17% 👍
pipenv/patched/pip/_internal/operations/install/wheel.py 40.57% 😞 40.12% 😞 -0.45% 👎
pipenv/patched/pip/_internal/req/constructors.py 52.19% 🙂 53.29% 🙂 1.10% 👍
pipenv/patched/pip/_internal/req/req_file.py 63.78% 🙂 63.97% 🙂 0.19% 👍
pipenv/patched/pip/_internal/req/req_install.py 63.41% 🙂 62.76% 🙂 -0.65% 👎
pipenv/patched/pip/_internal/req/req_uninstall.py 56.96% 🙂 57.18% 🙂 0.22% 👍
pipenv/patched/pip/_internal/resolution/legacy/resolver.py 57.72% 🙂 57.57% 🙂 -0.15% 👎
pipenv/patched/pip/_internal/resolution/resolvelib/base.py 93.12% ⭐ 92.91% ⭐ -0.21% 👎
pipenv/patched/pip/_internal/resolution/resolvelib/candidates.py 83.66% ⭐ 83.38% ⭐ -0.28% 👎
pipenv/patched/pip/_internal/resolution/resolvelib/factory.py 50.41% 🙂 50.30% 🙂 -0.11% 👎
pipenv/patched/pip/_internal/resolution/resolvelib/found_candidates.py 83.93% ⭐ 83.98% ⭐ 0.05% 👍
pipenv/patched/pip/_internal/resolution/resolvelib/provider.py 71.48% 🙂 71.19% 🙂 -0.29% 👎
pipenv/patched/pip/_internal/resolution/resolvelib/requirements.py 95.78% ⭐ 95.82% ⭐ 0.04% 👍
pipenv/patched/pip/_internal/utils/compat.py 84.11% ⭐ 85.64% ⭐ 1.53% 👍
pipenv/patched/pip/_internal/utils/compatibility_tags.py 79.74% ⭐ 80.82% ⭐ 1.08% 👍
pipenv/patched/pip/_internal/utils/deprecation.py 78.53% ⭐ 80.09% ⭐ 1.56% 👍
pipenv/patched/pip/_internal/utils/direct_url_helpers.py 65.24% 🙂 61.42% 🙂 -3.82% 👎
pipenv/patched/pip/_internal/utils/encoding.py 63.57% 🙂 63.69% 🙂 0.12% 👍
pipenv/patched/pip/_internal/utils/filesystem.py 78.21% ⭐ 78.59% ⭐ 0.38% 👍
pipenv/patched/pip/_internal/utils/filetypes.py 88.77% ⭐ 88.81% ⭐ 0.04% 👍
pipenv/patched/pip/_internal/utils/glibc.py 90.58% ⭐ 90.02% ⭐ -0.56% 👎
pipenv/patched/pip/_internal/utils/hashes.py 83.70% ⭐ 83.45% ⭐ -0.25% 👎
pipenv/patched/pip/_internal/utils/logging.py 70.11% 🙂 68.82% 🙂 -1.29% 👎
pipenv/patched/pip/_internal/utils/misc.py 87.30% ⭐ 87.20% ⭐ -0.10% 👎
pipenv/patched/pip/_internal/utils/models.py 96.51% ⭐ 96.97% ⭐ 0.46% 👍
pipenv/patched/pip/_internal/utils/setuptools_build.py 71.51% 🙂 72.56% 🙂 1.05% 👍
pipenv/patched/pip/_internal/utils/subprocess.py 26.75% 😞 27.15% 😞 0.40% 👍
pipenv/patched/pip/_internal/utils/temp_dir.py 82.77% ⭐ 83.24% ⭐ 0.47% 👍
pipenv/patched/pip/_internal/utils/urls.py 72.12% 🙂 68.12% 🙂 -4.00% 👎
pipenv/patched/pip/_internal/utils/wheel.py 83.24% ⭐ 82.84% ⭐ -0.40% 👎
pipenv/patched/pip/_internal/vcs/bazaar.py 79.07% ⭐ 79.55% ⭐ 0.48% 👍
pipenv/patched/pip/_internal/vcs/git.py 72.90% 🙂 72.13% 🙂 -0.77% 👎
pipenv/patched/pip/_internal/vcs/mercurial.py 80.59% ⭐ 80.46% ⭐ -0.13% 👎
pipenv/patched/pip/_internal/vcs/subversion.py 72.77% 🙂 73.05% 🙂 0.28% 👍
pipenv/patched/pip/_internal/vcs/versioncontrol.py 77.04% ⭐ 76.34% ⭐ -0.70% 👎
pipenv/patched/pip/_vendor/six.py 75.34% ⭐ 75.36% ⭐ 0.02% 👍
pipenv/patched/pip/_vendor/typing_extensions.py 72.85% 🙂 72.83% 🙂 -0.02% 👎
pipenv/patched/pip/_vendor/cachecontrol/adapter.py 50.63% 🙂 50.27% 🙂 -0.36% 👎
pipenv/patched/pip/_vendor/cachecontrol/controller.py 38.96% 😞 39.19% 😞 0.23% 👍
pipenv/patched/pip/_vendor/cachecontrol/heuristics.py 81.28% ⭐ 80.61% ⭐ -0.67% 👎
pipenv/patched/pip/_vendor/cachecontrol/serialize.py 70.23% 🙂 71.13% 🙂 0.90% 👍
pipenv/patched/pip/_vendor/cachecontrol/caches/file_cache.py 82.93% ⭐ 82.91% ⭐ -0.02% 👎
pipenv/patched/pip/_vendor/chardet/__init__.py 41.88% 😞 42.21% 😞 0.33% 👍
pipenv/patched/pip/_vendor/chardet/chardistribution.py 88.07% ⭐ 88.55% ⭐ 0.48% 👍
pipenv/patched/pip/_vendor/chardet/charsetgroupprober.py 76.72% ⭐ 75.68% ⭐ -1.04% 👎
pipenv/patched/pip/_vendor/chardet/eucjpprober.py 63.79% 🙂 65.35% 🙂 1.56% 👍
pipenv/patched/pip/_vendor/chardet/hebrewprober.py 79.41% ⭐ 80.58% ⭐ 1.17% 👍
pipenv/patched/pip/_vendor/chardet/mbcharsetprober.py 62.82% 🙂 64.43% 🙂 1.61% 👍
pipenv/patched/pip/_vendor/chardet/sbcharsetprober.py 63.44% 🙂 66.69% 🙂 3.25% 👍
pipenv/patched/pip/_vendor/chardet/sjisprober.py 63.39% 🙂 64.95% 🙂 1.56% 👍
pipenv/patched/pip/_vendor/chardet/universaldetector.py 34.69% 😞 36.00% 😞 1.31% 👍
pipenv/patched/pip/_vendor/chardet/utf1632prober.py 76.54% ⭐ 77.55% ⭐ 1.01% 👍
pipenv/patched/pip/_vendor/chardet/utf8prober.py 78.85% ⭐ 81.18% ⭐ 2.33% 👍
pipenv/patched/pip/_vendor/colorama/ansi.py 67.03% 🙂 67.02% 🙂 -0.01% 👎
pipenv/patched/pip/_vendor/colorama/ansitowin32.py 72.16% 🙂 72.48% 🙂 0.32% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
pipenv/core.py do_install 120 ⛔ 1323 ⛔ 28 ⛔ 1.25% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pipenv/core.py do_graph 57 ⛔ 585 ⛔ 3.48% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
pipenv/core.py pip_install_deps 57 ⛔ 645 ⛔ 23 ⛔ 4.84% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
pipenv/core.py ensure_python 50 ⛔ 548 ⛔ 5.20% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
pipenv/core.py do_check 59 ⛔ 1000 ⛔ 21 ⛔ 5.43% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

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