ymyzk/kawasemi

View on GitHub

Showing 9 of 11 total issues

Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, api_id, token, base_url="https://api.hipchat.com/v2/",
Severity: Major
Found in kawasemi/backends/hipchat.py - About 1 hr to fix

    Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, url, username=None, channel=None, icon_emoji=None,
    Severity: Major
    Found in kawasemi/backends/slack.py - About 50 mins to fix

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

          def __init__(self, token, owner, repository,
      Severity: Minor
      Found in kawasemi/backends/github.py - About 45 mins to fix

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

            def send(self, message, fail_silently=False, options=None):
                payload = {
                    "text": message
                }
                if self.channel is not None:
        Severity: Minor
        Found in kawasemi/backends/slack.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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, api_key, api_secret, access_token, access_token_secret,
        Severity: Minor
        Found in kawasemi/backends/twitter.py - About 45 mins to fix

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

              def send(self, message, channel_name=None, fail_silently=False,
                       options=None):
                  # type: (Text, Optional[str], bool, Optional[SendOptions]) -> None
                  """Send a notification to channels
          
          
          Severity: Minor
          Found in kawasemi/kawasemi.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 __init__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, api_id, token, base_url="https://api.hipchat.com/v2/",
                           color=None, notify=None, message_format="html", *args,
                           **kwargs):
                  self.url = "{0}room/{1}/notification?auth_token={2}".format(
                      base_url, api_id, token)
          Severity: Minor
          Found in kawasemi/backends/hipchat.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 send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def send(self, message, fail_silently=False, options=None):
                  payload = {
                      "api_token": self.api_token
                  }
          
          
          Severity: Minor
          Found in kawasemi/backends/yo.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 send has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def send(self, message, fail_silently=False, options=None):
                  headers = {
                      "Accept": "application/json",
                      "Content-Type": "application/json"
                  }
          Severity: Minor
          Found in kawasemi/backends/hipchat.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