File parser.py
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
This module contains the parser.
The Parser uses the Lexer to retrieve a series of tokens, and based on these
tokens, it performs syntax analysis. It should give an Abstract Syntax Tree in
Function block
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def block(self) -> List[Node]:
"""
Processing a list of indented statements following a colon.
Original token is provided as parameter to help this method wraps the
- 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 assign
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def assign(self) -> Node:
"""
Based on a left-member expression, check that we are dealing with an
assign, be mutable or immutable.
- 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 addition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Wontfix
def addition(self) -> Node:
"""
Looking for a token that could lead to an addition or a substraction.
It returns the result of a numeral, or a chain of additions. If an
- 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 let
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def let(self) -> Tuple[Node, Optional[Token]]:
"""
Is there any let keyword that wants to come out?
Let keyword declares a node to be declared publicly in our tree of
- 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"