aureooms/js-array

View on GitHub

Showing 12 of 12 total issues

Function combinations has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function combinations(iterable, repeat, out) {
    // Combinations('ABCD', 2) --> AB AC AD BC BD CD
    // combinations(range(4), 3) --> 012 013 023 123

    const pool = iterable;
Severity: Minor
Found in src/map/combinations.js - 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 permutations has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function permutations(iterable, repeat, out) {
    // Permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC
    // permutations(range(3), 3) --> 012 021 102 120 201 210

    const pool = iterable;
Severity: Minor
Found in src/map/permutations.js - 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 combinationswithrepetition has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function combinationswithrepetition(iterable, r, out) {
    // Combinationswithrepetition('ABC', 2) --> AA AB AC BB BC CC

    const pool = iterable;
    const len = pool.length;
Severity: Minor
Found in src/map/combinationswithrepetition.js - 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 permutations has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function permutations(iterable, repeat, out) {
    // Permutations('ABCD', 2) --> AB AC AD BA BC BD CA CB CD DA DB DC
    // permutations(range(3), 3) --> 012 021 102 120 201 210

    const pool = iterable;
Severity: Minor
Found in src/map/permutations.js - About 1 hr to fix

    Function product has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    export function product(iterables, repeat, out) {
        // Product(['ABCD', 'xy'], 1) --> Ax Ay Bx By Cx Cy Dx Dy
        // product([range(0, 2, 1)], 3) --> 000 001 010 011 100 101 110 111
    
        let a;
    Severity: Minor
    Found in src/map/product.js - 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 product has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function product(iterables, repeat, out) {
        // Product(['ABCD', 'xy'], 1) --> Ax Ay Bx By Cx Cy Dx Dy
        // product([range(0, 2, 1)], 3) --> 000 001 010 011 100 101 110 111
    
        let a;
    Severity: Minor
    Found in src/map/product.js - About 1 hr to fix

      Function combinations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function combinations(iterable, repeat, out) {
          // Combinations('ABCD', 2) --> AB AC AD BC BD CD
          // combinations(range(4), 3) --> 012 013 023 123
      
          const pool = iterable;
      Severity: Minor
      Found in src/map/combinations.js - About 1 hr to fix

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

        export function splice(a, ai, aj, b, bi, bj) {
        Severity: Minor
        Found in src/splice.js - About 45 mins to fix

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

          export function islice(iterable, start, stop, step, out) {
          Severity: Minor
          Found in src/map/islice.js - About 35 mins to fix

            Function group has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export function group(key, iterable, out) {
                const len = iterable.length;
            
                if (len === 0) {
                    return out;
            Severity: Minor
            Found in src/map/group.js - About 35 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 zip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            export function zip(iterables, out) {
                const len = iterables.length;
            
                if (len === 0) {
                    return out;
            Severity: Minor
            Found in src/map/zip.js - About 35 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 range has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            export function range(start, stop, step, out) {
                if (step < 0) {
                    for (; start > stop; start += step) {
                        out.push(start);
                    }
            Severity: Minor
            Found in src/utils/range.js - About 25 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