Showing 15 of 17 total issues
Function _follow
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export default function _follow(FIRST, productions) {
const FOLLOW = new Map(map((i) => [i, new Set()], productions.keys()));
const couldbelast = new Map(map((i) => [i, new Set()], productions.keys()));
- 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 alphabet
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function alphabet(productions) {
const abc = new Set();
for (const unit of productions.values()) {
for (const rule of unit.values()) {
- 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 audit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export default function* audit({productions}) {
const phi = _first(productions);
const FIRST = (rule) => first(phi, rule);
- 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 materialize
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function materialize(root) {
// Assert root.type === 'node'
const parents = [
{
Function _children_next_lazy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default async function _children_next_lazy(
eof,
productions,
table,
tape,
- 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 materialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default async function materialize(root) {
// Assert root.type === 'node'
const parents = [
{
- 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 _compile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function* _compile(productions) {
const abc = alphabet(productions);
const phi = _first(productions);
const pho = _follow(phi, productions);
Function flatten
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default async function* flatten(root) {
// Assert root.type === 'node'
const stack = [
{
- 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 _children_next_lazy
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function _children_next_lazy(
eof,
productions,
table,
tape,
Function _parse_lazy
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
eof,
productions,
table,
rule,
tape,
Avoid deeply nested control flow statements. Open
if (part.type === 'leaf') abc.add(part.terminal);
Function parse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function parse(root, start, eof, productions, table, tape) {
Function _children_next_lazy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
eof,
productions,
table,
tape,
expected,
Function mapDuplicates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const mapDuplicates = (rules) => {
const candidates = new Map();
for (const [key, first] of rules) {
for (const f of first) {
if (candidates.has(f)) candidates.get(f).push(key);
- 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 _children_exhaust
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default async function _children_exhaust(children) {
// For await ( const child of children ) {
// if ( child.type === 'node' ) await _children_exhaust( child.children ) ;
// }
- 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"