edit-distance/myers-1986

View on GitHub

Showing 29 of 43 total issues

Function twoWayScan has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

export default function twoWayScan(
    MAX,
    V,
    centerF,
    centerB,
Severity: Minor
Found in src/twoWayScan.js - About 5 hrs 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 twoWayScan has 126 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function twoWayScan(
    MAX,
    V,
    centerF,
    centerB,
Severity: Major
Found in src/twoWayScan.js - About 5 hrs to fix

    Function makeScan32 has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function makeScan32(method) {
        /**
         * Returns distance, or -1 if distance > MAX.
         * Undefined behavior if indices are not int32.
         *
    Severity: Minor
    Found in src/makeScan32.js - About 2 hrs 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 recurseDeep has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function recurseDeep(MAX, eq, li, lj, ri, rj) {
        assert(MAX >= 1);
        assert(lj - li + rj - ri >= MAX);
        if (li === lj || ri === rj) {
            assert(li < lj || ri < rj);
    Severity: Minor
    Found in src/recurseDeep.js - About 1 hr to fix

      Function recurseDeeperStep has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function recurseDeeperStep(B, stack, eq) {
          assert(stack.length > 0);
          const entry = stack.pop();
          assert(entry instanceof StackEntry);
          let MAX = entry.D;
      Severity: Minor
      Found in src/recurseDeeperStep.js - About 1 hr to fix

        Function recurse has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function recurse(MAX, eq, li, lj, ri, rj) {
            assert(MAX >= 0);
            assert(lj - li + rj - ri > MAX);
            if (li === lj || ri === rj) {
                assert(lj - li > MAX || rj - ri > MAX);
        Severity: Minor
        Found in src/recurse.js - About 1 hr to fix

          Function oneWay has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function oneWay(MAX, eq, li, lj, ri, rj) {
              assert(MAX > 0);
              assert(MAX <= lj - li + rj - ri);
              assert(li < lj);
              assert(ri < rj);
          Severity: Minor
          Found in src/oneWay.js - About 1 hr to fix

            Function twoWayScan has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                MAX,
                V,
                centerF,
                centerB,
                eq,
            Severity: Major
            Found in src/twoWayScan.js - About 1 hr to fix

              Function backwardExtend has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  cMin,
                  cMax,
                  cx,
                  V,
                  eq,
              Severity: Major
              Found in src/backwardExtend.js - About 50 mins to fix

                Function forwardExtend has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                export default function forwardExtend(cMin, cMax, cx, V, eq, lj, rj) {
                Severity: Major
                Found in src/forwardExtend.js - About 50 mins to fix

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

                  export default function oneWayAlloc(MAX, li, lj, ri, rj, init) {
                  Severity: Minor
                  Found in src/oneWayAlloc.js - About 45 mins to fix

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

                    export default function twoWayRealloc(B, MAX, li, lj, ri, rj) {
                    Severity: Minor
                    Found in src/twoWayRealloc.js - About 45 mins to fix

                      Function longestCommonSuffix has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function longestCommonSuffix(eq, aj, ai, bj, bi) {
                          assert(Number.isInteger(aj));
                          assert(Number.isInteger(ai) && ai >= 0);
                          assert(Number.isInteger(bj));
                          assert(Number.isInteger(bi) && bi >= 0);
                      Severity: Minor
                      Found in src/longestCommonSuffix.js - 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 oneWay has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function oneWay(MAX, eq, li, lj, ri, rj) {
                          assert(MAX > 0);
                          assert(MAX <= lj - li + rj - ri);
                          assert(li < lj);
                          assert(ri < rj);
                      Severity: Minor
                      Found in src/oneWay.js - 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 recurse has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      export default function recurse(MAX, eq, li, lj, ri, rj) {
                      Severity: Minor
                      Found in src/recurse.js - About 45 mins to fix

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

                        export default function recurseDeep(MAX, eq, li, lj, ri, rj) {
                        Severity: Minor
                        Found in src/recurseDeep.js - About 45 mins to fix

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

                          export default function diff(MAX, eq, li, lj, ri, rj) {
                          Severity: Minor
                          Found in src/diff.js - About 45 mins to fix

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

                            export default function oneWay(MAX, eq, li, lj, ri, rj) {
                            Severity: Minor
                            Found in src/oneWay.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (V[c] === V[(c + cBDcF) | 0]) {
                                                      // XEnd === V[centerB + k - Delta]
                                                      return new Split(
                                                          (c - cFmD0) | 0, // K + Delta0
                                                          longestCommonSuffix(eq, x, li, (x - ((c - cFmD0) | 0)) | 0, ri),
                              Severity: Major
                              Found in src/twoWayScan.js - About 45 mins to fix

                                Function longestCommonPrefix has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export default function longestCommonPrefix(eq, ai, aj, bi, bj) {
                                    assert(Number.isInteger(ai) && ai >= 0);
                                    assert(Number.isInteger(aj));
                                    assert(Number.isInteger(bi) && bi >= 0);
                                    assert(Number.isInteger(bj));
                                Severity: Minor
                                Found in src/longestCommonPrefix.js - 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