Function fillFollowSet
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected fillFollowSet(): void {
// this.grammar.nonTerminals.for Each((A: GrammarSymbol) => {
for (const A of this.grammar.nonTerminals) {
this.followSet.set(A, createSet<GrammarSymbol>());
}
- 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 computeFirst
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected computeFirst(alpha: GrammarSymbol[]): ISet<GrammarSymbol> {
const k = alpha.length;
const result = createSet<GrammarSymbol>();
if (k === 0 || (k === 1 && alpha[0] === GrammarSymbol.Lambda)) {
- 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 fillFirstSet
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected fillFirstSet(): void {
for (const A of this.grammar.nonTerminals) {
const s = createSet<GrammarSymbol>();
if (this.derivesLambda.contains(A)) {
- 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 fillFollowSet
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected fillFollowSet(): void {
// this.grammar.nonTerminals.for Each((A: GrammarSymbol) => {
for (const A of this.grammar.nonTerminals) {
this.followSet.set(A, createSet<GrammarSymbol>());
}
Function computeFirst
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected computeFirst(alpha: GrammarSymbol[]): ISet<GrammarSymbol> {
const k = alpha.length;
const result = createSet<GrammarSymbol>();
if (k === 0 || (k === 1 && alpha[0] === GrammarSymbol.Lambda)) {
Function fillFirstSet
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected fillFirstSet(): void {
for (const A of this.grammar.nonTerminals) {
const s = createSet<GrammarSymbol>();
if (this.derivesLambda.contains(A)) {
Function markLambda
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private markLambda(): void {
let changes: boolean;
do {
changes = false;
- 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"