luanguimaraesla/gabby

View on GitHub

Showing 5 of 9 total issues

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

    def __init__(self, input_topics=None, output_topics=None, decode_input=True,
Severity: Major
Found in src/gabby/gabby.py - About 1 hr to fix

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

        def __init__(self, input_topics, output_topics, decode_input=True,
    Severity: Minor
    Found in src/gabby/node.py - About 45 mins to fix

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

          def __init__(self, input_topics, output_topics, decode_input=True,
      Severity: Minor
      Found in src/gabby/node.py - About 35 mins to fix

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

            def message_arrived(self, topic_name, payload, qos, retained, msg_id):
        Severity: Minor
        Found in src/gabby/udp_receiver.py - About 35 mins to fix

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

              def process(self, userdata, message):
                  if self.decode_input:
                      topic_name = message.topic
                      topics = self.input_topics.filter_by(name=topic_name)
                      if not topics:
          Severity: Minor
          Found in src/gabby/node.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