Showing 11 of 22 total issues
File shaker.js
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { StopIteration } from '@aureooms/js-itertools' ;
import { ast } from '@aureooms/js-grammar' ;
import tape from '@aureooms/js-tape' ;
import visitor from './visitor' ;
Function _tokens
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
async function* _tokens ( tape ) {
let line = FIRST_LINE ;
let position = FIRST_POSITION;
- 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 _tokens
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function* _tokens ( tape ) {
let line = FIRST_LINE ;
let position = FIRST_POSITION;
Function begin-environment
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
"begin-environment": async ( tree , match , ctx ) => {
const it = iter(tree.children) ;
const begincmd = await next(it) ; // \begin
Function end-environment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
"end-environment": async ( tree , match , ctx ) => {
const it = iter(tree.children) ;
const endcmd = await next(it) ; // \end
Avoid deeply nested control flow statements. Open
if ( cmd === '\\' ) {
// single character command name (any character)
cmd += d;
}
else {
Avoid deeply nested control flow statements. Open
if ( d === tape.eof || d === '\n' ) break ;
Function othercmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
"othercmd": async ( tree , match , ctx ) => {
const it = iter(tree.children) ;
const othercmd = await next(it) ;
- 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 ifcmd
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
"ifcmd": async ( tree , match , ctx ) => {
const it = iter(tree.children) ;
const ifcmd = await next(it) ; // \if...
- 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 begin-environment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
"begin-environment": async ( tree , match , ctx ) => {
const it = iter(tree.children) ;
const begincmd = await next(it) ; // \begin
- 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 chain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function* chain ( iterables ) {
for ( const iterable of iterables ) {
if ( iterable[Symbol.iterator] ) yield* iterable ;
else for await ( const item of iterable ) yield item ;
- 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"