Showing 8 of 33 total issues
Function add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add(self, path, data=None, replace=False):
"""
Creates the given node if it does not exist.
Returns the (new or existing) node.
"""
- 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 parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(self, context, debug=0):
self._enter(context, debug)
statements = self.get_statements(context)
matched = True
while matched:
- 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 _suite
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _suite(self, token, buffer):
tag, left, right, sublist = token
statements = []
for token in sublist:
tag = token[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 skip
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def skip(app, what, name, obj, skip, options):
Function generate_to_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_to_file(converter,
Function generate_string_to_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_string_to_file(converter,
Function create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create(self, path, data=None):
"""
Creates the given node, regardless of whether or not it already
exists.
Returns the new node.
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse(self, context, debug=0):
# Function names that have NO dot in them are references to another
# grammar.
if '.' not in self.name:
start = context.start
- 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"