Showing 14 of 25 total issues
Function print
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const print = (group, color) => {
_.each(group, (results, sim) => {
_.each(results, (result) => {
const [src, cmp] = result;
console.log("");
- 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 print
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
const print = (
group : synt.ParseResultGroup,
color : boolean
) : void => {
_.each(group, (results : synt.ParseResultMatchList, sim : string) => {
- 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 print
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const print = (group, color) => {
_.each(group, (results, sim) => {
_.each(results, (result) => {
const [src, cmp] = result;
console.log("");
Function print
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const print = (
group : synt.ParseResultGroup,
color : boolean
) : void => {
_.each(group, (results : synt.ParseResultMatchList, sim : string) => {
Function configure
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const configure = () => {
program
.version(pkg.version)
.command("analyze [paths...]")
.alias("a")
Function false_positive
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const false_positive = (
src : synt.ParseResult,
cmp : synt.ParseResult,
t_len : number
) => {
Function false_positive
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const false_positive = (src, cmp, t_len) => {
const same_node = () => cmp.ast === src.ast;
const size_is_too_different = () => {
const l1 = src.tokens.length;
const l2 = cmp.tokens.length;
Function configure
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const configure = () => {
commander_1.program
.version(pkg.version)
.command("analyze [paths...]")
.alias("a")
Function is_ts_ancestor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const is_ts_ancestor = (src, cmp) => {
let match = false;
let last = src.ast;
while (true) {
const { parent } = last;
- 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 false_positive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const false_positive = (
src : synt.ParseResult,
cmp : synt.ParseResult,
t_len : number
) => {
- 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 false_positive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const false_positive = (src, cmp, t_len) => {
const same_node = () => cmp.ast === src.ast;
const size_is_too_different = () => {
const l1 = src.tokens.length;
const l2 = cmp.tokens.length;
- 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 _tokenize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _tokenize = (tokens) => (node) => {
if (is_a_base_node(node)) {
tokens.push(node.getText());
}
else if (is_a_passthrough_node(node)) {
- 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 is_ts_ancestor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const is_ts_ancestor = (
src : synt.TSParseResult,
cmp : synt.TSParseResult
) : boolean => {
let match = 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"
Further reading
Function _tokenize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const _tokenize = (
tokens : string[]
) => (
node : ts.Node
) => {
- 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"