The following issues were found

pipenv/patched/notpip/_internal/utils/subprocess.py
13 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves'
Error

Line: 10 Column: 1

              import os
import subprocess

from pipenv.patched.notpip._vendor.six.moves import shlex_quote

from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display
from pipenv.patched.notpip._internal.utils.logging import subprocess_logger
from pipenv.patched.notpip._internal.utils.misc import HiddenText, path_to_display

            

Reported by Pylint.

Module 'subprocess' has no 'PIPE' member
Error

Line: 189 Column: 45

                      proc = subprocess.Popen(
            # Convert HiddenText objects to the underlying str.
            reveal_command_args(cmd),
            stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, cwd=cwd, env=env,
        )
        proc.stdin.close()
    except Exception as exc:
        if log_failed_cmd:

            

Reported by Pylint.

Module 'subprocess' has no 'STDOUT' member
Error

Line: 189 Column: 20

                      proc = subprocess.Popen(
            # Convert HiddenText objects to the underlying str.
            reveal_command_args(cmd),
            stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, cwd=cwd, env=env,
        )
        proc.stdin.close()
    except Exception as exc:
        if log_failed_cmd:

            

Reported by Pylint.

Module 'subprocess' has no 'PIPE' member
Error

Line: 190 Column: 20

                          # Convert HiddenText objects to the underlying str.
            reveal_command_args(cmd),
            stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
            stdout=subprocess.PIPE, cwd=cwd, env=env,
        )
        proc.stdin.close()
    except Exception as exc:
        if log_failed_cmd:
            subprocess_logger.critical(

            

Reported by Pylint.

Module import itself
Error

Line: 8 Column: 1

              
import logging
import os
import subprocess

from pipenv.patched.notpip._vendor.six.moves import shlex_quote

from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # The following comment should be removed at some point in the future.
# mypy: strict-optional=False

from __future__ import absolute_import

import logging
import os
import subprocess


            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 8
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              
import logging
import os
import subprocess

from pipenv.patched.notpip._vendor.six.moves import shlex_quote

from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display

            

Reported by Bandit.

Too many local variables (23/15)
Error

Line: 117 Column: 1

                  return msg


def call_subprocess(
    cmd,  # type: Union[List[str], CommandArgs]
    show_stdout=False,  # type: bool
    cwd=None,  # type: Optional[str]
    on_returncode='raise',  # type: str
    extra_ok_returncodes=None,  # type: Optional[Iterable[int]]

            

Reported by Pylint.

Too many arguments (10/5)
Error

Line: 117 Column: 1

                  return msg


def call_subprocess(
    cmd,  # type: Union[List[str], CommandArgs]
    show_stdout=False,  # type: bool
    cwd=None,  # type: Optional[str]
    on_returncode='raise',  # type: str
    extra_ok_returncodes=None,  # type: Optional[Iterable[int]]

            

Reported by Pylint.

Too many branches (24/12)
Error

Line: 117 Column: 1

                  return msg


def call_subprocess(
    cmd,  # type: Union[List[str], CommandArgs]
    show_stdout=False,  # type: bool
    cwd=None,  # type: Optional[str]
    on_returncode='raise',  # type: str
    extra_ok_returncodes=None,  # type: Optional[Iterable[int]]

            

Reported by Pylint.

pipenv/patched/notpip/_internal/utils/pkg_resources.py
13 issues
Unused argument 'name'
Error

Line: 34 Column: 30

                      # type: (str) -> Iterable[str]
        return yield_lines(self.get_metadata(name))

    def metadata_isdir(self, name):
        # type: (str) -> bool
        return False

    def metadata_listdir(self, name):
        # type: (str) -> List[str]

            

Reported by Pylint.

Unused argument 'name'
Error

Line: 38 Column: 32

                      # type: (str) -> bool
        return False

    def metadata_listdir(self, name):
        # type: (str) -> List[str]
        return []

    def run_script(self, script_name, namespace):
        # type: (str, str) -> None

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from pipenv.patched.notpip._vendor.pkg_resources import yield_lines
from pipenv.patched.notpip._vendor.six import ensure_str

from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from typing import Dict, Iterable, List



            

Reported by Pylint.

Class 'DictMetadata' inherits from object, can be safely removed from bases in python3
Error

Line: 10 Column: 1

                  from typing import Dict, Iterable, List


class DictMetadata(object):
    """IMetadataProvider that reads metadata files from a dictionary.
    """
    def __init__(self, metadata):
        # type: (Dict[str, bytes]) -> None
        self._metadata = metadata

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 5

                      # type: (Dict[str, bytes]) -> None
        self._metadata = metadata

    def has_metadata(self, name):
        # type: (str) -> bool
        return name in self._metadata

    def get_metadata(self, name):
        # type: (str) -> str

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 5

                      # type: (str) -> bool
        return name in self._metadata

    def get_metadata(self, name):
        # type: (str) -> str
        try:
            return ensure_str(self._metadata[name])
        except UnicodeDecodeError as e:
            # Mirrors handling done in pkg_resources.NullProvider.

            

Reported by Pylint.

Variable name "e" doesn't conform to snake_case naming style
Error

Line: 25 Column: 9

                      # type: (str) -> str
        try:
            return ensure_str(self._metadata[name])
        except UnicodeDecodeError as e:
            # Mirrors handling done in pkg_resources.NullProvider.
            e.reason += " in {} file".format(name)
            raise

    def get_metadata_lines(self, name):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 30 Column: 5

                          e.reason += " in {} file".format(name)
            raise

    def get_metadata_lines(self, name):
        # type: (str) -> Iterable[str]
        return yield_lines(self.get_metadata(name))

    def metadata_isdir(self, name):
        # type: (str) -> bool

            

Reported by Pylint.

Method could be a function
Error

Line: 34 Column: 5

                      # type: (str) -> Iterable[str]
        return yield_lines(self.get_metadata(name))

    def metadata_isdir(self, name):
        # type: (str) -> bool
        return False

    def metadata_listdir(self, name):
        # type: (str) -> List[str]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 5

                      # type: (str) -> Iterable[str]
        return yield_lines(self.get_metadata(name))

    def metadata_isdir(self, name):
        # type: (str) -> bool
        return False

    def metadata_listdir(self, name):
        # type: (str) -> List[str]

            

Reported by Pylint.

pipenv/vendor/iso8601/iso8601.py
13 issues
Undefined variable 'basestring'
Error

Line: 22 Column: 19

              if sys.version_info >= (3, 0, 0):
    _basestring = str
else:
    _basestring = basestring


# Adapted from http://delete.me.uk/2005/03/iso8601.html
ISO8601_REGEX = re.compile(
    r"""

            

Reported by Pylint.

Access to a protected member __offset of a client class
Error

Line: 115 Column: 22

                      def __eq__(self, other):
            if isinstance(other, FixedOffset):
                return (
                    (other.__offset == self.__offset)
                    and
                    (other.__name == self.__name)
                )
            return NotImplemented


            

Reported by Pylint.

Access to a protected member __name of a client class
Error

Line: 117 Column: 22

                              return (
                    (other.__offset == self.__offset)
                    and
                    (other.__name == self.__name)
                )
            return NotImplemented

        def __getinitargs__(self):
            return (self.__offset_hours, self.__offset_minutes, self.__name)

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 214 Column: 9

                          tzinfo=tz,
        )
    except Exception as e:
        raise ParseError(e)

            

Reported by Pylint.

Function name "FixedOffset" doesn't conform to snake_case naming style
Error

Line: 75 Column: 5

              
if sys.version_info >= (3, 2, 0):
    UTC = datetime.timezone.utc
    def FixedOffset(offset_hours, offset_minutes, name):
        return datetime.timezone(
            datetime.timedelta(
                hours=offset_hours, minutes=offset_minutes),
            name)
else:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 75 Column: 5

              
if sys.version_info >= (3, 2, 0):
    UTC = datetime.timezone.utc
    def FixedOffset(offset_hours, offset_minutes, name):
        return datetime.timezone(
            datetime.timedelta(
                hours=offset_hours, minutes=offset_minutes),
            name)
else:

            

Reported by Pylint.

Argument name "d" doesn't conform to snake_case naming style
Error

Line: 137 Column: 1

                          return "<FixedOffset %r %r>" % (self.__name, self.__offset)


def to_int(d, key, default_to_zero=False, default=None, required=True):
    """Pull a value from the dict and convert to int

    :param default_to_zero: If the value is None or empty, treat it as zero
    :param default: If the value is missing in the dict use this default


            

Reported by Pylint.

Either all return statements in a function should return an expression, or none of them should.
Error

Line: 137 Column: 1

                          return "<FixedOffset %r %r>" % (self.__name, self.__offset)


def to_int(d, key, default_to_zero=False, default=None, required=True):
    """Pull a value from the dict and convert to int

    :param default_to_zero: If the value is None or empty, treat it as zero
    :param default: If the value is missing in the dict use this default


            

Reported by Pylint.

Variable name "m" doesn't conform to snake_case naming style
Error

Line: 193 Column: 5

                  """
    if not isinstance(datestring, _basestring):
        raise ParseError("Expecting a string %r" % datestring)
    m = ISO8601_REGEX.match(datestring)
    if not m:
        raise ParseError("Unable to parse date string %r" % datestring)
    groups = m.groupdict()

    tz = parse_timezone(groups, default_timezone=default_timezone)

            

Reported by Pylint.

Variable name "tz" doesn't conform to snake_case naming style
Error

Line: 198 Column: 5

                      raise ParseError("Unable to parse date string %r" % datestring)
    groups = m.groupdict()

    tz = parse_timezone(groups, default_timezone=default_timezone)

    groups["second_fraction"] = int(Decimal("0.%s" % (groups["second_fraction"] or 0)) * Decimal("1000000.0"))

    try:
        return datetime.datetime(

            

Reported by Pylint.

pipenv/vendor/urllib3/util/connection.py
13 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              
from urllib3.exceptions import LocationParseError

from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read


def is_connection_dropped(conn):  # Platform-specific

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from urllib3.exceptions import LocationParseError

from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read


def is_connection_dropped(conn):  # Platform-specific
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              
from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read


def is_connection_dropped(conn):  # Platform-specific
    """
    Returns True if the connection is dropped and should be closed.

            

Reported by Pylint.

Access to a protected member _GLOBAL_DEFAULT_TIMEOUT of a client class
Error

Line: 40 Column: 13

              # discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
    address,
    timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
    source_address=None,
    socket_options=None,
):
    """Connect to *address* and return the socket object.


            

Reported by Pylint.

Unused variable 'canonname'
Error

Line: 74 Column: 30

                      )

    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
        af, socktype, proto, canonname, sa = res
        sock = None
        try:
            sock = socket.socket(af, socktype, proto)

            # If provided, set socket level options before connecting.

            

Reported by Pylint.

Access to a protected member _GLOBAL_DEFAULT_TIMEOUT of a client class
Error

Line: 82 Column: 31

                          # If provided, set socket level options before connecting.
            _set_socket_options(sock, socket_options)

            if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
                sock.settimeout(timeout)
            if source_address:
                sock.bind(source_address)
            sock.connect(sa)
            return sock

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 142 Column: 16

                          sock = socket.socket(socket.AF_INET6)
            sock.bind((host, 0))
            has_ipv6 = True
        except Exception:
            pass

    if sock:
        sock.close()
    return has_ipv6

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

import socket

from urllib3.exceptions import LocationParseError

from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read

            

Reported by Pylint.

Too many local variables (16/15)
Error

Line: 38 Column: 1

              # library test suite. Added to its signature is only `socket_options`.
# One additional modification is that we avoid binding to IPv6 servers
# discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
    address,
    timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
    source_address=None,
    socket_options=None,
):

            

Reported by Pylint.

Variable name "sa" doesn't conform to snake_case naming style
Error

Line: 74 Column: 41

                      )

    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
        af, socktype, proto, canonname, sa = res
        sock = None
        try:
            sock = socket.socket(af, socktype, proto)

            # If provided, set socket level options before connecting.

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/distlib/markers.py
13 issues
Attempted relative import beyond top-level package
Error

Line: 20 Column: 1

              import platform
import re

from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker

__all__ = ['interpret']

def _is_literal(o):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 21 Column: 1

              import re

from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker

__all__ = ['interpret']

def _is_literal(o):
    if not isinstance(o, string_types) or not o:

            

Reported by Pylint.

Unused import re
Error

Line: 18 Column: 1

              import os
import sys
import platform
import re

from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker

__all__ = ['interpret']

            

Reported by Pylint.

Unused urlparse imported from compat
Error

Line: 20 Column: 1

              import platform
import re

from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker

__all__ = ['interpret']

def _is_literal(o):

            

Reported by Pylint.

Unused python_implementation imported from compat
Error

Line: 20 Column: 1

              import platform
import re

from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker

__all__ = ['interpret']

def _is_literal(o):

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 125 Column: 9

                  try:
        expr, rest = parse_marker(marker)
    except Exception as e:
        raise SyntaxError('Unable to interpret marker syntax: %s: %s' % (marker, e))
    if rest and rest[0] != '#':
        raise SyntaxError('unexpected trailing data in marker: %s: %s' % (marker, rest))
    context = dict(DEFAULT_CONTEXT)
    if execution_context:
        context.update(execution_context)

            

Reported by Pylint.

Argument name "o" doesn't conform to snake_case naming style
Error

Line: 25 Column: 1

              
__all__ = ['interpret']

def _is_literal(o):
    if not isinstance(o, string_types) or not o:
        return False
    return o[0] in '\'"'

class Evaluator(object):

            

Reported by Pylint.

Class 'Evaluator' inherits from object, can be safely removed from bases in python3
Error

Line: 30 Column: 1

                      return False
    return o[0] in '\'"'

class Evaluator(object):
    """
    This class is used to evaluate marker expessions.
    """

    operations = {

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 30 Column: 1

                      return False
    return o[0] in '\'"'

class Evaluator(object):
    """
    This class is used to evaluate marker expessions.
    """

    operations = {

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 63
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                                  raise SyntaxError('unknown variable: %s' % expr)
                result = context[expr]
        else:
            assert isinstance(expr, dict)
            op = expr['op']
            if op not in self.operations:
                raise NotImplementedError('op not implemented: %s' % op)
            elhs = expr['lhs']
            erhs = expr['rhs']

            

Reported by Bandit.

pipenv/patched/notpip/_vendor/chardet/mbcsgroupprober.py
13 issues
Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 32 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 33 Column: 1

              from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

              from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 35 Column: 1

              from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 36 Column: 1

              from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 37 Column: 1

              from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):
    def __init__(self, lang_filter=None):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 38 Column: 1

              from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):
    def __init__(self, lang_filter=None):
        super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

pipenv/patched/notpip/_internal/req/req_set.py
13 issues
Unnecessary pass statement
Error

Line: 204 Column: 9

                      if project_name in self.requirements:
            return self.requirements[project_name]

        pass

    def cleanup_files(self):
        # type: () -> None
        """Clean up files, remove builds."""
        logger.debug('Cleaning up...')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # The following comment should be removed at some point in the future.
# mypy: strict-optional=False

from __future__ import absolute_import

import logging
from collections import OrderedDict

from pipenv.patched.notpip._vendor.packaging.utils import canonicalize_name

            

Reported by Pylint.

Class 'RequirementSet' inherits from object, can be safely removed from bases in python3
Error

Line: 25 Column: 1

              logger = logging.getLogger(__name__)


class RequirementSet(object):

    def __init__(self, check_supported_wheels=True, ignore_compatibility=True):
        # type: (bool, bool) -> None
        """Create a RequirementSet.
        """

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 1

              logger = logging.getLogger(__name__)


class RequirementSet(object):

    def __init__(self, check_supported_wheels=True, ignore_compatibility=True):
        # type: (bool, bool) -> None
        """Create a RequirementSet.
        """

            

Reported by Pylint.

Line too long (101/100)
Error

Line: 40 Column: 1

                      self.reqs_to_cleanup = []  # type: List[InstallRequirement]
        if ignore_compatibility:
            self.check_supported_wheels = False
        self.ignore_compatibility = (check_supported_wheels is False or ignore_compatibility is True)

    def __str__(self):
        # type: () -> str
        requirements = sorted(
            (req for req in self.requirements.values() if not req.comes_from),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 64 Column: 5

                          reqs=', '.join(str(req.req) for req in requirements),
        )

    def add_unnamed_requirement(self, install_req):
        # type: (InstallRequirement) -> None
        assert not install_req.name
        self.unnamed_requirements.append(install_req)

    def add_named_requirement(self, install_req):

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 66
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              
    def add_unnamed_requirement(self, install_req):
        # type: (InstallRequirement) -> None
        assert not install_req.name
        self.unnamed_requirements.append(install_req)

    def add_named_requirement(self, install_req):
        # type: (InstallRequirement) -> None
        assert install_req.name

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 69 Column: 5

                      assert not install_req.name
        self.unnamed_requirements.append(install_req)

    def add_named_requirement(self, install_req):
        # type: (InstallRequirement) -> None
        assert install_req.name

        project_name = canonicalize_name(install_req.name)
        self.requirements[project_name] = install_req

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 71
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              
    def add_named_requirement(self, install_req):
        # type: (InstallRequirement) -> None
        assert install_req.name

        project_name = canonicalize_name(install_req.name)
        self.requirements[project_name] = install_req

    def add_requirement(

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 119
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                              )

        # This next bit is really a sanity check.
        assert install_req.is_direct == (parent_req_name is None), (
            "a direct req shouldn't have a parent and also, "
            "a non direct req should have a parent"
        )

        # Unnamed requirements are scanned again and the requirement won't be

            

Reported by Bandit.

pipenv/vendor/chardet/mbcsgroupprober.py
13 issues
Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 32 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 33 Column: 1

              from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

              from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 35 Column: 1

              from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 36 Column: 1

              from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 37 Column: 1

              from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):
    def __init__(self, lang_filter=None):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 38 Column: 1

              from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber


class MBCSGroupProber(CharSetGroupProber):
    def __init__(self, lang_filter=None):
        super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

pipenv/vendor/shellingham/nt.py
13 issues
Unable to import 'shellingham._core'
Error

Line: 17 Column: 1

                  ULONG,
)

from shellingham._core import SHELL_NAMES


INVALID_HANDLE_VALUE = HANDLE(-1).value
ERROR_NO_MORE_FILES = 18
ERROR_INSUFFICIENT_BUFFER = 122

            

Reported by Pylint.

Unused argument 'func'
Error

Line: 31 Column: 20

              

def _check_handle(error_val=0):
    def check(ret, func, args):
        if ret == error_val:
            raise ctypes.WinError()
        return ret

    return check

            

Reported by Pylint.

Unused argument 'args'
Error

Line: 31 Column: 26

              

def _check_handle(error_val=0):
    def check(ret, func, args):
        if ret == error_val:
            raise ctypes.WinError()
        return ret

    return check

            

Reported by Pylint.

Unused argument 'args'
Error

Line: 40 Column: 26

              

def _check_expected(expected):
    def check(ret, func, args):
        if ret:
            return True
        code = ctypes.GetLastError()
        if code == expected:
            return False

            

Reported by Pylint.

Unused argument 'func'
Error

Line: 40 Column: 20

              

def _check_expected(expected):
    def check(ret, func, args):
        if ret:
            return True
        code = ctypes.GetLastError()
        if code == expected:
            return False

            

Reported by Pylint.

Attribute 'dwSize' defined outside __init__
Error

Line: 116 Column: 9

                  f = kernel32.CreateToolhelp32Snapshot
    with _handle(f, TH32CS_SNAPPROCESS, 0) as snap:
        entry = ProcessEntry32()
        entry.dwSize = ctypes.sizeof(entry)
        ret = kernel32.Process32First(snap, entry)
        while ret:
            yield entry
            ret = kernel32.Process32Next(snap, entry)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import contextlib
import ctypes
import os

from ctypes.wintypes import (
    BOOL,
    CHAR,
    DWORD,
    HANDLE,

            

Reported by Pylint.

Missing class docstring
Error

Line: 51 Column: 1

                  return check


class ProcessEntry32(ctypes.Structure):
    _fields_ = (
        ("dwSize", DWORD),
        ("cntUsage", DWORD),
        ("th32ProcessID", DWORD),
        ("th32DefaultHeapID", ctypes.POINTER(ULONG)),

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 51 Column: 1

                  return check


class ProcessEntry32(ctypes.Structure):
    _fields_ = (
        ("dwSize", DWORD),
        ("cntUsage", DWORD),
        ("th32ProcessID", DWORD),
        ("th32DefaultHeapID", ctypes.POINTER(ULONG)),

            

Reported by Pylint.

Argument name "f" doesn't conform to snake_case naming style
Error

Line: 104 Column: 1

              

@contextlib.contextmanager
def _handle(f, *args, **kwargs):
    handle = f(*args, **kwargs)
    try:
        yield handle
    finally:
        kernel32.CloseHandle(handle)

            

Reported by Pylint.

pipenv/vendor/chardet/langrussianmodel.py
13 issues
No name 'SingleByteCharSetModel' in module 'chardet.sbcharsetprober'
Error

Line: 4 Column: 1

              #!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
# 2: Likely
# 1: Unlikely

            

Reported by Pylint.

Too many lines in module (5718/1000)
Error

Line: 1 Column: 1

              #!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
# 2: Likely
# 1: Unlikely

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
# -*- coding: utf-8 -*-

from chardet.sbcharsetprober import SingleByteCharSetModel


# 3: Positive
# 2: Likely
# 1: Unlikely

            

Reported by Pylint.

Line too long (124/100)
Error

Line: 4382 Column: 1

                                                            language_model=RUSSIAN_LANG_MODEL,
                                              typical_positive_ratio=0.976601,
                                              keep_ascii_letters=False,
                                              alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')

WINDOWS_1251_RUSSIAN_CHAR_TO_ORDER = {
     0: 255,  # '\x00'
     1: 255,  # '\x01'
     2: 255,  # '\x02'

            

Reported by Pylint.

Line too long (105/100)
Error

Line: 4645 Column: 1

              
WINDOWS_1251_RUSSIAN_MODEL = SingleByteCharSetModel(charset_name='windows-1251',
                                                    language='Russian',
                                                    char_to_order_map=WINDOWS_1251_RUSSIAN_CHAR_TO_ORDER,
                                                    language_model=RUSSIAN_LANG_MODEL,
                                                    typical_positive_ratio=0.976601,
                                                    keep_ascii_letters=False,
                                                    alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')


            

Reported by Pylint.

Line too long (130/100)
Error

Line: 4649 Column: 1

                                                                  language_model=RUSSIAN_LANG_MODEL,
                                                    typical_positive_ratio=0.976601,
                                                    keep_ascii_letters=False,
                                                    alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')

IBM855_RUSSIAN_CHAR_TO_ORDER = {
     0: 255,  # '\x00'
     1: 255,  # '\x01'
     2: 255,  # '\x02'

            

Reported by Pylint.

Line too long (124/100)
Error

Line: 4916 Column: 1

                                                            language_model=RUSSIAN_LANG_MODEL,
                                              typical_positive_ratio=0.976601,
                                              keep_ascii_letters=False,
                                              alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')

KOI8_R_RUSSIAN_CHAR_TO_ORDER = {
     0: 255,  # '\x00'
     1: 255,  # '\x01'
     2: 255,  # '\x02'

            

Reported by Pylint.

Line too long (124/100)
Error

Line: 5183 Column: 1

                                                            language_model=RUSSIAN_LANG_MODEL,
                                              typical_positive_ratio=0.976601,
                                              keep_ascii_letters=False,
                                              alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')

MACCYRILLIC_RUSSIAN_CHAR_TO_ORDER = {
     0: 255,  # '\x00'
     1: 255,  # '\x01'
     2: 255,  # '\x02'

            

Reported by Pylint.

Line too long (103/100)
Error

Line: 5446 Column: 1

              
MACCYRILLIC_RUSSIAN_MODEL = SingleByteCharSetModel(charset_name='MacCyrillic',
                                                   language='Russian',
                                                   char_to_order_map=MACCYRILLIC_RUSSIAN_CHAR_TO_ORDER,
                                                   language_model=RUSSIAN_LANG_MODEL,
                                                   typical_positive_ratio=0.976601,
                                                   keep_ascii_letters=False,
                                                   alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')


            

Reported by Pylint.

Line too long (129/100)
Error

Line: 5450 Column: 1

                                                                 language_model=RUSSIAN_LANG_MODEL,
                                                   typical_positive_ratio=0.976601,
                                                   keep_ascii_letters=False,
                                                   alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')

ISO_8859_5_RUSSIAN_CHAR_TO_ORDER = {
     0: 255,  # '\x00'
     1: 255,  # '\x01'
     2: 255,  # '\x02'

            

Reported by Pylint.