functional-data-structure/persistent

View on GitHub

Showing 11 of 35 total issues

Function seq has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function seq(empty, size) {
    const Seq = function (tree) {
        this.tree = tree;
    };

Severity: Major
Found in src/seq.js - About 4 hrs to fix

    Function seq has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    export function seq(empty, size) {
        const Seq = function (tree) {
            this.tree = tree;
        };
    
    
    Severity: Minor
    Found in src/seq.js - About 4 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 intervaltree has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function intervaltree(empty, M) {
        const atleast = function (k, [_, n]) {
            return k <= n;
        };
    
    
    Severity: Major
    Found in src/intervaltree.js - About 3 hrs to fix

      Function indordseq has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function indordseq(empty, key, size, measure) {
          // Probably needs a total order instead of a measure
          // this causes generality problems in the insert, merge, partition and delete
          // methods
      
      
      Severity: Major
      Found in src/indordseq.js - About 3 hrs to fix

        Function ordseq has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function ordseq(empty, key) {
            // Probably needs a total order instead of a key measure
            // this causes generality problems in the insert, merge, partition and delete
            // methods
        
        
        Severity: Major
        Found in src/ordseq.js - About 2 hrs to fix

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

              Seq.prototype.splice = function (start, deleteCount, ...items) {
                  const length = this.len();
          
                  if (start < -length || start >= length)
                      throw new Error(`wrong start '${start}'`);
          Severity: Minor
          Found in src/seq.js - About 1 hr to fix

            Function intervaltree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            export function intervaltree(empty, M) {
                const atleast = function (k, [_, n]) {
                    return k <= n;
                };
            
            
            Severity: Minor
            Found in src/intervaltree.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 heap has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function heap(empty, max) {
                const Heap = function (tree) {
                    this.tree = tree;
                };
            
            
            Severity: Minor
            Found in src/heap.js - About 1 hr to fix

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

              export function indordseq(empty, key, size, measure) {
                  // Probably needs a total order instead of a measure
                  // this causes generality problems in the insert, merge, partition and delete
                  // methods
              
              
              Severity: Minor
              Found in src/indordseq.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 [new Seq(prefix.append(items).concat(suffix)), new Seq(deleted)];
              Severity: Major
              Found in src/seq.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return [new Seq(prefix.append(items)), new Seq(rest)];
                Severity: Major
                Found in src/seq.js - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language