multiplex/multiplex.js

View on GitHub
src/lib/collections/linked-list.js

Summary

Maintainability
C
1 day
Test Coverage

Function findLast has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    findLast: function (value) {
        if (this.head === null) {
            return null;
        }

Severity: Minor
Found in src/lib/collections/linked-list.js - About 2 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 find has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    find: function (value) {
        var node = this.head;

        if (node !== null) {
            if (value !== null) {
Severity: Minor
Found in src/lib/collections/linked-list.js - About 2 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

File linked-list.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Collection from './collection';
import Iterator from '../iteration/iterator';
import LinkedListNode from './linked-list-node';
import forOf from '../utils/for-of';
import assertType from '../utils/assert-type';
Severity: Minor
Found in src/lib/collections/linked-list.js - About 2 hrs to fix

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

    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 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 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 addFirst has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            addFirst: 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

        There are no issues that match your filters.

        Category
        Status