The following issues were found

pipenv/vendor/click/formatting.py
12 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              from contextlib import contextmanager
from gettext import gettext as _

from ._compat import term_len
from .parser import split_opt

# Can force a width.  This is used by the test system
FORCED_WIDTH: t.Optional[int] = None


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from gettext import gettext as _

from ._compat import term_len
from .parser import split_opt

# Can force a width.  This is used by the test system
FORCED_WIDTH: t.Optional[int] = None



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 54 Column: 5

                  :param preserve_paragraphs: if this flag is set then the wrapping will
                                intelligently handle paragraphs.
    """
    from ._textwrap import TextWrapper

    text = text.expandtabs()
    wrapper = TextWrapper(
        width,
        initial_indent=initial_indent,

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import typing as t
from contextlib import contextmanager
from gettext import gettext as _

from ._compat import term_len
from .parser import split_opt

# Can force a width.  This is used by the test system
FORCED_WIDTH: t.Optional[int] = None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

              FORCED_WIDTH: t.Optional[int] = None


def measure_table(rows: t.Iterable[t.Tuple[str, str]]) -> t.Tuple[int, ...]:
    widths: t.Dict[int, int] = {}

    for row in rows:
        for idx, col in enumerate(row):
            widths[idx] = max(widths.get(idx, 0), term_len(col))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 22 Column: 1

                  return tuple(y for x, y in sorted(widths.items()))


def iter_rows(
    rows: t.Iterable[t.Tuple[str, str]], col_count: int
) -> t.Iterator[t.Tuple[str, ...]]:
    for row in rows:
        yield row + ("",) * (col_count - len(row))


            

Reported by Pylint.

Import outside toplevel (_textwrap.TextWrapper)
Error

Line: 54 Column: 5

                  :param preserve_paragraphs: if this flag is set then the wrapping will
                                intelligently handle paragraphs.
    """
    from ._textwrap import TextWrapper

    text = text.expandtabs()
    wrapper = TextWrapper(
        width,
        initial_indent=initial_indent,

            

Reported by Pylint.

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

Line: 66 Column: 5

                  if not preserve_paragraphs:
        return wrapper.fill(text)

    p: t.List[t.Tuple[int, bool, str]] = []
    buf: t.List[str] = []
    indent = None

    def _flush_par() -> None:
        if not buf:

            

Reported by Pylint.

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

Line: 91 Column: 5

                          buf.append(line)
    _flush_par()

    rv = []
    for indent, raw, text in p:
        with wrapper.extra_indent(" " * indent):
            if raw:
                rv.append(wrapper.indent_only(text))
            else:

            

Reported by Pylint.

Redefining argument with the local name 'text'
Error

Line: 92 Column: 22

                  _flush_par()

    rv = []
    for indent, raw, text in p:
        with wrapper.extra_indent(" " * indent):
            if raw:
                rv.append(wrapper.indent_only(text))
            else:
                rv.append(wrapper.fill(text))

            

Reported by Pylint.

pipenv/vendor/click/exceptions.py
12 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from gettext import gettext as _
from gettext import ngettext

from ._compat import get_text_stderr
from .utils import echo

if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from gettext import ngettext

from ._compat import get_text_stderr
from .utils import echo

if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 5

              from .utils import echo

if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter


def _join_param_hints(
    param_hint: t.Optional[t.Union[t.Sequence[str], str]]

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 5

              
if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter


def _join_param_hints(
    param_hint: t.Optional[t.Union[t.Sequence[str], str]]
) -> t.Optional[str]:

            

Reported by Pylint.

Unused Context imported from core
Error

Line: 10 Column: 5

              from .utils import echo

if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter


def _join_param_hints(
    param_hint: t.Optional[t.Union[t.Sequence[str], str]]

            

Reported by Pylint.

Unused Parameter imported from core
Error

Line: 11 Column: 5

              
if t.TYPE_CHECKING:
    from .core import Context
    from .core import Parameter


def _join_param_hints(
    param_hint: t.Optional[t.Union[t.Sequence[str], str]]
) -> t.Optional[str]:

            

Reported by Pylint.

__init__ method from base class 'RuntimeError' is not called
Error

Line: 286 Column: 5

              
    __slots__ = ("exit_code",)

    def __init__(self, code: int = 0) -> None:
        self.exit_code = code

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import os
import typing as t
from gettext import gettext as _
from gettext import ngettext

from ._compat import get_text_stderr
from .utils import echo

if t.TYPE_CHECKING:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 5

                      super().__init__(message)
        self.message = message

    def format_message(self) -> str:
        return self.message

    def __str__(self) -> str:
        return self.message


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                  def __str__(self) -> str:
        return self.message

    def show(self, file: t.Optional[t.IO] = None) -> None:
        if file is None:
            file = get_text_stderr()

        echo(_("Error: {message}").format(message=self.format_message()), file=file)


            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/util/connection.py
12 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from __future__ import absolute_import
import socket
from .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ


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

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from __future__ import absolute_import
import socket
from .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ


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: 35 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: 62 Column: 30

                  family = allowed_gai_family()

    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: 70 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: 130 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 .wait import NoWayToWaitForSocketError, wait_for_read
from ..contrib import _appengine_environ


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

            

Reported by Pylint.

Too many local variables (16/15)
Error

Line: 33 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: 62 Column: 41

                  family = allowed_gai_family()

    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.

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

Line: 62 Column: 9

                  family = allowed_gai_family()

    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/vendor/dateutil/zoneinfo/__init__.py
12 issues
TODO switch to FileNotFoundError?
Error

Line: 25 Column: 3

              def getzoneinfofile_stream():
    try:
        return BytesIO(get_data(__name__, ZONEFILENAME))
    except IOError as e:  # TODO  switch to FileNotFoundError?
        warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
        return None


class ZoneInfoFile(object):

            

Reported by Pylint.

TODO: Remove after deprecation period.
Error

Line: 76 Column: 3

              # will create a new "global" class instance the first time a user requests a
# timezone. Ugly, but adheres to the api.
#
# TODO: Remove after deprecation period.
_CLASS_ZONE_INSTANCE = []


def get_zonefile_instance(new_instance=False):
    """

            

Reported by Pylint.

Access to a protected member _cached_instance of a client class
Error

Line: 104 Column: 9

                  if zif is None:
        zif = ZoneInfoFile(getzoneinfofile_stream())

        get_zonefile_instance._cached_instance = zif

    return zif


def gettz(name):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding: utf-8 -*-
import warnings
import json

from tarfile import TarFile
from pkgutil import get_data
from io import BytesIO

from dateutil.tz import tzfile as _tzfile

            

Reported by Pylint.

Missing class docstring
Error

Line: 17 Column: 1

              METADATA_FN = 'METADATA'


class tzfile(_tzfile):
    def __reduce__(self):
        return (gettz, (self._filename,))


def getzoneinfofile_stream():

            

Reported by Pylint.

Class name "tzfile" doesn't conform to PascalCase naming style
Error

Line: 17 Column: 1

              METADATA_FN = 'METADATA'


class tzfile(_tzfile):
    def __reduce__(self):
        return (gettz, (self._filename,))


def getzoneinfofile_stream():

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 22 Column: 1

                      return (gettz, (self._filename,))


def getzoneinfofile_stream():
    try:
        return BytesIO(get_data(__name__, ZONEFILENAME))
    except IOError as e:  # TODO  switch to FileNotFoundError?
        warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
        return None

            

Reported by Pylint.

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

Line: 25 Column: 5

              def getzoneinfofile_stream():
    try:
        return BytesIO(get_data(__name__, ZONEFILENAME))
    except IOError as e:  # TODO  switch to FileNotFoundError?
        warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
        return None


class ZoneInfoFile(object):

            

Reported by Pylint.

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

Line: 30 Column: 1

                      return None


class ZoneInfoFile(object):
    def __init__(self, zonefile_stream=None):
        if zonefile_stream is not None:
            with TarFile.open(fileobj=zonefile_stream) as tf:
                self.zones = {zf.name: tzfile(tf.extractfile(zf), filename=zf.name)
                              for zf in tf.getmembers()

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 30 Column: 1

                      return None


class ZoneInfoFile(object):
    def __init__(self, zonefile_stream=None):
        if zonefile_stream is not None:
            with TarFile.open(fileobj=zonefile_stream) as tf:
                self.zones = {zf.name: tzfile(tf.extractfile(zf), filename=zf.name)
                              for zf in tf.getmembers()

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/chardet/enums.py
12 issues
Too few public methods (0/2)
Error

Line: 8 Column: 1

              """


class InputState(object):
    """
    This enum represents the different states a universal detector can be in.
    """
    PURE_ASCII = 0
    ESC_ASCII = 1

            

Reported by Pylint.

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

Line: 8 Column: 1

              """


class InputState(object):
    """
    This enum represents the different states a universal detector can be in.
    """
    PURE_ASCII = 0
    ESC_ASCII = 1

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 17 Column: 1

                  HIGH_BYTE = 2


class LanguageFilter(object):
    """
    This enum represents the different language filters we can apply to a
    ``UniversalDetector``.
    """
    CHINESE_SIMPLIFIED = 0x01

            

Reported by Pylint.

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

Line: 17 Column: 1

                  HIGH_BYTE = 2


class LanguageFilter(object):
    """
    This enum represents the different language filters we can apply to a
    ``UniversalDetector``.
    """
    CHINESE_SIMPLIFIED = 0x01

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 32 Column: 1

                  CJK = CHINESE | JAPANESE | KOREAN


class ProbingState(object):
    """
    This enum represents the different states a prober can be in.
    """
    DETECTING = 0
    FOUND_IT = 1

            

Reported by Pylint.

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

Line: 32 Column: 1

                  CJK = CHINESE | JAPANESE | KOREAN


class ProbingState(object):
    """
    This enum represents the different states a prober can be in.
    """
    DETECTING = 0
    FOUND_IT = 1

            

Reported by Pylint.

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

Line: 41 Column: 1

                  NOT_ME = 2


class MachineState(object):
    """
    This enum represents the different states a state machine can be in.
    """
    START = 0
    ERROR = 1

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 41 Column: 1

                  NOT_ME = 2


class MachineState(object):
    """
    This enum represents the different states a state machine can be in.
    """
    START = 0
    ERROR = 1

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 50 Column: 1

                  ITS_ME = 2


class SequenceLikelihood(object):
    """
    This enum represents the likelihood of a character following the previous one.
    """
    NEGATIVE = 0
    UNLIKELY = 1

            

Reported by Pylint.

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

Line: 50 Column: 1

                  ITS_ME = 2


class SequenceLikelihood(object):
    """
    This enum represents the likelihood of a character following the previous one.
    """
    NEGATIVE = 0
    UNLIKELY = 1

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/pep517/envbuild.py
12 issues
Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper

log = logging.getLogger(__name__)


def _load_pyproject(source_dir):

            

Reported by Pylint.

Attribute 'save_path' defined outside __init__
Error

Line: 64 Column: 9

                      self.path = mkdtemp(prefix='pep517-build-env-')
        log.info('Temporary build environment: %s', self.path)

        self.save_path = os.environ.get('PATH', None)
        self.save_pythonpath = os.environ.get('PYTHONPATH', None)

        install_scheme = 'nt' if (os.name == 'nt') else 'posix_prefix'
        install_dirs = get_paths(install_scheme, vars={
            'base': self.path,

            

Reported by Pylint.

Attribute 'save_pythonpath' defined outside __init__
Error

Line: 65 Column: 9

                      log.info('Temporary build environment: %s', self.path)

        self.save_path = os.environ.get('PATH', None)
        self.save_pythonpath = os.environ.get('PYTHONPATH', None)

        install_scheme = 'nt' if (os.name == 'nt') else 'posix_prefix'
        install_dirs = get_paths(install_scheme, vars={
            'base': self.path,
            'platbase': self.path,

            

Reported by Pylint.

standard import "import shutil" should be placed before "import toml"
Error

Line: 7 Column: 1

              import os
import logging
import toml
import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp


            

Reported by Pylint.

standard import "from subprocess import check_call" should be placed before "import toml"
Error

Line: 8 Column: 1

              import logging
import toml
import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper

            

Reported by Pylint.

Consider possible security implications associated with check_call module.
Security blacklist

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

              import logging
import toml
import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper

            

Reported by Bandit.

standard import "import sys" should be placed before "import toml"
Error

Line: 9 Column: 1

              import toml
import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper


            

Reported by Pylint.

standard import "from sysconfig import get_paths" should be placed before "import toml"
Error

Line: 10 Column: 1

              import shutil
from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper

log = logging.getLogger(__name__)

            

Reported by Pylint.

standard import "from tempfile import mkdtemp" should be placed before "import toml"
Error

Line: 11 Column: 1

              from subprocess import check_call
import sys
from sysconfig import get_paths
from tempfile import mkdtemp

from .wrappers import Pep517HookCaller, LoggerWrapper

log = logging.getLogger(__name__)


            

Reported by Pylint.

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

Line: 19 Column: 62

              

def _load_pyproject(source_dir):
    with open(os.path.join(source_dir, 'pyproject.toml')) as f:
        pyproject_data = toml.load(f)
    buildsys = pyproject_data['build-system']
    return (
        buildsys['requires'],
        buildsys['build-backend'],

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/pep517/build.py
12 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import toml
import shutil

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

log = logging.getLogger(__name__)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              import shutil

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

log = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

log = logging.getLogger(__name__)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

log = logging.getLogger(__name__)


def validate_system(system):

            

Reported by Pylint.

Redefining built-in 'FileNotFoundError'
Error

Line: 12 Column: 1

              from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

log = logging.getLogger(__name__)


def validate_system(system):

            

Reported by Pylint.

Redefining name 'build' from outer scope (line 76)
Error

Line: 70 Column: 9

                  with tempdir() as td:
        log.info('Trying to build %s in %s', dist, td)
        build_name = 'build_{dist}'.format(**locals())
        build = getattr(hooks, build_name)
        filename = build(td, {})
        source = os.path.join(td, filename)
        shutil.move(source, os.path.join(dest, os.path.basename(filename)))



            

Reported by Pylint.

standard import "import shutil" should be placed before "import toml"
Error

Line: 7 Column: 1

              import logging
import os
import toml
import shutil

from .envbuild import BuildEnvironment
from .wrappers import Pep517HookCaller
from .dirtools import tempdir, mkdir_p
from .compat import FileNotFoundError

            

Reported by Pylint.

Unnecessary parens after 'not' keyword
Error

Line: 22 Column: 1

                  Ensure build system has the requisite fields.
    """
    required = {'requires', 'build-backend'}
    if not (required <= set(system)):
        message = "Missing required fields: {missing}".format(
            missing=required-set(system),
        )
        raise ValueError(message)


            

Reported by Pylint.

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

Line: 34 Column: 29

                  Load the build system from a source dir (pyproject.toml).
    """
    pyproject = os.path.join(source_dir, 'pyproject.toml')
    with open(pyproject) as f:
        pyproject_data = toml.load(f)
    return pyproject_data['build-system']


def compat_system(source_dir):

            

Reported by Pylint.

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

Line: 67 Column: 23

                  env.pip_install(reqs)
    log.info('Installed dynamic build dependencies')

    with tempdir() as td:
        log.info('Trying to build %s in %s', dist, td)
        build_name = 'build_{dist}'.format(**locals())
        build = getattr(hooks, build_name)
        filename = build(td, {})
        source = os.path.join(td, filename)

            

Reported by Pylint.

pipenv/vendor/dateutil/easter.py
11 issues
Unnecessary parens after 'not' keyword
Error

Line: 52 Column: 1

              
    """

    if not (1 <= method <= 3):
        raise ValueError("invalid method")

    # g - Golden year - 1
    # c - Century
    # h - (23 - Epact) mod 30

            

Reported by Pylint.

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

Line: 65 Column: 5

                  # e - Extra days to add for method 2 (converting Julian
    #     date to Gregorian date)

    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30

            

Reported by Pylint.

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

Line: 66 Column: 5

                  #     date to Gregorian date)

    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30
        j = (y + y//4 + i) % 7

            

Reported by Pylint.

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

Line: 67 Column: 5

              
    y = year
    g = y % 19
    e = 0
    if method < 3:
        # Old method
        i = (19*g + 15) % 30
        j = (y + y//4 + i) % 7
        if method == 2:

            

Reported by Pylint.

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

Line: 74 Column: 13

                      j = (y + y//4 + i) % 7
        if method == 2:
            # Extra dates to convert Julian to Gregorian date
            e = 10
            if y > 1600:
                e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100

            

Reported by Pylint.

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

Line: 76 Column: 17

                          # Extra dates to convert Julian to Gregorian date
            e = 10
            if y > 1600:
                e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))

            

Reported by Pylint.

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

Line: 79 Column: 9

                              e = e + y//100 - 16 - (y//100 - 16)//4
    else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
        j = (y + y//4 + i + 2 - c + c//4) % 7

    # p can be from -6 to 56 corresponding to dates 22 March to 23 May

            

Reported by Pylint.

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

Line: 80 Column: 9

                  else:
        # New method
        c = y//100
        h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
        i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
        j = (y + y//4 + i + 2 - c + c//4) % 7

    # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)

            

Reported by Pylint.

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

Line: 86 Column: 5

              
    # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)
    p = i - j + e
    d = 1 + (p + 27 + (p + 6)//40) % 31
    m = 3 + (p + 26)//30
    return datetime.date(int(y), int(m), int(d))

            

Reported by Pylint.

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

Line: 87 Column: 5

                  # p can be from -6 to 56 corresponding to dates 22 March to 23 May
    # (later dates apply to method 2, although 23 May never actually occurs)
    p = i - j + e
    d = 1 + (p + 27 + (p + 6)//40) % 31
    m = 3 + (p + 26)//30
    return datetime.date(int(y), int(m), int(d))

            

Reported by Pylint.

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

Line: 43 Column: 1

              import logging
import re

from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 44 Column: 1

              import re

from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 45 Column: 1

              
from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 46 Column: 1

              from .charsetgroupprober import CharSetGroupProber
from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 47 Column: 1

              from .enums import InputState, LanguageFilter, ProbingState
from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 48 Column: 1

              from .escprober import EscCharSetProber
from .latin1prober import Latin1Prober
from .mbcsgroupprober import MBCSGroupProber
from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """
    The ``UniversalDetector`` class underlies the ``chardet.detect`` function

            

Reported by Pylint.

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

Line: 51 Column: 1

              from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """
    The ``UniversalDetector`` class underlies the ``chardet.detect`` function
    and coordinates all of the different charset probers.

    To get a ``dict`` containing an encoding and its confidence, you can simply

            

Reported by Pylint.

Too many instance attributes (10/7)
Error

Line: 51 Column: 1

              from .sbcsgroupprober import SBCSGroupProber


class UniversalDetector(object):
    """
    The ``UniversalDetector`` class underlies the ``chardet.detect`` function
    and coordinates all of the different charset probers.

    To get a ``dict`` containing an encoding and its confidence, you can simply

            

Reported by Pylint.

Too many branches (22/12)
Error

Line: 111 Column: 5

                      for prober in self._charset_probers:
            prober.reset()

    def feed(self, byte_str):
        """
        Takes a chunk of a document and feeds it through all of the relevant
        charset probers.

        After calling ``feed``, you can check the value of the ``done``

            

Reported by Pylint.

Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty
Error

Line: 128 Column: 12

                      if self.done:
            return

        if not len(byte_str):
            return

        if not isinstance(byte_str, bytearray):
            byte_str = bytearray(byte_str)


            

Reported by Pylint.

pipenv/vendor/pythonfinder/compat.py
11 issues
Unable to import 'pathlib2'
Error

Line: 7 Column: 5

              import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

if six.PY3:
    from functools import lru_cache

            

Reported by Pylint.

Unable to import 'backports.functools_lru_cache'
Error

Line: 15 Column: 5

                  from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass



            

Reported by Pylint.

Unused Path imported from pathlib2
Error

Line: 7 Column: 5

              import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

if six.PY3:
    from functools import lru_cache

            

Reported by Pylint.

Unused lru_cache imported from functools
Error

Line: 12 Column: 5

                  from pathlib import Path

if six.PY3:
    from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):

            

Reported by Pylint.

Unused TimeoutError imported from builtins
Error

Line: 13 Column: 5

              
if six.PY3:
    from functools import lru_cache
    from builtins import TimeoutError
else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # -*- coding=utf-8 -*-
import sys

import six

if sys.version_info[:2] <= (3, 4):
    from pathlib2 import Path  # type: ignore  # noqa
else:
    from pathlib import Path

            

Reported by Pylint.

Missing class docstring
Error

Line: 17 Column: 5

              else:
    from backports.functools_lru_cache import lru_cache  # type: ignore  # noqa

    class TimeoutError(OSError):
        pass


def getpreferredencoding():
    import locale

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 1

                      pass


def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":

            

Reported by Pylint.

Import outside toplevel (locale)
Error

Line: 22 Column: 5

              

def getpreferredencoding():
    import locale
    # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":
        _default_encoding = locale.getdefaultlocale()[1]

            

Reported by Pylint.

Consider changing "not sys.platform == 'win32'" to "sys.platform != 'win32'"
Error

Line: 26 Column: 20

                  # Borrowed from Invoke
    # (see https://github.com/pyinvoke/invoke/blob/93af29d/invoke/runners.py#L881)
    _encoding = locale.getpreferredencoding(False)
    if six.PY2 and not sys.platform == "win32":
        _default_encoding = locale.getdefaultlocale()[1]
        if _default_encoding is not None:
            _encoding = _default_encoding
    return _encoding


            

Reported by Pylint.