albertyw/python-mailgun2

View on GitHub

Showing 6 of 11 total issues

Function send_message has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def send_message(self, from_email, to, cc=None, bcc=None,
                     subject=None, text=None, html=None, user_variables=None,
                     reply_to=None, headers=None, inlines=None,
                     attachments=None, campaign_id=None, tags=None):
        # sanity checks
Severity: Minor
Found in mailgun2/mailgun.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 send_message has 14 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def send_message(self, from_email, to, cc=None, bcc=None,
Severity: Major
Found in mailgun2/mailgun.py - About 1 hr to fix

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

        def add_list_member(self, list_name, address, name=None, params=None,
    Severity: Minor
    Found in mailgun2/mailgun.py - About 45 mins to fix

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

          def post(self, path, data, files=None, include_domain=True, auth=None):
      Severity: Minor
      Found in mailgun2/mailgun.py - About 35 mins to fix

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

            def get_events(self, begin=None, end=None, ascending=None, limit=None,
        Severity: Minor
        Found in mailgun2/mailgun.py - About 35 mins to fix

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

              def add_list_member(self, list_name, address, name=None, params=None,
                                  subscribed=True, upsert=False):
                  data = {'address': address}
                  if name:
                      data['name'] = name
          Severity: Minor
          Found in mailgun2/mailgun.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