martin-majlis/MailGun-V3

View on GitHub

Showing 9 of 21 total issues

File __init__.py has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import unicode_literals

import base64
import enum
import hashlib
Severity: Minor
Found in mailgunv3/__init__.py - About 4 hrs to fix

    Function send has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        def send(self):
                    # sanity checks
            assert (self.text or self.html)
    
            data = {
    Severity: Minor
    Found in mailgunv3/__init__.py - About 2 hrs 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 __init__ has 15 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self,
    Severity: Major
    Found in mailgunv3/__init__.py - About 1 hr to fix

      Function message has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def message(self,
      Severity: Major
      Found in mailgunv3/__init__.py - About 1 hr to fix

        Function create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def create(self, name=None, params=None, subscribed=True, upsert=False):
                if self._has_error():
                    return self
        
                data = {'address': self.address}
        Severity: Minor
        Found in mailgunv3/__init__.py - About 45 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

        Function _post has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _post(self, url, data, auth=None, files=None, include_domain=True):
        Severity: Minor
        Found in mailgunv3/__init__.py - About 35 mins to fix

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

              def update(self, name=None, params=None, subscribed=True):
                  if self._has_error():
                      return self
          
                  data = {}
          Severity: Minor
          Found in mailgunv3/__init__.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

          Function create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def create(self, name=None, description=None, access_level=None):
                  if self._has_error():
                      return self
          
                  data = {'address': self.address}
          Severity: Minor
          Found in mailgunv3/__init__.py - About 25 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

          Function update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def update(self, name=None, description=None, access_level=None):
                  if self._has_error():
                      return self
          
                  data = {'address': self.address}
          Severity: Minor
          Found in mailgunv3/__init__.py - About 25 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