Showing 43 of 119 total issues
File index.ts
has 1502 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {mod} from "extra-math";
import {
IDENTITY,
COMPARE,
} from "extra-function";
Function cartesianProduct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function cartesianProduct<T, U=T>(xs: T[][], fm: MapFunction<T[], T[]|U> | null=null): (T[]|U)[] {
var fm = fm || IDENTITY;
var XS = xs.length, a = [];
if (XS===0) return a;
var is = new Array(XS).fill(0);
- 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 rangedPartialIntroSortDo$
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialIntroSortDo$<T, U=T>(x: T[], i: number, I: number, d: number, s: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function zip
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function zip<T, U=T[]>(xs: T[][], fm: MapFunction<T[], T[]|U> | null=null, fe: EndFunction=null, vd?: T): (T[]|U)[] {
var fm = fm || IDENTITY;
var fe = fe || some as EndFunction;
var X = xs.length, a = [];
if (X===0) return a;
- 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 rangedPartialIntroSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialIntroSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedMaxHeapify$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedMaxHeapify$<T, U=T>(x: T[], i: number, I: number, r: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): void {
Function rangedPartialHeapSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialHeapSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedPartialInsertionSortSwapless$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialInsertionSortSwapless$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedPartialSelectionSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialSelectionSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedPartialSort
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export function rangedPartialSort<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
Function rangedReverseMinHeapify$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedReverseMinHeapify$<T, U=T>(x: T[], i: number, I: number, r: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): void {
Function rangedPartialInsertionSortSwap$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialInsertionSortSwap$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedPartialQuickSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialQuickSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedQuickSortPartition$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedQuickSortPartition$<T, U=T>(x: T[], i: number, I: number, p: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): number {
Function rangedPartialSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export function rangedPartialSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
Function rangedPartialInsertionSort$
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedPartialInsertionSort$<T, U=T>(x: T[], i: number, I: number, n: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): T[] {
Function rangedBuildReverseMinHeap$
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedBuildReverseMinHeap$<T, U=T>(x: T[], i: number, I: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): void {
Function rangedBuildMaxHeap$
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function rangedBuildMaxHeap$<T, U=T>(x: T[], i: number, I: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>, fs: SwapFunction<T>): void {
Function intermix
has 6 arguments (exceeds 4 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[] {
Function interleave
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function interleave<T>(xs: T[][]): T[] {
var a = [];
for (var i=0;; ++i) {
var n = 0;
for (var x of xs)
- 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"