Showing 43 of 119 total issues
Function intermix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function intermix<T>(x: T[], y: T[], m: number=1, n: number=1, s: number=m, t: number=n): T[] {
var X = x.length, Y = y.length, a = [];
var m = Math.max(m, 0);
var n = Math.max(n, 0);
var s = Math.max(s, 1);
- 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 isUniqueDual
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isUniqueDual<T, U=T>(x: T[], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): boolean {
var fc = fc || COMPARE;
var fm = fm || IDENTITY;
var x1 = [...x].map(fm);
for (var wx of x1) {
- 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 isubsequences
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function* isubsequences<T>(x: T[], n: number=-1): IterableIterator<T[]> {
var X = x.length;
if (n>X) return;
if (n===X) { yield x; return; }
if (n===0 || X===0) { yield []; return; }
- 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"