christoph2/pydbc

View on GitHub

Showing 52 of 197 total issues

Function exitEnvironmentVariables has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def exitEnvironmentVariables(self, ctx):
        self.log_insertion("EnvVars")
        # TODO: Process after EVDATA!!!
        ctx.value = [x.value for x in ctx.evs]
        for var in ctx.value:
Severity: Minor
Found in pydbc/dbcListener.py - About 55 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 exitSignal_encoding_type_def has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def exitSignal_encoding_type_def(self, ctx):
        self.log_insertion("SignalEncodings")
        items = [x.value for x in ctx.items]
        ctx.value = items
        tps = set()
Severity: Minor
Found in pydbc/ldfListener.py - About 55 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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, frame_time, nad, id, byte, mask , inv, new_nad):
Severity: Major
Found in pydbc/db/model.py - About 50 mins to fix

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

        def __init__(self, frame_time, node, frame_index, frame_pid1 = None, frame_pid2 = None, frame_pid3 = None, frame_pid4 = None):
    Severity: Major
    Found in pydbc/db/model.py - About 50 mins to fix

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

          def __init__(self, frame_time, node, d1, d2, d3, d4, d5):
      Severity: Major
      Found in pydbc/db/model.py - About 50 mins to fix

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

            def __init__(self, name, objType, valueType, minimum = None, maximum = None, array = False):
        Severity: Minor
        Found in pydbc/ldfListener.py - About 45 mins to fix

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

              def exitSignal_representation_def(self, ctx):
                  self.log_insertion("SignalRepresentations")
                  items = [x.value for x in ctx.items]
                  ctx.value = items
                  for sr in items:
          Severity: Minor
          Found in pydbc/ldfListener.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 exitSignalGroups has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def exitSignalGroups(self, ctx):
                  self.log_insertion("SignalGroups")
                  items = [x.value for x in ctx.items]
                  ctx.value = items
                  for group in ctx.value:
          Severity: Minor
          Found in pydbc/dbcListener.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, name, protocol_version = None, language_version = None, speed = None,
          Severity: Minor
          Found in pydbc/db/model.py - About 45 mins to fix

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

                def __init__(self, signal, message, offset, multiplexor_signal = None,
            Severity: Minor
            Found in pydbc/db/model.py - About 45 mins to fix

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

                  def __init__(self, priority, reserved, datapage, pdu_format, pdu_specific, source_address):
              Severity: Minor
              Found in pydbc/types.py - About 45 mins to fix

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

                    def exitFrame_def(self, ctx):
                        self.log_insertion("UnconditionalFrames")
                        ctx.value = [x.value for x in ctx.items]
                        for frame in ctx.value:
                            frid = frame['frameID']
                Severity: Minor
                Found in pydbc/ldfListener.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 exitMessageTransmitters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def exitMessageTransmitters(self, ctx):
                        self.log_insertion("NodeTxMessages")
                        ctx.value = [x.value for x in ctx.items]
                        for transmitter in ctx.value:
                            msg = self.MESSAGE_BY_MESSAGE_ID(self.session).params(message_id = transmitter['messageID']).first()
                Severity: Minor
                Found in pydbc/dbcListener.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 renderTemplate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def renderTemplate(filename, namespace = {}, leftMargin = 0, rightMargin = 80, formatExceptions = False, encoding = 'utf-8'):
                Severity: Minor
                Found in pydbc/template.py - About 45 mins to fix

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

                  def renderTemplateFromText(tmpl, namespace = {}, leftMargin = 0, rightMargin = 80, formatExceptions = True, encoding = 'utf-8'):
                  Severity: Minor
                  Found in pydbc/template.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if array:
                                            conv = float if value_type == ValueType.FLOAT else int
                                            value = [conv(x) for x in string_value.split(";")]
                                        else:
                                            if value_type in (ValueType.INT, ValueType.FLOAT):
                    Severity: Major
                    Found in pydbc/db/imex.py - About 45 mins to fix

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

                          def __init__(self, grammarName, startSymbol, listenerClass, debug = False, logLevel = 'INFO'):
                      Severity: Minor
                      Found in pydbc/parser.py - About 35 mins to fix

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

                        def parseFile(pth, filetype, debug = False, remove_file = False, logLevel = "WARN"):
                        Severity: Minor
                        Found in pydbc/scripts/vndb_importer.py - About 35 mins to fix

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

                              def __init__(self, name, timebase, jitter, bit_length = None, tolerant = None):
                          Severity: Minor
                          Found in pydbc/db/model.py - About 35 mins to fix

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

                                def __init__(self, min_value, max_value, scale, offset, text_info):
                            Severity: Minor
                            Found in pydbc/db/model.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language