nodef/extra-array

View on GitHub

Showing 119 of 119 total issues

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

    export function copy<T>(x: T[], y: T[], j: number=0, i: number=0, I: number=y.length): T[] {
      return copy$(x.slice(), y, j, i, I);
    }
    Severity: Minor
    Found in src/index.ts and 1 other location - About 45 mins to fix
    src/index.ts on lines 2877..2883

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 50.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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 rangedSort$ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function rangedSort$<T, U=T>(x: T[], i: number, I: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
      Severity: Minor
      Found in src/index.ts - About 45 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export function copy$<T>(x: T[], y: T[], j: number=0, i: number=0, I: number=y.length): T[] {
          var j = index(x, j);
          var [i, I] = indexRange(y, i, I);
          for (; i<I; ++i, ++j)
            x[j] = y[i];
        Severity: Minor
        Found in src/index.ts and 1 other location - About 45 mins to fix
        src/index.ts on lines 2863..2865

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 50.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function rangedSort has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        export function rangedSort<T, U=T>(x: T[], i: number, I: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
        Severity: Minor
        Found in src/index.ts - About 45 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 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

            Function copy$ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            export function copy$<T>(x: T[], y: T[], j: number=0, i: number=0, I: number=y.length): T[] {
            Severity: Minor
            Found in src/index.ts - About 35 mins to fix

              Function flatTo$ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function flatTo$(a: any[], x: any[], n: number, fm: MapFunction<any, any>, ft: TestFunction<any>): any[] {
              Severity: Minor
              Found in src/index.ts - About 35 mins to fix

                Function swapRanges$ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export function swapRanges$<T>(x: T[], i: number, I: number, j: number, J: number): T[] {
                Severity: Minor
                Found in src/index.ts - About 35 mins to fix

                  Function copy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function copy<T>(x: T[], y: T[], j: number=0, i: number=0, I: number=y.length): T[] {
                  Severity: Minor
                  Found in src/index.ts - About 35 mins to fix

                    Function isInfixAt has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function isInfixAt<T, U=T>(x: T[], y: T[], i: number, fc: CompareFunction<T|U>, fm: MapFunction<T, T|U>): boolean {
                    Severity: Minor
                    Found in src/index.ts - About 35 mins to fix

                      Function swapRanges has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      export function swapRanges<T>(x: T[], i: number, I: number, j: number, J: number): T[] {
                      Severity: Minor
                      Found in src/index.ts - About 35 mins to fix

                        Function partialSort has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        export function partialSort<T, U=T>(x: T[], n: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
                        Severity: Minor
                        Found in src/index.ts - About 35 mins to fix

                          Function partialSort$ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export function partialSort$<T, U=T>(x: T[], n: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null, fs: SwapFunction<T> | null=null): T[] {
                          Severity: Minor
                          Found in src/index.ts - About 35 mins to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            export function pop$<T>(x: T[]): T[] {
                              x.pop();
                              return x;
                            }
                            Severity: Minor
                            Found in src/index.ts and 1 other location - About 35 mins to fix
                            src/index.ts on lines 2820..2823

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 47.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                              return x.slice(0, i).concat(x.slice(j, J), x.slice(i, j), x.slice(I));
                            Severity: Minor
                            Found in src/index.ts and 1 other location - About 35 mins to fix
                            src/index.ts on lines 2928..2932

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 47.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 4 locations. Consider refactoring.
                            Open

                            function isDisjointMap<T, U=T>(x: T[], y: T[], fm: MapFunction<T, T|U> | null=null): boolean {
                              var fm = fm || IDENTITY;
                              var s  = toSet(y, fm), i = -1;
                              for (var v of x) {
                                var w = fm(v, ++i, x);
                            Severity: Major
                            Found in src/index.ts and 3 other locations - About 35 mins to fix
                            src/index.ts on lines 3480..3488
                            src/index.ts on lines 3517..3526
                            src/index.ts on lines 3555..3564

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 47.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Identical blocks of code found in 4 locations. Consider refactoring.
                            Open

                            function unionMap$<T, U=T>(x: T[], y: T[], fm: MapFunction<T, T|U> | null=null): T[] {
                              var fm = fm || IDENTITY;
                              var s  = toSet(x, fm), i = -1;
                              for (var vy of y) {
                                var wy = fm(vy, ++i, y);
                            Severity: Major
                            Found in src/index.ts and 3 other locations - About 35 mins to fix
                            src/index.ts on lines 3393..3401
                            src/index.ts on lines 3517..3526
                            src/index.ts on lines 3555..3564

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 47.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language