enclose-io/compiler

View on GitHub
lts/lib/internal/util/comparisons.js

Summary

Maintainability
F
1 mo
Test Coverage

Function innerDeepEqual has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
Open

function innerDeepEqual(val1, val2, strict, memos) {
  // All identical values are equivalent, as determined by ===.
  if (val1 === val2) {
    if (val1 !== 0)
      return true;
Severity: Minor
Found in lts/lib/internal/util/comparisons.js - About 1 day 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 comparisons.js has 506 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const {
  ArrayIsArray,
  BigIntPrototypeValueOf,
Severity: Major
Found in lts/lib/internal/util/comparisons.js - About 1 day to fix

    Function keyCheck has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

    function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
      // For all remaining Object pairs, including Array, objects and Maps,
      // equivalence is determined by having:
      // a) The same number of owned enumerable properties
      // b) The same set of keys/indexes (although not necessarily the same order)
    Severity: Minor
    Found in lts/lib/internal/util/comparisons.js - About 6 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 mapEquiv has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    function mapEquiv(a, b, strict, memo) {
      let set = null;
    
      for (const [key, item1] of a) {
        if (typeof key === 'object' && key !== null) {
    Severity: Minor
    Found in lts/lib/internal/util/comparisons.js - About 5 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 objEquiv has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    function objEquiv(a, b, strict, keys, memos, iterationType) {
      // Sets and maps don't have their entries accessible via normal object
      // properties.
      let i = 0;
    
    
    Severity: Minor
    Found in lts/lib/internal/util/comparisons.js - About 5 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 innerDeepEqual has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function innerDeepEqual(val1, val2, strict, memos) {
      // All identical values are equivalent, as determined by ===.
      if (val1 === val2) {
        if (val1 !== 0)
          return true;
    Severity: Major
    Found in lts/lib/internal/util/comparisons.js - About 4 hrs to fix

      Function setEquiv has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

      function setEquiv(a, b, strict, memo) {
        // This is a lazily initiated Set of entries which have to be compared
        // pairwise.
        let set = null;
        for (const val of a) {
      Severity: Minor
      Found in lts/lib/internal/util/comparisons.js - About 3 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 keyCheck has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
        // For all remaining Object pairs, including Array, objects and Maps,
        // equivalence is determined by having:
        // a) The same number of owned enumerable properties
        // b) The same set of keys/indexes (although not necessarily the same order)
      Severity: Major
      Found in lts/lib/internal/util/comparisons.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

          } else if (ArrayIsArray(val2) ||
                     isArrayBufferView(val2) ||
                     isSet(val2) ||
                     isMap(val2) ||
                     isDate(val2) ||
        Severity: Critical
        Found in lts/lib/internal/util/comparisons.js - About 2 hrs to fix

          Function objEquiv has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function objEquiv(a, b, strict, keys, memos, iterationType) {
            // Sets and maps don't have their entries accessible via normal object
            // properties.
            let i = 0;
          
          
          Severity: Minor
          Found in lts/lib/internal/util/comparisons.js - About 1 hr to fix

            Function mapEquiv has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function mapEquiv(a, b, strict, memo) {
              let set = null;
            
              for (const [key, item1] of a) {
                if (typeof key === 'object' && key !== null) {
            Severity: Minor
            Found in lts/lib/internal/util/comparisons.js - About 1 hr to fix

              Function setEquiv has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function setEquiv(a, b, strict, memo) {
                // This is a lazily initiated Set of entries which have to be compared
                // pairwise.
                let set = null;
                for (const val of a) {
              Severity: Minor
              Found in lts/lib/internal/util/comparisons.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                      if (ObjectPrototypeHasOwnProperty(a, i)) {
                        if (!ObjectPrototypeHasOwnProperty(b, i) ||
                            !innerDeepEqual(a[i], b[i], strict, memos)) {
                          return false;
                        }
                Severity: Major
                Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                  Function objEquiv has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function objEquiv(a, b, strict, keys, memos, iterationType) {
                  Severity: Minor
                  Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                        if ((!isNativeError(val2) && !(val2 instanceof Error)) ||
                            val1.message !== val2.message ||
                            val1.name !== val2.name) {
                          return false;
                        }
                    Severity: Major
                    Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                      Function mapHasEqualEntry has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
                      Severity: Minor
                      Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (!ObjectPrototypePropertyIsEnumerable(val2, key)) {
                                    return false;
                                  }
                        Severity: Major
                        Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  } else if (ObjectPrototypePropertyIsEnumerable(val2, key)) {
                                    return false;
                                  }
                          Severity: Major
                          Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                            Function keyCheck has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
                            Severity: Minor
                            Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                } else if (isArrayBufferView(val1)) {
                                  if (!isIdenticalTypedArrayType(val1, val2))
                                    return false;
                                  if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
                                    if (!areSimilarFloatArrays(val1, val2)) {
                              Severity: Major
                              Found in lts/lib/internal/util/comparisons.js - About 45 mins to fix

                                Function mapMightHaveLoosePrim has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                function mapMightHaveLoosePrim(a, b, prim, item, memo) {
                                Severity: Minor
                                Found in lts/lib/internal/util/comparisons.js - About 35 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return keyCheck(val1, val2, strict, memos, kNoIterator);
                                  Severity: Major
                                  Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          return false;
                                    Severity: Major
                                    Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return false;
                                      Severity: Major
                                      Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return false;
                                        Severity: Major
                                        Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                return false;
                                          Severity: Major
                                          Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                return keyCheck(val1, val2, strict, memos, kNoIterator, keys1);
                                            Severity: Major
                                            Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                return true;
                                              Severity: Major
                                              Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                      return false;
                                                Severity: Major
                                                Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                          return val1 == val2;
                                                  Severity: Major
                                                  Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                          return false;
                                                    Severity: Major
                                                    Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                            return false;
                                                      Severity: Major
                                                      Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                            return true;
                                                        Severity: Major
                                                        Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                  return true;
                                                          Severity: Major
                                                          Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                  return false;
                                                            Severity: Major
                                                            Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                    return false;
                                                              Severity: Major
                                                              Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                      return false;
                                                                Severity: Major
                                                                Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                      return keyCheck(val1, val2, strict, memos, kIsSet);
                                                                  Severity: Major
                                                                  Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                        return set.size === 0;
                                                                    Severity: Major
                                                                    Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                            return false;
                                                                      Severity: Major
                                                                      Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                              return false;
                                                                        Severity: Major
                                                                        Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                          Avoid too many return statements within this function.
                                                                          Open

                                                                              return keyCheck(val1, val2, strict, memos, kIsMap);
                                                                          Severity: Major
                                                                          Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                                      return false;
                                                                            Severity: Major
                                                                            Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                  return isSymbolObject(val2) &&
                                                                                        SymbolPrototypeValueOf(val1) === SymbolPrototypeValueOf(val2);
                                                                              Severity: Major
                                                                              Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                    return keyCheck(val1, val2, strict, memos, kIsArray, keys1);
                                                                                Severity: Major
                                                                                Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                        return false;
                                                                                  Severity: Major
                                                                                  Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                            return false;
                                                                                    Severity: Major
                                                                                    Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                        return true;
                                                                                      Severity: Major
                                                                                      Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                              return false;
                                                                                        Severity: Major
                                                                                        Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                                return false;
                                                                                          Severity: Major
                                                                                          Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                                  return false;
                                                                                            Severity: Major
                                                                                            Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                      return false;
                                                                                              Severity: Major
                                                                                              Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                  return areEq;
                                                                                                Severity: Major
                                                                                                Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                      return set.size === 0;
                                                                                                  Severity: Major
                                                                                                  Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                                return false;
                                                                                                    Severity: Major
                                                                                                    Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                            return false;
                                                                                                      Severity: Major
                                                                                                      Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                            return false;
                                                                                                        Severity: Major
                                                                                                        Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                  return false;
                                                                                                          Severity: Major
                                                                                                          Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                              return keyCheck(val1, val2, strict, memos, kNoIterator);
                                                                                                            Severity: Major
                                                                                                            Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                      return val2MemoA === val2MemoB;
                                                                                                              Severity: Major
                                                                                                              Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                  return true;
                                                                                                                Severity: Major
                                                                                                                Found in lts/lib/internal/util/comparisons.js - About 30 mins to fix

                                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                    if (ArrayIsArray(val1)) {
                                                                                                                      // Check for sparse arrays and general fast path
                                                                                                                      if (!ArrayIsArray(val2) || val1.length !== val2.length) {
                                                                                                                        return false;
                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 4 days to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 208..288

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 741.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
                                                                                                                    // For all remaining Object pairs, including Array, objects and Maps,
                                                                                                                    // equivalence is determined by having:
                                                                                                                    // a) The same number of owned enumerable properties
                                                                                                                    // b) The same set of keys/indexes (although not necessarily the same order)
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 3 days to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 296..389

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 660.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function objEquiv(a, b, strict, keys, memos, iterationType) {
                                                                                                                    // Sets and maps don't have their entries accessible via normal object
                                                                                                                    // properties.
                                                                                                                    let i = 0;
                                                                                                                  
                                                                                                                  
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 2 days to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 564..613

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 368.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function mapEquiv(a, b, strict, memo) {
                                                                                                                    let set = null;
                                                                                                                  
                                                                                                                    for (const [key, item1] of a) {
                                                                                                                      if (typeof key === 'object' && key !== null) {
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 1 day to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 517..562

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 353.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function setEquiv(a, b, strict, memo) {
                                                                                                                    // This is a lazily initiated Set of entries which have to be compared
                                                                                                                    // pairwise.
                                                                                                                    let set = null;
                                                                                                                    for (const val of a) {
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 1 day to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 450..500

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 299.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function isEqualBoxedPrimitive(val1, val2) {
                                                                                                                    if (isNumberObject(val1)) {
                                                                                                                      return isNumberObject(val2) &&
                                                                                                                             ObjectIs(NumberPrototypeValueOf(val1),
                                                                                                                                      NumberPrototypeValueOf(val2));
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 1 day to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 100..124

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 205.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function isIdenticalTypedArrayType(a, b) {
                                                                                                                    // Fast path to reduce type checks in the common case.
                                                                                                                    const check = types[`is${a[SymbolToStringTag]}`];
                                                                                                                    if (check !== undefined && check(a)) {
                                                                                                                      return check(b);
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 6 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 126..155

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 174.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  const {
                                                                                                                    isAnyArrayBuffer,
                                                                                                                    isArrayBufferView,
                                                                                                                    isDate,
                                                                                                                    isMap,
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 2 other locations - About 4 hrs to fix
                                                                                                                  current/lib/internal/modules/cjs/loader.js on lines 30..55
                                                                                                                  current/lib/internal/util/comparisons.js on lines 28..53

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 128.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function mapMightHaveLoosePrim(a, b, prim, item, memo) {
                                                                                                                    const altValue = findLooseMatchingPrimitives(prim);
                                                                                                                    if (altValue != null) {
                                                                                                                      return altValue;
                                                                                                                    }
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 4 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 437..448

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 118.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  const {
                                                                                                                    ArrayIsArray,
                                                                                                                    BigIntPrototypeValueOf,
                                                                                                                    BooleanPrototypeValueOf,
                                                                                                                    DatePrototypeGetTime,
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 2 other locations - About 3 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 3..23
                                                                                                                  lts/lib/internal/modules/cjs/loader.js on lines 24..44

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 103.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                    if (strict) {
                                                                                                                      if (typeof val1 !== 'object') {
                                                                                                                        return typeof val1 === 'number' && NumberIsNaN(val1) &&
                                                                                                                          NumberIsNaN(val2);
                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 3 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 178..200

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 96.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function findLooseMatchingPrimitives(prim) {
                                                                                                                    switch (typeof prim) {
                                                                                                                      case 'undefined':
                                                                                                                        return null;
                                                                                                                      case 'object': // Only pass in null as object!
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 2 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 408..427

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 85.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function areSimilarFloatArrays(a, b) {
                                                                                                                    if (a.byteLength !== b.byteLength) {
                                                                                                                      return false;
                                                                                                                    }
                                                                                                                    for (let offset = 0; offset < a.byteLength; offset++) {
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 2 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 75..85

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 84.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
                                                                                                                    // To be able to handle cases like:
                                                                                                                    //   Map([[{}, 'a'], [{}, 'b']]) vs Map([[{}, 'b'], [{}, 'a']])
                                                                                                                    // ... we need to consider *all* matching keys, not just the first we find.
                                                                                                                    for (const key2 of set) {
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 2 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 502..515

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 81.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function areSimilarTypedArrays(a, b) {
                                                                                                                    if (a.byteLength !== b.byteLength) {
                                                                                                                      return false;
                                                                                                                    }
                                                                                                                    return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength),
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 2 hrs to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 87..93

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 80.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function setHasEqualElement(set, val1, strict, memo) {
                                                                                                                    // Go looking.
                                                                                                                    for (const val2 of set) {
                                                                                                                      if (innerDeepEqual(val1, val2, strict, memo)) {
                                                                                                                        // Remove the matching element to make sure we do not check that again.
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 1 hr to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 391..402

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 65.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function setMightHaveLoosePrim(a, b, prim) {
                                                                                                                    const altValue = findLooseMatchingPrimitives(prim);
                                                                                                                    if (altValue != null)
                                                                                                                      return altValue;
                                                                                                                  
                                                                                                                  
                                                                                                                  Severity: Major
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 1 hr to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 429..435

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 58.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  Identical blocks of code found in 2 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                  function areEqualArrayBuffers(buf1, buf2) {
                                                                                                                    return buf1.byteLength === buf2.byteLength &&
                                                                                                                      compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
                                                                                                                  }
                                                                                                                  Severity: Minor
                                                                                                                  Found in lts/lib/internal/util/comparisons.js and 1 other location - About 35 mins to fix
                                                                                                                  current/lib/internal/util/comparisons.js on lines 95..98

                                                                                                                  Duplicated Code

                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                  Tuning

                                                                                                                  This issue has a mass of 46.

                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                  Refactorings

                                                                                                                  Further Reading

                                                                                                                  There are no issues that match your filters.

                                                                                                                  Category
                                                                                                                  Status