Method e
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def e(g)
first = []
label = []
mate = []
- 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
Method l
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def l(x, y, first, label, mate, q, visited_nodes)
# L0. [Initialize.] Set r <- FIRST(x), s <= FIRST(y).
# If r = s, return (no vertices can be labeled).
# Otherwise flag r and s. (Steps L1-L2 find join by advancing
# alternately along paths P(x) and P(y). Flags are assigned
- 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
Method e
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def e(g)
first = []
label = []
mate = []
Method l
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def l(x, y, first, label, mate, q, visited_nodes)
# L0. [Initialize.] Set r <- FIRST(x), s <= FIRST(y).
# If r = s, return (no vertices can be labeled).
# Otherwise flag r and s. (Steps L1-L2 find join by advancing
# alternately along paths P(x) and P(y). Flags are assigned
Method l
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def l(x, y, first, label, mate, q, visited_nodes)
Method r
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def r(v, w, label, mate)
# R1. [Match v to w ] Set t <- MATE(v), MATE(v) <- w.
# If MATE(t) != v, return (the path is completely re-matched)
t = mate[v]
- 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"