Syncleus/apex

View on GitHub

Showing 62 of 62 total issues

Avoid deeply nested control flow statements.
Open

                        if ssid is 0:
                            frame['path'][hop_index] = port_callsign + '*'
                        else:
                            frame['path'][hop_index] = port['identifier'] + '*'
                        port['tnc'].write(frame, port['tnc_port'])
Severity: Major
Found in src/apex/plugins/apexparadigm/__init__.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if raw_frame[raw_slice + 1] & 0x03 is 0x03 and raw_frame[raw_slice + 2] in [0xf0, 0xcf]:
                                return True
            return False
    Severity: Major
    Found in src/apex/aprs/aprs_kiss.py - About 45 mins to fix

      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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(self, strip_df_start=True,
        Severity: Minor
        Found in src/apex/kiss/kiss_serial.py - About 45 mins to fix

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

              def __init__(self, base_tnc, base_name, base_port=None, echo_packets=True, buffer_size=10000, buffer_time=30):
          Severity: Minor
          Found in src/apex/buffers.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if raw_frame[raw_slice + 1] & 0x03 is 0x03 and raw_frame[raw_slice + 2] in [0xf0, 0xcf]:
                                        frame['text'] = ''.join(map(chr, raw_frame[raw_slice + 3:]))
                                        frame['destination'] = AprsKiss.__identity_as_string(AprsKiss.__extract_callsign(raw_frame))
                                        frame['source'] = AprsKiss.__identity_as_string(AprsKiss.__extract_callsign(raw_frame[7:]))
                                        frame['path'] = AprsKiss.__extract_path(int(i), raw_frame)
            Severity: Major
            Found in src/apex/aprs/aprs_kiss.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 False
              Severity: Major
              Found in src/apex/aprs/util.py - About 30 mins to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                            if band_match is not None:
                                band_path = band_match.group(1)
                                band_path_net = band_match.group(2)
                Severity: Minor
                Found in src/apex/plugins/apexparadigm/__init__.py and 1 other location - About 30 mins to fix
                src/apex/plugins/apexparadigm/__init__.py on lines 65..67

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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/cli.py - About 30 mins to fix

                    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 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
                          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

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                                              if band_match is not None:
                                                  band_path = band_match.group(1)
                                                  band_path_net = band_match.group(2)
                              Severity: Minor
                              Found in src/apex/plugins/apexparadigm/__init__.py and 1 other location - About 30 mins to fix
                              src/apex/plugins/apexparadigm/__init__.py on lines 149..151

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 32.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              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/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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language