edit-distance/myers-1986

View on GitHub

Showing 29 of 43 total issues

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 longestCommonPrefix has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export default function longestCommonPrefix(eq, ai, aj, bi, bj) {
    Severity: Minor
    Found in src/longestCommonPrefix.js - About 35 mins to fix

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

      export default function StackEntry(D, li, lj, ri, rj) {
      Severity: Minor
      Found in src/StackEntry.js - About 35 mins to fix

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

        export default function Split(k, xBegin, xEnd, distanceLeft, distance) {
        Severity: Minor
        Found in src/Split.js - About 35 mins to fix

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

          export default function longestCommonSuffix(eq, aj, ai, bj, bi) {
          Severity: Minor
          Found in src/longestCommonSuffix.js - About 35 mins to fix

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

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

              Function recurseDeep has a Cognitive Complexity of 7 (exceeds 5 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 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

              Avoid too many return statements within this function.
              Open

                      return halfPerimeter <= MAX
                          ? l0 === l1 || r0 === r1
                              ? halfPerimeter
                              : method(halfPerimeter, eq, l0, l1, r0, r1).distance
                          : l0 === l1 || r0 === r1
              Severity: Major
              Found in src/makeScan32.js - About 30 mins to fix

                Function recurseDeeperStep has a Cognitive Complexity of 6 (exceeds 5 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 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