multiplex/multiplex.js

View on GitHub

Showing 102 of 109 total issues

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

    isProperSupersetOf: function (other) {
        assertNotNull(other);

        // the empty set isn't a proper superset of any set.
        if (this.count() === 0) {
Severity: Minor
Found in src/lib/collections/hash-set.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 remove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    remove: function (value) {
        var node;

        if (value instanceof LinkedListNode) {
            node = value;
Severity: Minor
Found in src/lib/collections/linked-list.js - About 1 hr to fix

    Function compare has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function compare(objA, objB) {
        // Identical objects
        if (objA === objB) {
            return 0;
        }
    Severity: Minor
    Found in src/lib/runtime/compare.js - About 1 hr to fix

      Function skipIterator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function skipIterator(source, count) {
          assertNotNull(source);
          assertType(count, Number);
          count = Math.max(count, 0);
      
      
      Severity: Minor
      Found in src/lib/linq/skip.js - About 1 hr to fix

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

        export default function defaultIfEmptyIterator(source, defaultValue) {
            assertNotNull(source);
        
            return new Iterable(function () {
                var it = $iterator(source),
        Severity: Minor
        Found in src/lib/linq/default-if-empty.js - About 1 hr to fix

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

              remove: function (key) {
                  var comparer = this.comparer,
                      hash = comparer.hash(key) & 0x7FFFFFFF,     // hash-code of the key
                      bucket = hash % this.buckets.length,        // bucket index
                      last,
          Severity: Minor
          Found in src/lib/collections/hash-table.js - About 1 hr to fix

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

                function transpileTests() {
                    var units = grunt.file.expand({
                        cwd: dirs.unit
                    }, '**/[^_]*.js');
                    var pattern = /^.*multiplex$/;
            Severity: Minor
            Found in tasks/build.js - About 1 hr to fix

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

                  findLast: function (value) {
                      if (this.head === null) {
                          return null;
                      }
              
              
              Severity: Minor
              Found in src/lib/collections/linked-list.js - About 1 hr to fix

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

                module.exports = function (grunt) {
                    'use strict';
                
                    grunt.task.registerTask('qtest', 'run all unit tests', function () {
                        var done = this.async(),
                Severity: Minor
                Found in tasks/qunit.js - About 1 hr to fix

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

                      isProperSubsetOf: function (other) {
                          assertNotNull(other);
                  
                          var c = collectionCount(other);
                  
                  
                  Severity: Minor
                  Found in src/lib/collections/hash-set.js - 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 firstOrDefaultIterator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function firstOrDefaultIterator(source, predicate, defaultValue) {
                      assertNotNull(source);
                      predicate = predicate || trueFunction;
                      assertType(predicate, Function);
                  
                  
                  Severity: Minor
                  Found in src/lib/linq/first-or-default.js - 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 SortedList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function SortedList(value, comparer) {
                      var dic = isType(value, Dcitionary) ? value : null,
                          capacity = isNumber(value, Number) ? value : (dic ? dic.count() : 0);
                  
                      comparer = Comparer.from(comparer || value);
                  Severity: Minor
                  Found in src/lib/collections/sorted-list.js - 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 findIndex has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      findIndex: function (startIndexOrMatch, countOrMatch, match) {
                          var len = this.length,
                              startIndex = isNumber(startIndexOrMatch) ? startIndexOrMatch : 0,
                              count = isNumber(countOrMatch) ? countOrMatch : len - startIndex;
                  
                  
                  Severity: Minor
                  Found in src/lib/collections/list.js - 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 lastOrDefaultIterator has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export default function lastOrDefaultIterator(source, predicate, defaultValue) {
                      assertNotNull(source);
                      predicate = predicate || trueFunction;
                      assertType(predicate, Function);
                  
                  
                  Severity: Minor
                  Found in src/lib/linq/last-or-default.js - 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 joinIterator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export default function joinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
                  Severity: Minor
                  Found in src/lib/linq/join.js - About 45 mins to fix

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

                        capacity: function (value) {
                            if (value === null || value === undefined) {
                                return this.slot.keys.length;
                            } else {
                                assertType(value, Number);
                    Severity: Minor
                    Found in src/lib/collections/sorted-list.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 insert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        insert: function (index, key, value) {
                            var slot = this.slot;
                    
                            if (slot.size === slot.keys.length) {
                                var newCapacity = slot.keys.length === 0 ? 4 : slot.keys.length * 2,
                    Severity: Minor
                    Found in src/lib/collections/sorted-list.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 groupJoinIterator has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    export default function groupJoinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer) {
                    Severity: Minor
                    Found in src/lib/linq/group-join.js - About 45 mins to fix

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

                          findLastIndex: function (startIndexOrMatch, countOrMatch, match) {
                              var startIndex = isNumber(startIndexOrMatch) ? startIndexOrMatch : this.length - 1,
                                  count = isNumber(countOrMatch) ? countOrMatch : startIndex;
                      
                              match = isFunction(startIndexOrMatch) ? startIndexOrMatch : (isFunction(countOrMatch) ? countOrMatch : match);
                      Severity: Minor
                      Found in src/lib/collections/list.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 $iterable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function $iterable(value) {
                          if (value === null || value === undefined) {
                              return new EmptyIterable();
                          }
                      
                      
                      Severity: Minor
                      Found in src/lib/iteration/iterable-factory.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