NeverBounce/NeverBounceApi-Python

View on GitHub

Showing 6 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

          Severity
          Category
          Status
          Source
          Language