christoph2/pydbc

View on GitHub

Showing 52 of 197 total issues

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

    def exitObjectValueTables(self, ctx):
        self.log_insertion("ObjectValuetables")
        ctx.value = [x.value for x in ctx.items]
        for table in ctx.value:
            tp = table['type']
Severity: Minor
Found in pydbc/dbcListener.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 insertReceivers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def insertReceivers(self, messageId, signalId, receiver):
        for rcv in receiver:
            res = self.NODE_BY_NAME(self.session).params(name = rcv).first()
            if res:
                nodeId = res.rid
Severity: Minor
Found in pydbc/dbcListener.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 parseFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def parseFile(pth, filetype, debug = False, remove_file = False, logLevel = "WARN"):
    if filetype == FileType.DBC:
        grammar = 'dbc'
        start_symbol = 'dbcfile'
        listenerClass = DbcListener
Severity: Minor
Found in pydbc/scripts/vndb_importer.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 insertAttributeDefaults has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def insertAttributeDefaults(self, ctx):
        self.log_insertion("AttributeDefaults")
        defaults = {}
        for item in ctx.items:
            name, value = item.value
Severity: Minor
Found in pydbc/dbcListener.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 exitNode_definition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def exitNode_definition(self, ctx):
        name = ctx.name.value
        g = ctx.g.value if ctx.g else None
        d = ctx.d.value if ctx.d else None
        f = ctx.f.value if ctx.d else None
Severity: Minor
Found in pydbc/ncfListener.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 insertConfigurableFrames has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def insertConfigurableFrames(self):
        self.log_insertion("ConfigurableFrames")
        for node, frames in self.configurableFrames.items():
            for frameName, messageID in frames:
                frame = self.UNCONDITIONAL_FRAME_BY_NAME(self.session).params(name = frameName).first()
Severity: Minor
Found in pydbc/ldfListener.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 insertFaultStateSignals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def insertFaultStateSignals(self):
        self.log_insertion("FaultStateSignals")
        for node, signals in self.faultStateSignals.items():
            for signalName in signals:
                signal = self.LIN_SIGNAL_BY_NAME(self.session).params(name = signalName).first()
Severity: Minor
Found in pydbc/ldfListener.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 exitGeneral_definition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def exitGeneral_definition(self, ctx):
        pv = ctx.pv.value
        sup = ctx.sup.value
        fun = ctx.fun.value
        var = ctx.var.value
Severity: Minor
Found in pydbc/ncfListener.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 exitSporadic_frame_def has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def exitSporadic_frame_def(self, ctx):
        self.log_insertion("SporadicFrames")
        ctx.value = [x.value for x in ctx.items]
        for sf in ctx.value:
            #print("*SPOR", sf)
Severity: Minor
Found in pydbc/ldfListener.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, filename = ":memory:", debug = False, logLevel = 'INFO', create = True):
        if filename == ':memory:':
            self.dbname = ""
        else:
            if not filename.lower().endswith(DB_EXTENSION):
Severity: Minor
Found in pydbc/db/__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 exitSignal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def exitSignal(self, ctx):
        byteOrder = self.getValue(ctx.byteOrder)
        if not byteOrder in (0, 1):
            self.logger.error("While parsing signal: Error while parsing signal '{}': byteorder must be either 0 or 1 -- using 0".format(ctx.signalName.value))
            byteOrder = 0
Severity: Minor
Found in pydbc/dbcListener.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 exitEvent_triggered_frame_def has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def exitEvent_triggered_frame_def(self, ctx):
        self.log_insertion("EventTriggeredFrames")
        ctx.value = [x.value for x in ctx.items]
        for ef in ctx.value:
            name = ef['frameName']
Severity: Minor
Found in pydbc/ldfListener.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