NeverBounce/NeverBounceApi-Python

View on GitHub

Showing 11 of 12 total issues

File bulk.py has 431 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from .utils import urlforversion

__all__ = ['JobRunnerMixin']

_segmentation_options = {
Severity: Minor
Found in neverbounce_sdk/bulk.py - About 6 hrs to fix

    Function jobs_download has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def jobs_download(self, job_id, fd,
                          segmentation=('valids', 'invalids',
                                        'catchalls', 'unknowns'),
                          appends=(),
                          yes_no_representation='int',
    Severity: Minor
    Found in neverbounce_sdk/bulk.py - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function jobs_create has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def jobs_create(self, input, from_url=False, filename=None,
    Severity: Major
    Found in neverbounce_sdk/bulk.py - About 1 hr to fix

      Function raw_search has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def raw_search(self,
      Severity: Minor
      Found in neverbounce_sdk/bulk.py - About 45 mins to fix

        Function jobs_download has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def jobs_download(self, job_id, fd,
        Severity: Minor
        Found in neverbounce_sdk/bulk.py - About 45 mins to fix

          Function _check_response has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _check_response(self, resp):
                  """Checks a response for errors and throws if they any present"""
                  # first check that there were no errors on the wire
                  resp.raise_for_status()
          
          
          Severity: Minor
          Found in neverbounce_sdk/core.py - About 35 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Continuation line over-indented for visual indent
          Open

                                        version_file, M)
          Severity: Minor
          Found in setup.py by pep8

          Continuation lines indentation.

          Continuation lines should align wrapped elements either vertically
          using Python's implicit line joining inside parentheses, brackets
          and braces, or using a hanging indent.
          
          When using a hanging indent these considerations should be applied:
          - there should be no arguments on the first line, and
          - further indentation should be used to clearly distinguish itself
            as a continuation line.
          
          Okay: a = (\n)
          E123: a = (\n    )
          
          Okay: a = (\n    42)
          E121: a = (\n   42)
          E122: a = (\n42)
          E123: a = (\n    42\n    )
          E124: a = (24,\n     42\n)
          E125: if (\n    b):\n    pass
          E126: a = (\n        42)
          E127: a = (24,\n      42)
          E128: a = (24,\n    42)
          E129: if (a or\n    b):\n    pass
          E131: a = (\n    42\n 24)

          Expected 2 blank lines after class or function definition, found 1
          Open

          setup(
          Severity: Minor
          Found in setup.py by pep8

          Separate top-level function and class definitions with two blank lines.

          Method definitions inside a class are separated by a single blank
          line.
          
          Extra blank lines may be used (sparingly) to separate groups of
          related functions.  Blank lines may be omitted between a bunch of
          related one-liners (e.g. a set of dummy implementations).
          
          Use blank lines in functions, sparingly, to indicate logical
          sections.
          
          Okay: def a():\n    pass\n\n\ndef b():\n    pass
          Okay: def a():\n    pass\n\n\nasync def b():\n    pass
          Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
          Okay: default = 1\nfoo = 1
          Okay: classify = 1\nfoo = 1
          
          E301: class Foo:\n    b = 0\n    def bar():\n        pass
          E302: def a():\n    pass\n\ndef b(n):\n    pass
          E302: def a():\n    pass\n\nasync def b(n):\n    pass
          E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
          E303: def a():\n\n\n\n    pass
          E304: @decorator\n\ndef a():\n    pass
          E305: def a():\n    pass\na()
          E306: def a():\n    def b():\n        pass\n    def c():\n        pass

          Line too long (82 > 79 characters)
          Open

              # see here: https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690
          Severity: Minor
          Found in setup.py by pep8

          Limit all lines to a maximum of 79 characters.

          There are still many devices around that are limited to 80 character
          lines; plus, limiting windows to 80 characters makes it possible to
          have several windows side-by-side.  The default wrapping on such
          devices looks ugly.  Therefore, please limit all lines to a maximum
          of 79 characters. For flowing long blocks of text (docstrings or
          comments), limiting the length to 72 characters is recommended.
          
          Reports error E501.

          Expected 2 blank lines, found 1
          Open

          def read(*parts):
          Severity: Minor
          Found in setup.py by pep8

          Separate top-level function and class definitions with two blank lines.

          Method definitions inside a class are separated by a single blank
          line.
          
          Extra blank lines may be used (sparingly) to separate groups of
          related functions.  Blank lines may be omitted between a bunch of
          related one-liners (e.g. a set of dummy implementations).
          
          Use blank lines in functions, sparingly, to indicate logical
          sections.
          
          Okay: def a():\n    pass\n\n\ndef b():\n    pass
          Okay: def a():\n    pass\n\n\nasync def b():\n    pass
          Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
          Okay: default = 1\nfoo = 1
          Okay: classify = 1\nfoo = 1
          
          E301: class Foo:\n    b = 0\n    def bar():\n        pass
          E302: def a():\n    pass\n\ndef b(n):\n    pass
          E302: def a():\n    pass\n\nasync def b(n):\n    pass
          E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
          E303: def a():\n\n\n\n    pass
          E304: @decorator\n\ndef a():\n    pass
          E305: def a():\n    pass\na()
          E306: def a():\n    def b():\n        pass\n    def c():\n        pass

          Expected 2 blank lines, found 1
          Open

          def find_version(*file_paths):
          Severity: Minor
          Found in setup.py by pep8

          Separate top-level function and class definitions with two blank lines.

          Method definitions inside a class are separated by a single blank
          line.
          
          Extra blank lines may be used (sparingly) to separate groups of
          related functions.  Blank lines may be omitted between a bunch of
          related one-liners (e.g. a set of dummy implementations).
          
          Use blank lines in functions, sparingly, to indicate logical
          sections.
          
          Okay: def a():\n    pass\n\n\ndef b():\n    pass
          Okay: def a():\n    pass\n\n\nasync def b():\n    pass
          Okay: def a():\n    pass\n\n\n# Foo\n# Bar\n\ndef b():\n    pass
          Okay: default = 1\nfoo = 1
          Okay: classify = 1\nfoo = 1
          
          E301: class Foo:\n    b = 0\n    def bar():\n        pass
          E302: def a():\n    pass\n\ndef b(n):\n    pass
          E302: def a():\n    pass\n\nasync def b(n):\n    pass
          E303: def a():\n    pass\n\n\n\ndef b(n):\n    pass
          E303: def a():\n\n\n\n    pass
          E304: @decorator\n\ndef a():\n    pass
          E305: def a():\n    pass\na()
          E306: def a():\n    def b():\n        pass\n    def c():\n        pass
          Severity
          Category
          Status
          Source
          Language