nodef/extra-array

View on GitHub

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";
Severity: Major
Found in src/index.ts - About 4 days to fix

    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);
    Severity: Minor
    Found in src/index.ts - About 1 hr to fix

    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[] {
    Severity: Major
    Found in src/index.ts - About 1 hr to fix

      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;
      Severity: Minor
      Found in src/index.ts - About 55 mins to fix

      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[] {
      Severity: Major
      Found in src/index.ts - About 50 mins to fix

        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 {
        Severity: Major
        Found in src/index.ts - About 50 mins to fix

          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[] {
          Severity: Major
          Found in src/index.ts - About 50 mins to fix

            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[] {
            Severity: Major
            Found in src/index.ts - About 50 mins to fix

              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[] {
              Severity: Major
              Found in src/index.ts - About 50 mins to fix

                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[] {
                Severity: Major
                Found in src/index.ts - About 50 mins to fix

                  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 {
                  Severity: Major
                  Found in src/index.ts - About 50 mins to fix

                    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[] {
                    Severity: Major
                    Found in src/index.ts - About 50 mins to fix

                      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[] {
                      Severity: Major
                      Found in src/index.ts - About 50 mins to fix

                        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 {
                        Severity: Major
                        Found in src/index.ts - About 50 mins to fix

                          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[] {
                          Severity: Major
                          Found in src/index.ts - About 50 mins to fix

                            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[] {
                            Severity: Major
                            Found in src/index.ts - About 50 mins to fix

                              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 {
                              Severity: Minor
                              Found in src/index.ts - About 45 mins to fix

                                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 {
                                Severity: Minor
                                Found in src/index.ts - About 45 mins to fix

                                  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[] {
                                  Severity: Minor
                                  Found in src/index.ts - About 45 mins to fix

                                    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)
                                    Severity: Minor
                                    Found in src/index.ts - About 45 mins to fix

                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language