enclose-io/compiler

View on GitHub
current/lib/internal/util/inspect.js

Summary

Maintainability
F
3 mos
Test Coverage

File inspect.js has 1739 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

const {
  Array,
  ArrayIsArray,
Severity: Major
Found in current/lib/internal/util/inspect.js - About 4 days to fix

    Function formatRaw has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring.
    Open

    function formatRaw(ctx, value, recurseTimes, typedArray) {
      let keys;
      let protoProps;
      if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null)) {
        protoProps = [];
    Severity: Minor
    Found in current/lib/internal/util/inspect.js - About 2 days 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

    Consider simplifying this complex logical expression.
    Open

    if (internalBinding('config').hasIntl) {
      const icu = internalBinding('icu');
      // icu.getStringWidth(string, ambiguousAsFullWidth, expandEmojiSequence)
      // Defaults: ambiguousAsFullWidth = false; expandEmojiSequence = true;
      // TODO(BridgeAR): Expose the options to the user. That is probably the
    Severity: Critical
    Found in current/lib/internal/util/inspect.js - About 1 day to fix

      Function formatWithOptionsInternal has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

      function formatWithOptionsInternal(inspectOptions, ...args) {
        const first = args[0];
        let a = 0;
        let str = '';
        let join = '';
      Severity: Minor
      Found in current/lib/internal/util/inspect.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

      Function formatRaw has 224 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function formatRaw(ctx, value, recurseTimes, typedArray) {
        let keys;
        let protoProps;
        if (ctx.showHidden && (recurseTimes <= ctx.depth || ctx.depth === null)) {
          protoProps = [];
      Severity: Major
      Found in current/lib/internal/util/inspect.js - About 1 day to fix

        Function formatError has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

        function formatError(err, constructor, tag, ctx, keys) {
          const name = err.name != null ? String(err.name) : 'Error';
          let len = name.length;
          let stack = err.stack ? String(err.stack) : ErrorPrototypeToString(err);
        
        
        Severity: Minor
        Found in current/lib/internal/util/inspect.js - About 7 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 groupArrayElements has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

        function groupArrayElements(ctx, output, value) {
          let totalLength = 0;
          let maxLength = 0;
          let i = 0;
          let outputLength = output.length;
        Severity: Minor
        Found in current/lib/internal/util/inspect.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 formatProperty has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

        function formatProperty(ctx, value, recurseTimes, key, type, desc) {
          let name, str;
          let extra = ' ';
          desc = desc || ObjectGetOwnPropertyDescriptor(value, key) ||
            { value: value[key], enumerable: true };
        Severity: Minor
        Found in current/lib/internal/util/inspect.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 formatWithOptionsInternal has 114 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function formatWithOptionsInternal(inspectOptions, ...args) {
          const first = args[0];
          let a = 0;
          let str = '';
          let join = '';
        Severity: Major
        Found in current/lib/internal/util/inspect.js - About 4 hrs to fix

          Function addPrototypeProperties has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

          function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
            let depth = 0;
            let keys;
            let keySet;
            do {
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 isFullWidthCodePoint has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

            const isFullWidthCodePoint = (code) => {
              // Code points are partially derived from:
              // https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
              return code >= 0x1100 && (
                code <= 0x115f ||  // Hangul Jamo
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 formatValue has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function formatValue(ctx, value, recurseTimes, typedArray) {
            // Primitive types cannot have properties.
            if (typeof value !== 'object' &&
                typeof value !== 'function' &&
                !isUndetectableObject(value)) {
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 reduceToSingleString has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function reduceToSingleString(
            ctx, output, base, braces, extrasType, recurseTimes, value) {
            if (ctx.compact !== true) {
              if (typeof ctx.compact === 'number' && ctx.compact >= 1) {
                // Memorize the original output length. In case the the output is grouped,
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 inspect has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

          function inspect(value, opts) {
            // Default options
            const ctx = {
              budget: {},
              indentationLvl: 0,
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 formatSpecialArray has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

          function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) {
            const keys = ObjectKeys(value);
            let index = i;
            for (; i < keys.length && output.length < maxLength; i++) {
              const key = keys[i];
          Severity: Minor
          Found in current/lib/internal/util/inspect.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 groupArrayElements has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function groupArrayElements(ctx, output, value) {
            let totalLength = 0;
            let maxLength = 0;
            let i = 0;
            let outputLength = output.length;
          Severity: Major
          Found in current/lib/internal/util/inspect.js - About 3 hrs to fix

            Function formatError has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function formatError(err, constructor, tag, ctx, keys) {
              const name = err.name != null ? String(err.name) : 'Error';
              let len = name.length;
              let stack = err.stack ? String(err.stack) : ErrorPrototypeToString(err);
            
            
            Severity: Major
            Found in current/lib/internal/util/inspect.js - About 2 hrs to fix

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

              function strEscape(str) {
                let escapeTest = strEscapeSequencesRegExp;
                let escapeReplace = strEscapeSequencesReplacer;
                let singleQuote = 39;
              
              
              Severity: Minor
              Found in current/lib/internal/util/inspect.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 formatProperty has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function formatProperty(ctx, value, recurseTimes, key, type, desc) {
                let name, str;
                let extra = ' ';
                desc = desc || ObjectGetOwnPropertyDescriptor(value, key) ||
                  { value: value[key], enumerable: true };
              Severity: Major
              Found in current/lib/internal/util/inspect.js - About 2 hrs to fix

                Function getConstructorName has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                function getConstructorName(obj, ctx, recurseTimes, protoProps) {
                  let firstProto;
                  const tmp = obj;
                  while (obj || isUndetectableObject(obj)) {
                    const descriptor = ObjectGetOwnPropertyDescriptor(obj, 'constructor');
                Severity: Minor
                Found in current/lib/internal/util/inspect.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 formatValue has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function formatValue(ctx, value, recurseTimes, typedArray) {
                  // Primitive types cannot have properties.
                  if (typeof value !== 'object' &&
                      typeof value !== 'function' &&
                      !isUndetectableObject(value)) {
                Severity: Minor
                Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                  function inspect(value, opts) {
                    // Default options
                    const ctx = {
                      budget: {},
                      indentationLvl: 0,
                  Severity: Minor
                  Found in current/lib/internal/util/inspect.js - About 1 hr to fix

                    Function addPrototypeProperties has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
                      let depth = 0;
                      let keys;
                      let keySet;
                      do {
                    Severity: Minor
                    Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                        const isZeroWidthCodePoint = (code) => {
                          return code <= 0x1F || // C0 control codes
                            (code >= 0x7F && code <= 0x9F) || // C1 control codes
                            (code >= 0x300 && code <= 0x36F) || // Combining Diacritical Marks
                            (code >= 0x200B && code <= 0x200F) || // Modifying Invisible Characters
                      Severity: Minor
                      Found in current/lib/internal/util/inspect.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 getUserOptions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function getUserOptions(ctx, isCrossContext) {
                        const ret = {
                          stylize: ctx.stylize,
                          showHidden: ctx.showHidden,
                          depth: ctx.depth,
                      Severity: Minor
                      Found in current/lib/internal/util/inspect.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 strEscape has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function strEscape(str) {
                        let escapeTest = strEscapeSequencesRegExp;
                        let escapeReplace = strEscapeSequencesReplacer;
                        let singleQuote = 39;
                      
                      
                      Severity: Minor
                      Found in current/lib/internal/util/inspect.js - About 1 hr to fix

                        Function getBoxedBase has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function getBoxedBase(value, ctx, keys, constructor, tag) {
                          let fn;
                          let type;
                          if (isNumberObject(value)) {
                            fn = NumberPrototypeValueOf;
                        Severity: Minor
                        Found in current/lib/internal/util/inspect.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 getConstructorName has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getConstructorName(obj, ctx, recurseTimes, protoProps) {
                          let firstProto;
                          const tmp = obj;
                          while (obj || isUndetectableObject(obj)) {
                            const descriptor = ObjectGetOwnPropertyDescriptor(obj, 'constructor');
                        Severity: Minor
                        Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                          function getFunctionBase(value, constructor, tag) {
                            const stringified = FunctionPrototypeToString(value);
                            if (stringified.slice(0, 5) === 'class' && stringified.endsWith('}')) {
                              const slice = stringified.slice(5, -1);
                              const bracketIndex = slice.indexOf('{');
                          Severity: Minor
                          Found in current/lib/internal/util/inspect.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 formatPrimitive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function formatPrimitive(fn, value, ctx) {
                            if (typeof value === 'string') {
                              let trailer = '';
                              if (value.length > ctx.maxStringLength) {
                                const remaining = value.length - ctx.maxStringLength;
                          Severity: Minor
                          Found in current/lib/internal/util/inspect.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 formatSpecialArray has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) {
                            const keys = ObjectKeys(value);
                            let index = i;
                            for (; i < keys.length && output.length < maxLength; i++) {
                              const key = keys[i];
                          Severity: Minor
                          Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                            function getBoxedBase(value, ctx, keys, constructor, tag) {
                              let fn;
                              let type;
                              if (isNumberObject(value)) {
                                fn = NumberPrototypeValueOf;
                            Severity: Minor
                            Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                              function getFunctionBase(value, constructor, tag) {
                                const stringified = FunctionPrototypeToString(value);
                                if (stringified.slice(0, 5) === 'class' && stringified.endsWith('}')) {
                                  const slice = stringified.slice(5, -1);
                                  const bracketIndex = slice.indexOf('{');
                              Severity: Minor
                              Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                                function getUserOptions(ctx, isCrossContext) {
                                  const ret = {
                                    stylize: ctx.stylize,
                                    showHidden: ctx.showHidden,
                                    depth: ctx.depth,
                                Severity: Minor
                                Found in current/lib/internal/util/inspect.js - About 1 hr to fix

                                  Function formatMapIterInner has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function formatMapIterInner(ctx, recurseTimes, entries, state) {
                                    const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
                                    // Entries exist as [key1, val1, key2, val2, ...]
                                    const len = entries.length / 2;
                                    const remaining = len - maxArrayLength;
                                  Severity: Minor
                                  Found in current/lib/internal/util/inspect.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 formatMapIterInner has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function formatMapIterInner(ctx, recurseTimes, entries, state) {
                                    const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
                                    // Entries exist as [key1, val1, key2, val2, ...]
                                    const len = entries.length / 2;
                                    const remaining = len - maxArrayLength;
                                  Severity: Minor
                                  Found in current/lib/internal/util/inspect.js - About 1 hr to fix

                                    Function reduceToSingleString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function reduceToSingleString(
                                      ctx, output, base, braces, extrasType, recurseTimes, value) {
                                      if (ctx.compact !== true) {
                                        if (typeof ctx.compact === 'number' && ctx.compact >= 1) {
                                          // Memorize the original output length. In case the the output is grouped,
                                    Severity: Minor
                                    Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                                        getStringWidth = function getStringWidth(str, removeControlChars = true) {
                                          let width = 0;
                                      
                                          if (removeControlChars)
                                            str = stripVTControlCharacters(str);
                                      Severity: Minor
                                      Found in current/lib/internal/util/inspect.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 formatPrimitive has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      function formatPrimitive(fn, value, ctx) {
                                        if (typeof value === 'string') {
                                          let trailer = '';
                                          if (value.length > ctx.maxStringLength) {
                                            const remaining = value.length - ctx.maxStringLength;
                                      Severity: Minor
                                      Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                                        function formatTypedArray(value, length, ctx, ignored, recurseTimes) {
                                          const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
                                          const remaining = value.length - maxLength;
                                          const output = new Array(maxLength);
                                          const elementFormatter = value.length > 0 && typeof value[0] === 'number' ?
                                        Severity: Minor
                                        Found in current/lib/internal/util/inspect.js - About 1 hr to fix

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

                                          function getClassBase(value, constructor, tag) {
                                            const hasName = ObjectPrototypeHasOwnProperty(value, 'name');
                                            const name = (hasName && value.name) || '(anonymous)';
                                            let base = `class ${name}`;
                                            if (constructor !== 'Function' && constructor !== null) {
                                          Severity: Minor
                                          Found in current/lib/internal/util/inspect.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 reduceToSingleString has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                            ctx, output, base, braces, extrasType, recurseTimes, value) {
                                          Severity: Major
                                          Found in current/lib/internal/util/inspect.js - About 50 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                  if (prefix !== 'RegExp ')
                                                    base = `${prefix}${base}`;
                                            Severity: Major
                                            Found in current/lib/internal/util/inspect.js - About 45 mins to fix

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

                                                getStringWidth = function getStringWidth(str, removeControlChars = true) {
                                                  let width = 0;
                                              
                                                  if (removeControlChars)
                                                    str = stripVTControlCharacters(str);
                                              Severity: Minor
                                              Found in current/lib/internal/util/inspect.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 isBelowBreakLength has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              function isBelowBreakLength(ctx, output, start, base) {
                                                // Each entry is separated by at least a comma. Thus, we start with a total
                                                // length of at least `output.length`. In addition, some cases have a
                                                // whitespace in-between each other that is added to the total as well.
                                                // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
                                              Severity: Minor
                                              Found in current/lib/internal/util/inspect.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 tryStringify has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                              Open

                                              function tryStringify(arg) {
                                                try {
                                                  return JSONStringify(arg);
                                                } catch (err) {
                                                  // Populate the circular error message lazily
                                              Severity: Minor
                                              Found in current/lib/internal/util/inspect.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 ((keys.length === 0 && protoProps === undefined) ||
                                                        (recurseTimes > ctx.depth && ctx.depth !== null)) {
                                                      return ctx.stylize(base, 'regexp');
                                                    }
                                              Severity: Major
                                              Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                    } else if (isDate(value)) {
                                                      // Make dates with properties first say the date
                                                      base = NumberIsNaN(DatePrototypeGetTime(value)) ?
                                                        DatePrototypeToString(value) :
                                                        DatePrototypeToISOString(value);
                                                Severity: Major
                                                Found in current/lib/internal/util/inspect.js - About 45 mins to fix

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

                                                  function formatTypedArray(value, length, ctx, ignored, recurseTimes) {
                                                    const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
                                                    const remaining = value.length - maxLength;
                                                    const output = new Array(maxLength);
                                                    const elementFormatter = value.length > 0 && typeof value[0] === 'number' ?
                                                  Severity: Minor
                                                  Found in current/lib/internal/util/inspect.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 (size === 0 && keys.length === 0 && protoProps === undefined)
                                                          return `${prefix}{}`;
                                                  Severity: Major
                                                  Found in current/lib/internal/util/inspect.js - About 45 mins to fix

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

                                                    function formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) {
                                                    Severity: Minor
                                                    Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                if (lastPos !== i - 1) {
                                                                  str += first.slice(lastPos, i - 1);
                                                                }
                                                      Severity: Major
                                                      Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                            } else if (isTypedArray(value)) {
                                                              keys = getOwnNonIndexProperties(value, filter);
                                                              let bound = value;
                                                              let fallback = '';
                                                              if (constructor === null) {
                                                        Severity: Major
                                                        Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                    switch (nextChar) {
                                                                      case 115: // 's'
                                                                        const tempArg = args[++a];
                                                                        if (typeof tempArg === 'number') {
                                                                          tempStr = formatNumber(stylizeNoColor, tempArg);
                                                          Severity: Major
                                                          Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                    } else if (nextChar === 37) {
                                                                      str += first.slice(lastPos, i);
                                                                      lastPos = i + 1;
                                                                    }
                                                            Severity: Major
                                                            Found in current/lib/internal/util/inspect.js - About 45 mins to fix

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

                                                              function getKeys(value, showHidden) {
                                                                let keys;
                                                                const symbols = ObjectGetOwnPropertySymbols(value);
                                                                if (showHidden) {
                                                                  keys = ObjectGetOwnPropertyNames(value);
                                                              Severity: Minor
                                                              Found in current/lib/internal/util/inspect.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 formatProperty has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                              function formatProperty(ctx, value, recurseTimes, key, type, desc) {
                                                              Severity: Minor
                                                              Found in current/lib/internal/util/inspect.js - About 45 mins to fix

                                                                Consider simplifying this complex logical expression.
                                                                Open

                                                                    if (ctx.getters && (ctx.getters === true ||
                                                                          (ctx.getters === 'get' && desc.set === undefined) ||
                                                                          (ctx.getters === 'set' && desc.set !== undefined))) {
                                                                      try {
                                                                        const tmp = value[key];
                                                                Severity: Major
                                                                Found in current/lib/internal/util/inspect.js - About 40 mins to fix

                                                                  Consider simplifying this complex logical expression.
                                                                  Open

                                                                    if (constructor === null ||
                                                                        (name.endsWith('Error') &&
                                                                        stack.startsWith(name) &&
                                                                        (stack.length === len || stack[len] === ':' || stack[len] === '\n'))) {
                                                                      let fallback = 'Error';
                                                                  Severity: Major
                                                                  Found in current/lib/internal/util/inspect.js - About 40 mins to fix

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

                                                                    function addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
                                                                    Severity: Minor
                                                                    Found in current/lib/internal/util/inspect.js - About 35 mins to fix

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

                                                                      function getBoxedBase(value, ctx, keys, constructor, tag) {
                                                                      Severity: Minor
                                                                      Found in current/lib/internal/util/inspect.js - About 35 mins to fix

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

                                                                        function formatError(err, constructor, tag, ctx, keys) {
                                                                        Severity: Minor
                                                                        Found in current/lib/internal/util/inspect.js - About 35 mins to fix

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

                                                                          function formatTypedArray(value, length, ctx, ignored, recurseTimes) {
                                                                          Severity: Minor
                                                                          Found in current/lib/internal/util/inspect.js - About 35 mins to fix

                                                                            Avoid too many return statements within this function.
                                                                            Open

                                                                              return `${res} <${protoConstr}>`;
                                                                            Severity: Major
                                                                            Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                              Avoid too many return statements within this function.
                                                                              Open

                                                                                      return ctx.stylize(base, 'special');
                                                                              Severity: Major
                                                                              Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                Avoid too many return statements within this function.
                                                                                Open

                                                                                        return prefix +
                                                                                              `{ byteLength: ${formatNumber(ctx.stylize, value.byteLength)} }`;
                                                                                Severity: Major
                                                                                Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                  Avoid too many return statements within this function.
                                                                                  Open

                                                                                      return fn(`${value}`, 'boolean');
                                                                                  Severity: Major
                                                                                  Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                    Avoid too many return statements within this function.
                                                                                    Open

                                                                                        return ctx.stylize(constructorName, 'special');
                                                                                    Severity: Major
                                                                                    Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                      Avoid too many return statements within this function.
                                                                                      Open

                                                                                          return fn('undefined', 'undefined');
                                                                                      Severity: Major
                                                                                      Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                        Avoid too many return statements within this function.
                                                                                        Open

                                                                                                return `${getCtxStyle(value, constructor, tag)}{}`;
                                                                                        Severity: Major
                                                                                        Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                          Avoid too many return statements within this function.
                                                                                          Open

                                                                                              return handleMaxCallStackSize(ctx, err, constructorName, indentationLvl);
                                                                                          Severity: Major
                                                                                          Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                            Avoid too many return statements within this function.
                                                                                            Open

                                                                                              return fn(SymbolPrototypeToString(value), 'symbol');
                                                                                            Severity: Major
                                                                                            Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                              Avoid too many return statements within this function.
                                                                                              Open

                                                                                                        return ctx.stylize(`[External: ${address}]`, 'special');
                                                                                              Severity: Major
                                                                                              Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                Avoid too many return statements within this function.
                                                                                                Open

                                                                                                        return `${braces[0]}}`;
                                                                                                Severity: Major
                                                                                                Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                  Avoid too many return statements within this function.
                                                                                                  Open

                                                                                                    return res;
                                                                                                  Severity: Major
                                                                                                  Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                    Avoid too many return statements within this function.
                                                                                                    Open

                                                                                                        return ctx.stylize(`[Circular *${index}]`, 'special');
                                                                                                    Severity: Major
                                                                                                    Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                      Avoid too many return statements within this function.
                                                                                                      Open

                                                                                                              return ctx.stylize(base, 'regexp');
                                                                                                      Severity: Major
                                                                                                      Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                        Avoid too many return statements within this function.
                                                                                                        Open

                                                                                                          return formatRaw(ctx, value, recurseTimes, typedArray);
                                                                                                        Severity: Major
                                                                                                        Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                          Avoid too many return statements within this function.
                                                                                                          Open

                                                                                                                  return base;
                                                                                                          Severity: Major
                                                                                                          Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                    return base;
                                                                                                            Severity: Major
                                                                                                            Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                      return ret.replace(/\n/g, `\n${' '.repeat(ctx.indentationLvl)}`);
                                                                                                              Severity: Major
                                                                                                              Found in current/lib/internal/util/inspect.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                        return ctx.stylize(base, 'date');
                                                                                                                Severity: Major
                                                                                                                Found in current/lib/internal/util/inspect.js - About 30 mins to fix

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

                                                                                                                  function formatNamespaceObject(keys, ctx, value, recurseTimes) {
                                                                                                                    const output = new Array(keys.length);
                                                                                                                    for (let i = 0; i < keys.length; i++) {
                                                                                                                      try {
                                                                                                                        output[i] = formatProperty(ctx, value, recurseTimes, keys[i],
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js - About 25 mins to fix

                                                                                                                  Cognitive Complexity

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

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

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

                                                                                                                  Further reading

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

                                                                                                                  function formatArray(ctx, value, recurseTimes) {
                                                                                                                    const valLen = value.length;
                                                                                                                    const len = MathMin(MathMax(0, ctx.maxArrayLength), valLen);
                                                                                                                  
                                                                                                                    const remaining = valLen - len;
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.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

                                                                                                                  function formatError(err, constructor, tag, ctx, keys) {
                                                                                                                    const name = err.name != null ? String(err.name) : 'Error';
                                                                                                                    let len = name.length;
                                                                                                                    let stack = err.stack ? String(err.stack) : ErrorPrototypeToString(err);
                                                                                                                  
                                                                                                                  
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1121..1203

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

                                                                                                                  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 formatWithOptionsInternal(inspectOptions, ...args) {
                                                                                                                    const first = args[0];
                                                                                                                    let a = 0;
                                                                                                                    let str = '';
                                                                                                                    let join = '';
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1836..1954

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

                                                                                                                  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 formatProperty(ctx, value, recurseTimes, key, type, desc) {
                                                                                                                    let name, str;
                                                                                                                    let extra = ' ';
                                                                                                                    desc = desc || ObjectGetOwnPropertyDescriptor(value, key) ||
                                                                                                                      { value: value[key], enumerable: true };
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1634..1692

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

                                                                                                                  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 groupArrayElements(ctx, output, value) {
                                                                                                                    let totalLength = 0;
                                                                                                                    let maxLength = 0;
                                                                                                                    let i = 0;
                                                                                                                    let outputLength = output.length;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1205..1313

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

                                                                                                                  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 reduceToSingleString(
                                                                                                                    ctx, output, base, braces, extrasType, recurseTimes, value) {
                                                                                                                    if (ctx.compact !== true) {
                                                                                                                      if (typeof ctx.compact === 'number' && ctx.compact >= 1) {
                                                                                                                        // Memorize the original output length. In case the the output is grouped,
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 3 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1718..1776

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

                                                                                                                  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 inspect(value, opts) {
                                                                                                                    // Default options
                                                                                                                    const ctx = {
                                                                                                                      budget: {},
                                                                                                                      indentationLvl: 0,
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 240..294

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

                                                                                                                  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 addPrototypeProperties(ctx, main, obj, recurseTimes, output) {
                                                                                                                    let depth = 0;
                                                                                                                    let keys;
                                                                                                                    let keySet;
                                                                                                                    do {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 541..596

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

                                                                                                                  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 formatSpecialArray(ctx, value, recurseTimes, maxLength, output, i) {
                                                                                                                    const keys = ObjectKeys(value);
                                                                                                                    let index = i;
                                                                                                                    for (; i < keys.length && output.length < maxLength; i++) {
                                                                                                                      const key = keys[i];
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1397..1434

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

                                                                                                                  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

                                                                                                                  inspect.colors = ObjectAssign(ObjectCreate(null), {
                                                                                                                    reset: [0, 0],
                                                                                                                    bold: [1, 22],
                                                                                                                    dim: [2, 22], // Alias: faint
                                                                                                                    italic: [3, 23],
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 314..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 389.

                                                                                                                  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 formatMapIterInner(ctx, recurseTimes, entries, state) {
                                                                                                                    const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
                                                                                                                    // Entries exist as [key1, val1, key2, val2, ...]
                                                                                                                    const len = entries.length / 2;
                                                                                                                    const remaining = len - maxArrayLength;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1553..1589

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

                                                                                                                  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 formatPrimitive(fn, value, ctx) {
                                                                                                                    if (typeof value === 'string') {
                                                                                                                      let trailer = '';
                                                                                                                      if (value.length > ctx.maxStringLength) {
                                                                                                                        const remaining = value.length - ctx.maxStringLength;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 days to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1337..1367

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

                                                                                                                  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

                                                                                                                      } else if (isMap(value)) {
                                                                                                                        const size = mapSizeGetter(value);
                                                                                                                        const prefix = getPrefix(constructor, tag, 'Map', `(${size})`);
                                                                                                                        keys = getKeys(value, ctx.showHidden);
                                                                                                                        formatter = constructor !== null ?
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 816..857

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

                                                                                                                  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 getBoxedBase(value, ctx, keys, constructor, tag) {
                                                                                                                    let fn;
                                                                                                                    let type;
                                                                                                                    if (isNumberObject(value)) {
                                                                                                                      fn = NumberPrototypeValueOf;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1024..1062

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

                                                                                                                  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

                                                                                                                    const isFullWidthCodePoint = (code) => {
                                                                                                                      // Code points are partially derived from:
                                                                                                                      // https://www.unicode.org/Public/UNIDATA/EastAsianWidth.txt
                                                                                                                      return code >= 0x1100 && (
                                                                                                                        code <= 0x115f ||  // Hangul Jamo
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 2010..2046

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

                                                                                                                  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 formatTypedArray(value, length, ctx, ignored, recurseTimes) {
                                                                                                                    const maxLength = MathMin(MathMax(0, ctx.maxArrayLength), length);
                                                                                                                    const remaining = value.length - maxLength;
                                                                                                                    const output = new Array(maxLength);
                                                                                                                    const elementFormatter = value.length > 0 && typeof value[0] === 'number' ?
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1471..1500

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

                                                                                                                  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 formatNamespaceObject(keys, ctx, value, recurseTimes) {
                                                                                                                    const output = new Array(keys.length);
                                                                                                                    for (let i = 0; i < keys.length; i++) {
                                                                                                                      try {
                                                                                                                        output[i] = formatProperty(ctx, value, recurseTimes, keys[i],
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1369..1394

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

                                                                                                                  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 formatSetIterInner(ctx, recurseTimes, entries, state) {
                                                                                                                    const maxArrayLength = MathMax(ctx.maxArrayLength, 0);
                                                                                                                    const maxLength = MathMin(maxArrayLength, entries.length);
                                                                                                                    let output = new Array(maxLength);
                                                                                                                    ctx.indentationLvl += 2;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1531..1551

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

                                                                                                                  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 formatArrayBuffer(ctx, value) {
                                                                                                                    let buffer;
                                                                                                                    try {
                                                                                                                      buffer = new Uint8Array(value);
                                                                                                                    } catch {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1436..1451

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

                                                                                                                  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 getKeys(value, showHidden) {
                                                                                                                    let keys;
                                                                                                                    const symbols = ObjectGetOwnPropertySymbols(value);
                                                                                                                    if (showHidden) {
                                                                                                                      keys = ObjectGetOwnPropertyNames(value);
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 613..639

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

                                                                                                                  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 getClassBase(value, constructor, tag) {
                                                                                                                    const hasName = ObjectPrototypeHasOwnProperty(value, 'name');
                                                                                                                    const name = (hasName && value.name) || '(anonymous)';
                                                                                                                    let base = `class ${name}`;
                                                                                                                    if (constructor !== 'Function' && constructor !== null) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 day to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1064..1083

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

                                                                                                                  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 hasBuiltInToString(value) {
                                                                                                                    // Prevent triggering proxy traps.
                                                                                                                    const getFullProxy = false;
                                                                                                                    const proxyTarget = getProxyDetails(value, getFullProxy);
                                                                                                                    if (proxyTarget !== undefined) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 7 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1782..1812

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

                                                                                                                  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 formatArray(ctx, value, recurseTimes) {
                                                                                                                    const valLen = value.length;
                                                                                                                    const len = MathMin(MathMax(0, ctx.maxArrayLength), valLen);
                                                                                                                  
                                                                                                                    const remaining = valLen - len;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 7 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1453..1469

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

                                                                                                                  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 isBelowBreakLength(ctx, output, start, base) {
                                                                                                                    // Each entry is separated by at least a comma. Thus, we start with a total
                                                                                                                    // length of at least `output.length`. In addition, some cases have a
                                                                                                                    // whitespace in-between each other that is added to the total as well.
                                                                                                                    // TODO(BridgeAR): Add unicode support. Use the readline getStringWidth
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 7 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1694..1716

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

                                                                                                                  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

                                                                                                                      } else if (isSet(value)) {
                                                                                                                        const size = setSizeGetter(value);
                                                                                                                        const prefix = getPrefix(constructor, tag, 'Set', `(${size})`);
                                                                                                                        keys = getKeys(value, ctx.showHidden);
                                                                                                                        formatter = constructor !== null ?
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  current/lib/internal/util/inspect.js on lines 856..897

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

                                                                                                                  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

                                                                                                                    const isZeroWidthCodePoint = (code) => {
                                                                                                                      return code <= 0x1F || // C0 control codes
                                                                                                                        (code >= 0x7F && code <= 0x9F) || // C1 control codes
                                                                                                                        (code >= 0x300 && code <= 0x36F) || // Combining Diacritical Marks
                                                                                                                        (code >= 0x200B && code <= 0x200F) || // Modifying Invisible Characters
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 2048..2058

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

                                                                                                                  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 (ctx.sorted) {
                                                                                                                      const comparator = ctx.sorted === true ? undefined : ctx.sorted;
                                                                                                                      if (extrasType === kObjectType) {
                                                                                                                        output = output.sort(comparator);
                                                                                                                      } else if (keys.length > 1) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 987..995

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

                                                                                                                  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

                                                                                                                      if (ArrayIsArray(value)) {
                                                                                                                        // Only set the constructor for non ordinary ("Array [...]") arrays.
                                                                                                                        const prefix = (constructor !== 'Array' || tag !== '') ?
                                                                                                                          getPrefix(constructor, tag, 'Array', `(${value.length})`) :
                                                                                                                          '';
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 795..857

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

                                                                                                                  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 formatPromise(ctx, value, recurseTimes) {
                                                                                                                    let output;
                                                                                                                    const [state, result] = getPromiseDetails(value);
                                                                                                                    if (state === kPending) {
                                                                                                                      output = [ctx.stylize('<pending>', 'special')];
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1616..1632

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

                                                                                                                  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

                                                                                                                      } else if (isAnyArrayBuffer(value)) {
                                                                                                                        // Fast path for ArrayBuffer and SharedArrayBuffer.
                                                                                                                        // Can't do the same for DataView because it has a non-primitive
                                                                                                                        // .buffer property that we need to recurse for.
                                                                                                                        const arrayType = isArrayBuffer(value) ? 'ArrayBuffer' :
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 5 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 902..946

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

                                                                                                                  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

                                                                                                                    try {
                                                                                                                      output = formatter(ctx, value, recurseTimes);
                                                                                                                      for (i = 0; i < keys.length; i++) {
                                                                                                                        output.push(
                                                                                                                          formatProperty(ctx, value, recurseTimes, keys[i], extrasType));
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 961..973

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

                                                                                                                  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

                                                                                                                    if (stringified.slice(0, 5) === 'class' && stringified.endsWith('}')) {
                                                                                                                      const slice = stringified.slice(5, -1);
                                                                                                                      const bracketIndex = slice.indexOf('{');
                                                                                                                      if (bracketIndex !== -1 &&
                                                                                                                          (!slice.slice(0, bracketIndex).includes('(') ||
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1087..1096

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

                                                                                                                  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 getPrefix(constructor, tag, fallback, size = '') {
                                                                                                                    if (constructor === null) {
                                                                                                                      if (tag !== '') {
                                                                                                                        return `[${fallback}${size}: null prototype] [${tag}] `;
                                                                                                                      }
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 598..610

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

                                                                                                                  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

                                                                                                                      } else if (isRegExp(value)) {
                                                                                                                        // Make RegExps say that they are RegExps
                                                                                                                        base = RegExpPrototypeToString(
                                                                                                                          constructor !== null ? value : new RegExp(value)
                                                                                                                        );
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 875..946

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

                                                                                                                  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 tryStringify(arg) {
                                                                                                                    try {
                                                                                                                      return JSONStringify(arg);
                                                                                                                    } catch (err) {
                                                                                                                      // Populate the circular error message lazily
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1816..1834

                                                                                                                  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

                                                                                                                  function formatProxy(ctx, proxy, recurseTimes) {
                                                                                                                    if (recurseTimes > ctx.depth && ctx.depth !== null) {
                                                                                                                      return ctx.stylize('Proxy [Array]', 'special');
                                                                                                                    }
                                                                                                                    recurseTimes += 1;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 652..665

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

                                                                                                                  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 (str.includes("'")) {
                                                                                                                      // This invalidates the charCode and therefore can not be matched for
                                                                                                                      // anymore.
                                                                                                                      if (!str.includes('"')) {
                                                                                                                        singleQuote = -1;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 429..441

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

                                                                                                                  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

                                                                                                                    const ret = {
                                                                                                                      stylize: ctx.stylize,
                                                                                                                      showHidden: ctx.showHidden,
                                                                                                                      depth: ctx.depth,
                                                                                                                      colors: ctx.colors,
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 4 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 215..229

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

                                                                                                                  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

                                                                                                                      } else if (isDate(value)) {
                                                                                                                        // Make dates with properties first say the date
                                                                                                                        base = NumberIsNaN(DatePrototypeGetTime(value)) ?
                                                                                                                          DatePrototypeToString(value) :
                                                                                                                          DatePrototypeToISOString(value);
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 3 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 887..946

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

                                                                                                                  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 (ctx.circular === undefined) {
                                                                                                                        ctx.circular = new Map([[value, index]]);
                                                                                                                      } else {
                                                                                                                        index = ctx.circular.get(value);
                                                                                                                        if (index === undefined) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 3 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 741..749

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

                                                                                                                  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 (constructor === 'Object') {
                                                                                                                        if (isArgumentsObject(value)) {
                                                                                                                          braces[0] = '[Arguments] {';
                                                                                                                        } else if (tag !== '') {
                                                                                                                          braces[0] = `${getPrefix(constructor, tag, 'Object')}{`;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 3 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 862..946

                                                                                                                  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

                                                                                                                  function stylizeWithColor(str, styleType) {
                                                                                                                    const style = inspect.styles[styleType];
                                                                                                                    if (style !== undefined) {
                                                                                                                      const color = inspect.colors[style];
                                                                                                                      if (color !== undefined)
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 472..480

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

                                                                                                                  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 findTypedConstructor(value) {
                                                                                                                    for (const [check, clazz] of [
                                                                                                                      [isUint8Array, Uint8Array],
                                                                                                                      [isUint8ClampedArray, Uint8ClampedArray],
                                                                                                                      [isUint16Array, Uint16Array],
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 667..685

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

                                                                                                                  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 (recurseTimes > ctx.depth && ctx.depth !== null) {
                                                                                                                      let constructorName = getCtxStyle(value, constructor, tag).slice(0, -1);
                                                                                                                      if (constructor !== null)
                                                                                                                        constructorName = `[${constructorName}]`;
                                                                                                                      return ctx.stylize(constructorName, 'special');
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 949..954

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

                                                                                                                  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

                                                                                                                  inspect.styles = ObjectAssign(ObjectCreate(null), {
                                                                                                                    special: 'cyan',
                                                                                                                    number: 'yellow',
                                                                                                                    bigint: 'yellow',
                                                                                                                    boolean: 'yellow',
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 390..404

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

                                                                                                                  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 formatIterator(braces, ctx, value, recurseTimes) {
                                                                                                                    const [entries, isKeyValue] = previewEntries(value, true);
                                                                                                                    if (isKeyValue) {
                                                                                                                      // Mark entry iterators as such.
                                                                                                                      braces[0] = braces[0].replace(/ Iterator] {$/, ' Entries] {');
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1605..1614

                                                                                                                  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 getIteratorBraces(type, tag) {
                                                                                                                    if (tag !== `${type} Iterator`) {
                                                                                                                      if (tag !== '')
                                                                                                                        tag += '] [';
                                                                                                                      tag += `${type} Iterator`;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1015..1022

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

                                                                                                                  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 handleMaxCallStackSize(ctx, err, constructorName, indentationLvl) {
                                                                                                                    if (isStackOverflowError(err)) {
                                                                                                                      ctx.seen.pop();
                                                                                                                      ctx.indentationLvl = indentationLvl;
                                                                                                                      return ctx.stylize(
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 2 hrs to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1315..1326

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

                                                                                                                  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 (point === singleQuote ||
                                                                                                                          point === 92 ||
                                                                                                                          point < 32 ||
                                                                                                                          (point > 126 && point < 160)) {
                                                                                                                        if (last === i) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 456..463

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

                                                                                                                  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 addQuotes(str, quotes) {
                                                                                                                    if (quotes === -1) {
                                                                                                                      return `"${str}"`;
                                                                                                                    }
                                                                                                                    if (quotes === -2) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 406..414

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

                                                                                                                  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

                                                                                                                  ObjectDefineProperty(inspect, 'defaultOptions', {
                                                                                                                    get() {
                                                                                                                      return inspectDefaultOptions;
                                                                                                                    },
                                                                                                                    set(options) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 297..307

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

                                                                                                                  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

                                                                                                                      if (descriptor !== undefined &&
                                                                                                                          typeof descriptor.value === 'function' &&
                                                                                                                          descriptor.value.name !== '' &&
                                                                                                                          tmp instanceof descriptor.value) {
                                                                                                                        if (protoProps !== undefined &&
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 496..506

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

                                                                                                                  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

                                                                                                                  const inspectDefaultOptions = ObjectSeal({
                                                                                                                    showHidden: false,
                                                                                                                    depth: 2,
                                                                                                                    colors: false,
                                                                                                                    customInspect: true,
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 144..156

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

                                                                                                                  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 defineColorAlias(target, alias) {
                                                                                                                    ObjectDefineProperty(inspect.colors, alias, {
                                                                                                                      get() {
                                                                                                                        return this[target];
                                                                                                                      },
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 362..373

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

                                                                                                                  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 (ret !== context) {
                                                                                                                          if (typeof ret !== 'string') {
                                                                                                                            return formatValue(ctx, ret, recurseTimes);
                                                                                                                          }
                                                                                                                          return ret.replace(/\n/g, `\n${' '.repeat(ctx.indentationLvl)}`);
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 728..733

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

                                                                                                                  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 getCtxStyle(value, constructor, tag) {
                                                                                                                    let fallback = '';
                                                                                                                    if (constructor === null) {
                                                                                                                      fallback = internalGetConstructorName(value);
                                                                                                                      if (fallback === tag) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 641..650

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

                                                                                                                  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

                                                                                                                      for (const char of str) {
                                                                                                                        const code = char.codePointAt(0);
                                                                                                                        if (isFullWidthCodePoint(code)) {
                                                                                                                          width += 2;
                                                                                                                        } else if (!isZeroWidthCodePoint(code)) {
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 1 hr to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1994..2001

                                                                                                                  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

                                                                                                                    for (const [k, v] of value) {
                                                                                                                      output.push(`${formatValue(ctx, k, recurseTimes)} => ` +
                                                                                                                                  formatValue(ctx, v, recurseTimes));
                                                                                                                    }
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 50 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 1520..1523

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

                                                                                                                  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

                                                                                                                    if (typeof tag !== 'string' ||
                                                                                                                        (tag !== '' &&
                                                                                                                        (ctx.showHidden ?
                                                                                                                          ObjectPrototypeHasOwnProperty :
                                                                                                                          ObjectPrototypePropertyIsEnumerable)(
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 45 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 772..780

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

                                                                                                                  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

                                                                                                                      } else if (typeof value === 'function') {
                                                                                                                        base = getFunctionBase(value, constructor, tag);
                                                                                                                        if (keys.length === 0 && protoProps === undefined)
                                                                                                                          return ctx.stylize(base, 'special');
                                                                                                                      } else if (isRegExp(value)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 40 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 871..946

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

                                                                                                                  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 (protoConstr === null) {
                                                                                                                      return `${res} <${inspect(firstProto, {
                                                                                                                        ...ctx,
                                                                                                                        customInspect: false,
                                                                                                                        depth: -1
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 40 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 527..533

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

                                                                                                                  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 value !== 'object' &&
                                                                                                                        typeof value !== 'function' &&
                                                                                                                        !isUndetectableObject(value)) {
                                                                                                                      return formatPrimitive(ctx.stylize, value, ctx);
                                                                                                                    }
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 40 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 692..696

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

                                                                                                                  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

                                                                                                                      } else if (isDataView(value)) {
                                                                                                                        braces[0] = `${getPrefix(constructor, tag, 'DataView')}{`;
                                                                                                                        // .buffer goes last, it's not a primitive like the others.
                                                                                                                        keys.unshift('byteLength', 'byteOffset', 'buffer');
                                                                                                                      } else if (isPromise(value)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 35 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 917..946

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

                                                                                                                  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 4 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                      } else if (isWeakMap(value)) {
                                                                                                                        braces[0] = `${getPrefix(constructor, tag, 'WeakMap')}{`;
                                                                                                                        formatter = ctx.showHidden ? formatWeakMap : formatWeakCollection;
                                                                                                                      } else if (isModuleNamespaceObject(value)) {
                                                                                                                        braces[0] = `[${tag}] {`;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 3 other locations - About 35 mins to fix
                                                                                                                  current/lib/internal/util/inspect.js on lines 964..988
                                                                                                                  lts/lib/internal/util/inspect.js on lines 924..946
                                                                                                                  lts/lib/internal/util/inspect.js on lines 927..946

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

                                                                                                                  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 4 locations. Consider refactoring.
                                                                                                                  Open

                                                                                                                      } else if (isWeakSet(value)) {
                                                                                                                        braces[0] = `${getPrefix(constructor, tag, 'WeakSet')}{`;
                                                                                                                        formatter = ctx.showHidden ? formatWeakSet : formatWeakCollection;
                                                                                                                      } else if (isWeakMap(value)) {
                                                                                                                        braces[0] = `${getPrefix(constructor, tag, 'WeakMap')}{`;
                                                                                                                  Severity: Major
                                                                                                                  Found in current/lib/internal/util/inspect.js and 3 other locations - About 35 mins to fix
                                                                                                                  current/lib/internal/util/inspect.js on lines 967..988
                                                                                                                  lts/lib/internal/util/inspect.js on lines 924..946
                                                                                                                  lts/lib/internal/util/inspect.js on lines 927..946

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

                                                                                                                  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

                                                                                                                      if (typeof maybeCustom === 'function' &&
                                                                                                                          // Filter out the util module, its inspect function is special.
                                                                                                                          maybeCustom !== inspect &&
                                                                                                                          // Also filter out any prototype objects using the circular check.
                                                                                                                          !(value.constructor && value.constructor.prototype === value)) {
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 35 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 717..734

                                                                                                                  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

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

                                                                                                                      } else if (isBoxedPrimitive(value)) {
                                                                                                                        base = getBoxedBase(value, ctx, keys, constructor, tag);
                                                                                                                        if (keys.length === 0 && protoProps === undefined) {
                                                                                                                          return base;
                                                                                                                        }
                                                                                                                  Severity: Minor
                                                                                                                  Found in current/lib/internal/util/inspect.js and 1 other location - About 30 mins to fix
                                                                                                                  lts/lib/internal/util/inspect.js on lines 934..946

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

                                                                                                                  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