Showing 21 of 238 total issues
A2LListener
has 193 functions (exceeds 80 allowed). Consider refactoring. Open
class A2LListener(BaseListener):
""""""
def exitAlignmentByte(self, ctx):
alignmentBorder = ctx.alignmentBorder.value
File inspect.py
has 2956 lines of code (exceeds 2500 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__copyright__ = """
pySART - Simplified AUTOSAR-Toolkit for Python.
Function __init__
has a Cognitive Complexity of 49 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, session, name: str, module_name: str = None):
self.compu_method = session.query(model.CompuMethod).filter(model.CompuMethod.name == name).first()
if not self.compu_method:
return
self.name = 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 _process_file
has a Cognitive Complexity of 45 (exceeds 15 allowed). Consider refactoring. Open
def _process_file(self, file_name, join_lines=True, encoding="latin-1"):
result = []
start_line_number = self.absolute_file_number + 1
multiline = False
pth_obj = Path(file_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 _process_aml
has a Cognitive Complexity of 39 (exceeds 15 allowed). Consider refactoring. Open
def _process_aml(self, data):
"""Extract A2ML and IF_DATA sections."""
result = []
sections = []
aml_section = []
- 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 tagged_struct
has a Cognitive Complexity of 38 (exceeds 15 allowed). Consider refactoring. Open
def tagged_struct(self):
self.enter("tagged_struct")
tag = self.block_or_tag()
tags = self.current_element.tags.keys()
counter = {k: False for k in tags}
- 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 a Cognitive Complexity of 25 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, parent, items: dict, alignment: dict):
self.parent = parent
self.alignment = alignment
result = []
positions = {}
- 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 import_a2l
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def import_a2l(
Avoid deeply nested control flow statements. Open
if match:
s, e = match.span()
if_data_end = (line_num, e - len(match.group("tail")))
if_data_section.append("{}/end{}IF_DATA".format(match.group("section"), match.group("s0")))
section = (
Avoid deeply nested control flow statements. Open
if definition.multiple:
tag_dict[tag].append(value)
else:
tag_dict[tag] = value
self.pop_element()
Avoid deeply nested control flow statements. Open
if ((self.current_token.type != self.lexer.IDENT) or (self.current_token.text not in tags)) and (
self.current_token.type != self.lexer.BEGIN
):
break
else:
Function __init__
has a Cognitive Complexity of 18 (exceeds 15 allowed). Consider refactoring. Open
def __init__(self, session, module_name: str = None):
self.variantCoding = session.query(model.VariantCoding).first()
self._naming = self.variantCoding.var_naming.tag if self.variantCoding.var_naming else "NUMERIC"
self._separator = self.variantCoding.var_separator.separator if self.variantCoding.var_separator else "."
- 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 syntaxError
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e):
Function doTemplateFromText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def doTemplateFromText(
Function doTemplate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def doTemplate(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, session, name=None, module_name: str = None, parent=None, *args):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return iterable[0]
Avoid too many return
statements within this function. Open
return [iterable[0]]