Showing 52 of 197 total issues
DbcListener
has 58 functions (exceeds 20 allowed). Consider refactoring. Open
class DbcListener(parser.BaseListener):
"""
"""
LdfListener
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class LdfListener(parser.BaseListener):
def __init__(self, database, logLevel = 'INFO', *args, **kws):
super(LdfListener, self).__init__(database, logLevel, *args, **kws)
self.logger = Logger(__name__, level = logLevel)
File model.py
has 1195 lines of code (exceeds 1000 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__copyright__ = """
pySART - Simplified AUTOSAR-Toolkit for Python.
Function exitSchedule_table_def
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def exitSchedule_table_def(self, ctx):
self.log_insertion("ScheduleTables")
ctx.value = [x.value for x in ctx.items]
for table in ctx.value:
name = table['name']
- Read upRead up
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
NcfListener
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class NcfListener(parser.BaseListener):
def __init__(self, database, logLevel = 'INFO', *args, **kws):
super(NcfListener, self).__init__(database, logLevel, *args, **kws)
self.logger = Logger(__name__, level = logLevel)
Function fetch_attributes
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def fetch_attributes(db):
# Attribute structure is currently to inconvenient for ad-hoc queries, so pre-fetch them.
from collections import defaultdict
from itertools import groupby
- Read upRead up
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 exitAttributeValues
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def exitAttributeValues(self, ctx):
self.log_insertion("AttributeValues")
ctx.value = [x.value for x in ctx.items]
values = []
for attr in ctx.value:
- Read upRead up
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 exitComments
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def exitComments(self, ctx):
self.log_insertion("Comments")
ctx.value = [x.value for x in ctx.items]
for comment in ctx.value:
tp = comment['type']
- Read upRead up
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 exitMessages
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def exitMessages(self, ctx):
self.log_insertion("Messages and Signals")
ctx.value = [x.value for x in ctx.items]
for msg in ctx.value:
name = msg['name']
- Read upRead up
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 exitRelativeAttributeValues
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def exitRelativeAttributeValues(self, ctx):
self.log_insertion("RelativeAttributeValues")
items = [x.value for x in ctx.items]
ctx.value = items
for attr in items:
- Read upRead up
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 insertAttributeDefinitions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def insertAttributeDefinitions(self, ctx):
self.log_insertion("AttributeDefinitions")
ctx.value = [x.value for x in ctx.items]
for attr in ctx.value:
attrType = attr['type']
- Read upRead up
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 exitCommand
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def exitCommand(self, ctx):
if ctx.frameName:
cmdName = "Frame"
else:
cmdName = ctx.c.text
- Read upRead up
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_attributes_def
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def exitNode_attributes_def(self, ctx):
self.log_insertion("NodeAttributes")
items = [x.value for x in ctx.items]
ctx.value = items
attrs = ctx.value
- Read upRead up
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 exitCategories
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def exitCategories(self, ctx):
self.log_insertion("Categories")
ctx.value = [x.value for x in ctx.items]
for category in ctx.value:
print("CAT-VALUE", category)
- Read upRead up
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 product_id
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def product_id(self, product_id):
"""
"""
if product_id in ("", ()):
self.supplier_id = self.function_id = self.variant = 0
- Read upRead up
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_def
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def exitSignal_def(self, ctx):
self.log_insertion("Signals")
ctx.value = [x.value for x in ctx.items]
for signal in ctx.value:
#print("SIG:", signal)
- Read upRead up
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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, protocol_version = None, configured_NAD = None, initial_NAD = None, product_id = (),
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, frame_time, d1, d2, d3, d4, d5, d6, d7, d8):
Function exitLin_description_file
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def exitLin_description_file(self, ctx):
self.value = dict(
protocolVersion = ctx.pv.value,
languageVersion = ctx.lv.value,
fileRevision = ctx.fr.value if ctx.fr else None,
- Read upRead up
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 exitDiagnostic_definition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def exitDiagnostic_definition(self, ctx):
lhs = ctx.lhs.value
rhs = ctx.rhs.value if ctx.rhs else None
nads = [x.value for x in ctx.nads] if ctx.nads else []
dc = ctx.dc.value if ctx.dc else None
- Read upRead up
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"