File Formula.ts
has 1072 lines of code (exceeds 300 allowed). Consider refactoring. Open
// Generated from src/formula/parser/Formula.g4 by ANTLR 4.9.0-SNAPSHOT
import { ATN } from "antlr4ts/atn/ATN";
import { ATNDeserializer } from "antlr4ts/atn/ATNDeserializer";
Function expr
has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring. Open
public expr(_p?: number): ExprContext {
if (_p === undefined) {
_p = 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 expr
has 346 lines of code (exceeds 300 allowed). Consider refactoring. Open
public expr(_p?: number): ExprContext {
if (_p === undefined) {
_p = 0;
}
Function ws_or_comment
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public ws_or_comment(): Ws_or_commentContext {
let _localctx: Ws_or_commentContext = new Ws_or_commentContext(this._ctx, this.state);
this.enterRule(_localctx, 4, Formula.RULE_ws_or_comment);
let _la: number;
try {
- 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 identifier
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public identifier(): IdentifierContext {
let _localctx: IdentifierContext = new IdentifierContext(this._ctx, this.state);
this.enterRule(_localctx, 12, Formula.RULE_identifier);
let _la: number;
try {
- 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
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}
Avoid deeply nested control flow statements. Open
if (this._input.LA(1) === Token.EOF) {
this.matchedEOF = true;
}