multiplex/multiplex.js

View on GitHub

Showing 102 of 109 total issues

Avoid too many return statements within this function.
Open

                return hash(valueOf(obj), false);
Severity: Major
Found in src/lib/runtime/hash.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return false;
    Severity: Major
    Found in src/lib/runtime/equals.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return valueOf(objA) === valueOf(objB);
      Severity: Major
      Found in src/lib/runtime/equals.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return obj.__hash__() >> 32;
        Severity: Major
        Found in src/lib/runtime/hash.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return new ObjectIterable(value);
          Severity: Major
          Found in src/lib/iteration/iterable-factory.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return new ArrayIterable([value]);
            Severity: Major
            Found in src/lib/iteration/iterable-factory.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return objA > objB ? 1 : -1;
              Severity: Major
              Found in src/lib/runtime/compare.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return objA.__cmp__(objB);
                Severity: Major
                Found in src/lib/runtime/compare.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return (result.uniqueCount < this.count() && result.unfoundCount === 0);
                  Severity: Major
                  Found in src/lib/collections/hash-set.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return new ObjectIterator(obj);
                    Severity: Major
                    Found in src/lib/iteration/iterator-factory.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return defaultComparer;
                      Severity: Major
                      Found in src/lib/collections/comparer.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return obj instanceof type;
                        Severity: Major
                        Found in src/lib/utils/is-type.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return new ArrayIterator([obj]);
                          Severity: Major
                          Found in src/lib/iteration/iterator-factory.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
                            Severity: Major
                            Found in src/lib/runtime/compare.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return compute31BitObjecHash(obj, strict);
                              Severity: Major
                              Found in src/lib/runtime/hash.js - About 30 mins to fix

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

                                    setEquals: function (other) {
                                        assertNotNull(other);
                                
                                        if (areEqualityComparersEqual(this, other)) {
                                            if (this.count() !== other.count()) {
                                Severity: Minor
                                Found in src/lib/collections/hash-set.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

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

                                    entries: function (keysOnly) {
                                        var arr = new Array(this.count()),
                                            slot = null,
                                            index = 0;
                                
                                
                                Severity: Minor
                                Found in src/lib/collections/hash-table.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

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

                                    addLast: function (value) {
                                        var node;
                                
                                        if (value instanceof LinkedListNode) {
                                            node = value;
                                Severity: Minor
                                Found in src/lib/collections/linked-list.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

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

                                    from: function (value) {
                                        if (value === null || value === undefined || value === defaultComparer) {
                                            return defaultComparer;
                                        }
                                
                                
                                Severity: Minor
                                Found in src/lib/collections/comparer.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

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

                                export default function Dictionary(value, comparer) {
                                    var dic = isType(value, Dictionary) ? value : null,
                                        cmp = EqualityComparer.from(dic ? comparer : value),
                                        table = new HashTable(cmp, dic ? dic.count() : (isNumber(value) ? value : 0));
                                
                                
                                Severity: Minor
                                Found in src/lib/collections/dictionary.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