Syncleus/apex

View on GitHub

Showing 35 of 62 total issues

Avoid deeply nested control flow statements.
Open

                        if band_path_net:
                            if node == port['net']:
                                frame['path'] = frame['path'][:hop_index] + [recv_port['identifier'] + '*'] +\
                                                [hop + '*'] + frame['path'][hop_index+1:]
                                port['tnc'].write(frame, port['tnc_port'])
Severity: Major
Found in src/apex/plugins/apexparadigm/__init__.py - About 45 mins to fix

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

        def __extract_path(start, raw_frame):
            """Extracts path from raw APRS KISS frame.
    
            :param start:
            :param raw_frame: Raw APRS frame from a KISS device.
    Severity: Minor
    Found in src/apex/aprs/aprs_kiss.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

    Avoid too many return statements within this function.
    Open

        return True
    Severity: Major
    Found in src/apex/aprs/util.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return False
      Severity: Major
      Found in src/apex/cli.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return
        Severity: Major
        Found in src/apex/plugins/apexparadigm/__init__.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return True
          Severity: Major
          Found in src/apex/cli.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return
            Severity: Major
            Found in src/apex/plugins/apexparadigm/__init__.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return False
              Severity: Major
              Found in src/apex/aprs/util.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return
                Severity: Major
                Found in src/apex/plugins/apexparadigm/__init__.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return
                  Severity: Major
                  Found in src/apex/plugins/apexparadigm/__init__.py - About 30 mins to fix

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

                        def __init__(self, config, port_map, aprsis):
                            self.port_map = port_map
                            self.aprsis = aprsis
                            self.running = False
                    
                    
                    Severity: Minor
                    Found in src/apex/plugins/beacon/__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 write has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def write(self, frame, *args, **kwargs):
                            with self.lock:
                                frame_hash = str(aprs_util.hash_frame(frame))
                                if frame_hash not in self.packet_cache:
                                    self.packet_cache[frame_hash] = frame
                    Severity: Minor
                    Found in src/apex/buffers.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 decode_frame has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def decode_frame(frame):
                        """
                        Breaks an ASCII APRS Frame down to it's constituent parts.
                    
                        :param frame: ASCII APRS Frame.
                    Severity: Minor
                    Found in src/apex/aprs/util.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(self, config, port_map, aprsis):
                            self.port_map = port_map
                            self.aprsis = aprsis
                            self.running = False
                    
                    
                    Severity: Minor
                    Found in src/apex/plugins/id/__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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __init__(self, config, port_map, aprsis):
                            self.port_map = port_map
                            self.aprsis = aprsis
                            self.running = False
                    
                    
                    Severity: Minor
                    Found in src/apex/plugins/status/__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