Showing 8 of 34 total issues
File index.ts
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
IDENTITY,
COMPARE,
} from "extra-function";
import {
Function cartesianProduct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function* cartesianProduct<K, V, W=Map<K, V>>(xs: Map<K, V>[], fm: MapFunction<number, Map<K, V>, Map<K, V>|W> | null=null): IterableIterator<Map<K, V>|W> {
var fm = fm || IDENTITY;
var XS = xs.length;
var kx = xs.map(x => [...x.keys()]);
var ls = kx.map(ks => ks.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 intersectionKeys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function intersectionKeys<K, V>(...xs: Map<K, V>[]): Set<K> {
var a = new Set<K>();
if (xs.length===0) return a;
var x = xs[0], ys = xs.slice(1);
LOOPX: for (var k of x.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 flatTo$
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function flatTo$<K>(a: Map<K, any>, x: Map<K, any>, n: number, fm: MapFunction<K, any, any>, ft: TestFunction<K, any>): Map<K, any> {
Function compare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function compare<K, V, W=V>(x: Map<K, V>, y: Map<K, V>, fc: CompareFunction<V|W> | null=null, fm: MapFunction<K, V, V|W> | null=null): number {
var fc = fc || COMPARE;
var fm = fm || IDENTITY;
var ks = unionKeys(x, y);
for (var k of ks) {
- 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 hasSubset
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function hasSubset<K, V, W=V>(x: Map<K, V>, y: Map<K, V>, fc: CompareFunction<V|W> | null=null, fm: MapFunction<K, V, V|W> | null=null): boolean {
var fc = fc || COMPARE;
var fm = fm || IDENTITY;
for (var [k, v] of y) {
if (!x.has(k)) return 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 generateWiki
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function generateWiki(ds) {
var rkind = /namespace|function/i, useWiki = true;
var dm = new Map(ds.map(d => [d.name, d]));
for (var d of ds) {
var f = `wiki/${d.name}.md`;
- 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 zip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function zip<K, V, W=V>(xs: Map<K, V>[], fm: MapFunction<K, V[], V[]|W> | null=null, fe: EndFunction=null, vd?: V): Map<K, V[]|W> {
var fm = fm || IDENTITY;
var fe = fe || arraySome as EndFunction;
var ks = unionKeys(...xs), a = new Map();
for (var k of ks) {
- 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"