enclose-io/compiler

View on GitHub
lts/lib/assert.js

Summary

Maintainability
F
1 mo
Test Coverage

File assert.js has 721 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Originally from narwhal.js (http://narwhaljs.org)
// Copyright (c) 2009 Thomas Robinson <280north.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the 'Software'), to
Severity: Major
Found in lts/lib/assert.js - About 1 day to fix

    Function expectedException has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    function expectedException(actual, expected, message, fn) {
      let generatedMessage = false;
      let throwError = false;
    
      if (typeof expected !== 'function') {
    Severity: Minor
    Found in lts/lib/assert.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getErrMessage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

    function getErrMessage(message, fn) {
      const tmpLimit = Error.stackTraceLimit;
      // Make sure the limit is set to 1. Otherwise it could fail (<= 0) or it
      // does to much work.
      Error.stackTraceLimit = 1;
    Severity: Minor
    Found in lts/lib/assert.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 getErrMessage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function getErrMessage(message, fn) {
      const tmpLimit = Error.stackTraceLimit;
      // Make sure the limit is set to 1. Otherwise it could fail (<= 0) or it
      // does to much work.
      Error.stackTraceLimit = 1;
    Severity: Major
    Found in lts/lib/assert.js - About 2 hrs to fix

      Function expectedException has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function expectedException(actual, expected, message, fn) {
        let generatedMessage = false;
        let throwError = false;
      
        if (typeof expected !== 'function') {
      Severity: Major
      Found in lts/lib/assert.js - About 2 hrs to fix

        Function expectsError has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        function expectsError(stackStartFn, actual, error, message) {
          if (typeof error === 'string') {
            if (arguments.length === 4) {
              throw new ERR_INVALID_ARG_TYPE('error',
                                             ['Object', 'Error', 'Function', 'RegExp'],
        Severity: Minor
        Found in lts/lib/assert.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function ifError has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

        assert.ifError = function ifError(err) {
          if (err !== null && err !== undefined) {
            let message = 'ifError got unwanted exception: ';
            if (typeof err === 'object' && typeof err.message === 'string') {
              if (err.message.length === 0 && err.constructor) {
        Severity: Minor
        Found in lts/lib/assert.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function expectsError has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function expectsError(stackStartFn, actual, error, message) {
          if (typeof error === 'string') {
            if (arguments.length === 4) {
              throw new ERR_INVALID_ARG_TYPE('error',
                                             ['Object', 'Error', 'Function', 'RegExp'],
        Severity: Minor
        Found in lts/lib/assert.js - About 1 hr to fix

          Function getCode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

          function getCode(fd, line, column) {
            let bytesRead = 0;
            if (line === 0) {
              // Special handle line number one. This is more efficient and simplifies the
              // rest of the algorithm. Read more than the regular column number in bytes
          Severity: Minor
          Found in lts/lib/assert.js - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function parseCode has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function parseCode(code, offset) {
            // Lazy load acorn.
            if (parseExpressionAt === undefined) {
              const acorn = require('internal/deps/acorn/acorn/dist/acorn');
              const privateMethods =
          Severity: Minor
          Found in lts/lib/assert.js - About 1 hr to fix

            Function fail has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            function fail(actual, expected, message, operator, stackStartFn) {
              const argsLen = arguments.length;
            
              let internalMessage = false;
              if (actual == null && argsLen <= 1) {
            Severity: Minor
            Found in lts/lib/assert.js - About 1 hr to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function fail has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function fail(actual, expected, message, operator, stackStartFn) {
              const argsLen = arguments.length;
            
              let internalMessage = false;
              if (actual == null && argsLen <= 1) {
            Severity: Minor
            Found in lts/lib/assert.js - About 1 hr to fix

              Function ifError has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              assert.ifError = function ifError(err) {
                if (err !== null && err !== undefined) {
                  let message = 'ifError got unwanted exception: ';
                  if (typeof err === 'object' && typeof err.message === 'string') {
                    if (err.message.length === 0 && err.constructor) {
              Severity: Minor
              Found in lts/lib/assert.js - About 1 hr to fix

                Function internalMatch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function internalMatch(string, regexp, message, fn) {
                  if (!isRegExp(regexp)) {
                    throw new ERR_INVALID_ARG_TYPE(
                      'regexp', 'RegExp', regexp
                    );
                Severity: Minor
                Found in lts/lib/assert.js - About 1 hr to fix

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

                  function internalMatch(string, regexp, message, fn) {
                    if (!isRegExp(regexp)) {
                      throw new ERR_INVALID_ARG_TYPE(
                        'regexp', 'RegExp', regexp
                      );
                  Severity: Minor
                  Found in lts/lib/assert.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  function expectsNoError(stackStartFn, actual, error, message) {
                    if (actual === NO_EXCEPTION_SENTINEL)
                      return;
                  
                    if (typeof error === 'string') {
                  Severity: Minor
                  Found in lts/lib/assert.js - About 55 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  function compareExceptionKey(actual, expected, key, message, keys, fn) {
                  Severity: Minor
                  Found in lts/lib/assert.js - About 45 mins to fix

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

                      constructor(obj, keys, actual) {
                        for (const key of keys) {
                          if (key in obj) {
                            if (actual !== undefined &&
                                typeof actual[key] === 'string' &&
                    Severity: Minor
                    Found in lts/lib/assert.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                    function findColumn(fd, column, code) {
                      if (code.length > column + 100) {
                        try {
                          return parseCode(code, column);
                        } catch {
                    Severity: Minor
                    Found in lts/lib/assert.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                    function parseCode(code, offset) {
                      // Lazy load acorn.
                      if (parseExpressionAt === undefined) {
                        const acorn = require('internal/deps/acorn/acorn/dist/acorn');
                        const privateMethods =
                    Severity: Minor
                    Found in lts/lib/assert.js - About 45 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Avoid deeply nested control flow statements.
                    Open

                            if (typeof actual[key] === 'string' &&
                                isRegExp(expected[key]) &&
                                RegExpPrototypeTest(expected[key], actual[key])) {
                              continue;
                            }
                    Severity: Major
                    Found in lts/lib/assert.js - About 45 mins to fix

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

                      function fail(actual, expected, message, operator, stackStartFn) {
                      Severity: Minor
                      Found in lts/lib/assert.js - About 35 mins to fix

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

                        async function waitForActual(promiseFn) {
                          let resultPromise;
                          if (typeof promiseFn === 'function') {
                            // Return a rejected promise if `promiseFn` throws synchronously.
                            resultPromise = promiseFn();
                        Severity: Minor
                        Found in lts/lib/assert.js - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

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

                          try {
                            // Set the stack trace limit to zero. This makes sure unexpected token
                            // errors are handled faster.
                            Error.stackTraceLimit = 0;
                        
                        
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 days to fix
                        current/lib/assert.js on lines 310..360

                        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 415.

                        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

                        assert.ifError = function ifError(err) {
                          if (err !== null && err !== undefined) {
                            let message = 'ifError got unwanted exception: ';
                            if (typeof err === 'object' && typeof err.message === 'string') {
                              if (err.message.length === 0 && err.constructor) {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 days to fix
                        current/lib/assert.js on lines 841..887

                        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 366.

                        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 expectsError(stackStartFn, actual, error, message) {
                          if (typeof error === 'string') {
                            if (arguments.length === 4) {
                              throw new ERR_INVALID_ARG_TYPE('error',
                                                             ['Object', 'Error', 'Function', 'RegExp'],
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 days to fix
                        current/lib/assert.js on lines 728..778

                        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 363.

                        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 (typeof expected !== 'function') {
                            // Handle regular expressions.
                            if (isRegExp(expected)) {
                              const str = String(actual);
                              if (RegExpPrototypeTest(expected, str))
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 day to fix
                        current/lib/assert.js on lines 579..666

                        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 333.

                        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 parseCode(code, offset) {
                          // Lazy load acorn.
                          if (parseExpressionAt === undefined) {
                            const acorn = require('internal/deps/acorn/acorn/dist/acorn');
                            const privateMethods =
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 day to fix
                        current/lib/assert.js on lines 215..264

                        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 286.

                        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 getCode(fd, line, column) {
                          let bytesRead = 0;
                          if (line === 0) {
                            // Special handle line number one. This is more efficient and simplifies the
                            // rest of the algorithm. Read more than the regular column number in bytes
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 day to fix
                        current/lib/assert.js on lines 178..213

                        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 279.

                        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 fail(actual, expected, message, operator, stackStartFn) {
                          const argsLen = arguments.length;
                        
                          let internalMessage = false;
                          if (actual == null && argsLen <= 1) {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 day to fix
                        current/lib/assert.js on lines 106..144

                        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 234.

                        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 internalMatch(string, regexp, message, fn) {
                          if (!isRegExp(regexp)) {
                            throw new ERR_INVALID_ARG_TYPE(
                              'regexp', 'RegExp', regexp
                            );
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 day to fix
                        current/lib/assert.js on lines 889..922

                        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 234.

                        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 findColumn(fd, column, code) {
                          if (code.length > column + 100) {
                            try {
                              return parseCode(code, column);
                            } catch {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 7 hrs to fix
                        current/lib/assert.js on lines 151..176

                        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 191.

                        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 compareExceptionKey(actual, expected, key, message, keys, fn) {
                          if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {
                            if (!message) {
                              // Create placeholder objects to create a nice output.
                              const a = new Comparison(actual, keys);
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 7 hrs to fix
                        current/lib/assert.js on lines 547..573

                        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 191.

                        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 expectsNoError(stackStartFn, actual, error, message) {
                          if (actual === NO_EXCEPTION_SENTINEL)
                            return;
                        
                          if (typeof error === 'string') {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 7 hrs to fix
                        current/lib/assert.js on lines 800..823

                        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 183.

                        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 innerOk(fn, argLen, value, message) {
                          if (!value) {
                            let generatedMessage = false;
                        
                            if (argLen === 0) {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 5 hrs to fix
                        current/lib/assert.js on lines 363..387

                        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 153.

                        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 hasMatchingError(actual, expected) {
                          if (typeof expected !== 'function') {
                            if (isRegExp(expected)) {
                              const str = String(actual);
                              return RegExpPrototypeTest(expected, str);
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 4 hrs to fix
                        current/lib/assert.js on lines 780..798

                        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 130.

                        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

                        class Comparison {
                          constructor(obj, keys, actual) {
                            for (const key of keys) {
                              if (key in obj) {
                                if (actual !== undefined &&
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 4 hrs to fix
                        current/lib/assert.js on lines 530..545

                        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 129.

                        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

                        async function waitForActual(promiseFn) {
                          let resultPromise;
                          if (typeof promiseFn === 'function') {
                            // Return a rejected promise if `promiseFn` throws synchronously.
                            resultPromise = promiseFn();
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 4 hrs to fix
                        current/lib/assert.js on lines 703..726

                        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 125.

                        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

                        assert.deepEqual = function deepEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (isDeepEqual === undefined) lazyLoadComparison();
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 3 hrs to fix
                        current/lib/assert.js on lines 433..447

                        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 109.

                        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

                        assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (isDeepEqual === undefined) lazyLoadComparison();
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 3 hrs to fix
                        current/lib/assert.js on lines 450..464

                        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 107.

                        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

                        assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (isDeepEqual === undefined) lazyLoadComparison();
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 3 hrs to fix
                        current/lib/assert.js on lines 467..481

                        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 107.

                        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 notDeepStrictEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (isDeepEqual === undefined) lazyLoadComparison();
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        current/lib/assert.js on lines 484..498

                        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 93.

                        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

                        assert.strictEqual = function strictEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (!ObjectIs(actual, expected)) {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        current/lib/assert.js on lines 500..513

                        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 91.

                        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

                        assert.equal = function equal(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          // eslint-disable-next-line eqeqeq
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        lts/lib/assert.js on lines 416..430

                        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 91.

                        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

                        assert.notEqual = function notEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          // eslint-disable-next-line eqeqeq
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        lts/lib/assert.js on lines 398..412

                        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 91.

                        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

                        assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
                          if (arguments.length < 2) {
                            throw new ERR_MISSING_ARGS('actual', 'expected');
                          }
                          if (ObjectIs(actual, expected)) {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        current/lib/assert.js on lines 515..528

                        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 89.

                        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 (filename) {
                            identifier = `${filename}${line}${column}`;
                        
                            // Skip Node.js modules!
                            if (filename.endsWith('.js') &&
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 2 hrs to fix
                        current/lib/assert.js on lines 287..303

                        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 83.

                        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 checkIsPromise(obj) {
                          // Accept native ES6 promises and promises that are implemented in a similar
                          // way. Do not accept thenables that use a function as `obj` and that have no
                          // `catch` handler.
                          return isPromise(obj) ||
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 hr to fix
                        current/lib/assert.js on lines 693..701

                        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 66.

                        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 (throwError) {
                            const err = new AssertionError({
                              actual,
                              expected,
                              message,
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 hr to fix
                        current/lib/assert.js on lines 668..678

                        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 62.

                        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 getActual(fn) {
                          if (typeof fn !== 'function') {
                            throw new ERR_INVALID_ARG_TYPE('fn', 'Function', fn);
                          }
                          try {
                        Severity: Major
                        Found in lts/lib/assert.js and 1 other location - About 1 hr to fix
                        current/lib/assert.js on lines 681..691

                        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 57.

                        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

                        assert.strict = ObjectAssign(strict, assert, {
                          equal: assert.strictEqual,
                          deepEqual: assert.deepStrictEqual,
                          notEqual: assert.notStrictEqual,
                          notDeepEqual: assert.notDeepStrictEqual
                        Severity: Minor
                        Found in lts/lib/assert.js and 1 other location - About 55 mins to fix
                        current/lib/assert.js on lines 938..943

                        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 54.

                        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