avocado/core/tapparser.py
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert state == self._MAIN
- Exclude checks
Function parse
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse(self):
found_late_test = False
bailed_out = False
plan = None
lineno = 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 parse_test
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_test(self, ok, num, name, directive, explanation):
name = name.strip()
explanation = explanation.strip() if explanation else None
if directive is not None:
directive = directive.upper()
- 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
Avoid deeply nested control flow statements. Open
Open
if m.group(2).upper().startswith("SKIP"):
if count > 0:
yield self.Error("invalid SKIP directive for plan")
skipped = True
else:
Function parse_test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def parse_test(self, ok, num, name, directive, explanation):