nodef/extra-sorted-array

View on GitHub

Showing 10 of 29 total issues

File index.ts has 329 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {
  IDENTITY,
  COMPARE,
} from "extra-function";
import {
Severity: Minor
Found in src/index.ts - About 3 hrs to fix

    Function rangedMerge has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    export function rangedMerge<T, U=T>(x: T[], i: number, I: number, y: T[], j: number, J: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
    Severity: Major
    Found in src/index.ts - About 1 hr to fix

      Function symmetricDifference has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      export function symmetricDifference<T, U=T>(x: T[], y: T[], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var a = [];
        for (var i=0, j=0, I=x.length, J=y.length; i<I && j<J;) {
      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 union has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export function union<T, U=T>(x: T[], y: T[], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var a = [];
        for (var i=0, j=0, I=x.length, J=y.length; i<I && j<J;) {
      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 generateWiki has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function generateWiki(ds) {
        var rkind = /namespace|function/i, useWiki = true;
        var dm = new Map(ds.map(d => [d.name, d]));
        for (var d of ds) {
          var f = `wiki/${d.name}.md`;
      Severity: Minor
      Found in build.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 difference has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export function difference<T, U=T>(x: T[], y: T[], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var a = [];
        for (var i=0, j=0, I=x.length, J=y.length; i<I && j<J;) {
      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 intersection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function intersection<T, U=T>(x: T[], y: T[], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var a = [];
        for (var i=0, j=0, I=x.length, J=y.length; i<I && j<J;) {
      Severity: Minor
      Found in src/index.ts - 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 searchValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export function searchValue<T, U=T>(x: T[], v: T, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): number {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var w = fm(v, 0, null);
        for (var i=0, I=x.length; i<I;) {
      Severity: Minor
      Found in src/index.ts - 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

      Function rangedMerge has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export function rangedMerge<T, U=T>(x: T[], i: number, I: number, y: T[], j: number, J: number, fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        var a  = [];
        while (i<I && j<J) {
      Severity: Minor
      Found in src/index.ts - 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

      Function mergeAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      export function mergeAll<T, U=T>(xs: T[][], fc: CompareFunction<T|U> | null=null, fm: MapFunction<T, T|U> | null=null): T[] {
        var fc = fc || COMPARE;
        var fm = fm || IDENTITY;
        // Merge in a binary tree fashion.
        while (xs.length>1) {
      Severity: Minor
      Found in src/index.ts - 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