enclose-io/compiler

View on GitHub
lts/deps/node-inspect/lib/internal/inspect_repl.js

Summary

Maintainability
F
2 mos
Test Coverage

Function createRepl has 676 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createRepl(inspector) {
  const { Debugger, HeapProfiler, Profiler, Runtime } = inspector;

  let repl; // eslint-disable-line prefer-const

Severity: Major
Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 3 days to fix

    File inspect_repl.js has 894 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright Node.js contributors. All rights reserved.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a copy
     * of this software and associated documentation files (the "Software"), to
    Severity: Major
    Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 2 days to fix

      Function createRepl has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
      Open

      function createRepl(inspector) {
        const { Debugger, HeapProfiler, Profiler, Runtime } = inspector;
      
        let repl; // eslint-disable-line prefer-const
      
      
      Severity: Minor
      Found in lts/deps/node-inspect/lib/internal/inspect_repl.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

      Function initializeContext has 164 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function initializeContext(context) {
          inspector.domainNames.forEach((domain) => {
            Object.defineProperty(context, domain, {
              value: inspector[domain],
              enumerable: true,
      Severity: Major
      Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 6 hrs to fix

        Function util.inspect.custom has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

          [util.inspect.custom](depth, opts) {
            function formatProperty(prop) {
              switch (prop.type) {
                case 'string':
                case 'undefined':
        Severity: Minor
        Found in lts/deps/node-inspect/lib/internal/inspect_repl.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 setBreakpoint has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function setBreakpoint(script, line, condition, silent) {
            function registerBreakpoint({ breakpointId, actualLocation }) {
              handleBreakpointResolved({ breakpointId, location: actualLocation });
              if (actualLocation && actualLocation.scriptId) {
                if (!silent) return getSourceSnippet(actualLocation, 5);
        Severity: Major
        Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 3 hrs to fix

          `` has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

              copyOwnProperties(context, {
                get help() {
                  print(HELP);
                },
          
          
          Severity: Minor
          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 2 hrs to fix

            Function util.inspect.custom has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              [util.inspect.custom](depth, opts) {
                function formatProperty(prop) {
                  switch (prop.type) {
                    case 'string':
                    case 'undefined':
            Severity: Major
            Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 2 hrs to fix

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

                    takeHeapSnapshot(filename = 'node.heapsnapshot') {
                      return new Promise((resolve, reject) => {
                        const absoluteFile = Path.resolve(filename);
                        const writer = FS.createWriteStream(absoluteFile);
                        let sizeWritten = 0;
              Severity: Minor
              Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 1 hr to fix

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

                      get repl() {
                        // Don't display any default messages
                        const listeners = repl.listeners('SIGINT').slice(0);
                        repl.removeAllListeners('SIGINT');
                
                
                Severity: Minor
                Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 1 hr to fix

                  Function util.inspect.custom has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      [util.inspect.custom](depth, options) {
                        const { scriptId, lineNumber, columnNumber, delta, scriptSource } = this;
                        const start = Math.max(1, lineNumber - delta + 1);
                        const end = lineNumber + delta + 1;
                  
                  
                  Severity: Minor
                  Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 1 hr to fix

                    Avoid too many return statements within this function.
                    Open

                          return undefined;
                    Severity: Major
                    Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return Debugger
                            .setBreakpointByUrl({ urlRegex, lineNumber: line - 1, condition })
                            .then((bp) => {
                              // TODO: handle bp.locations in case the regex matches existing files
                              if (!bp.location) { // Fake it for now.
                      Severity: Major
                      Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return Debugger.setBreakpoint({ location, condition })
                                .then(registerBreakpoint);
                        Severity: Major
                        Found in lts/deps/node-inspect/lib/internal/inspect_repl.js - About 30 mins to fix

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

                          function createRepl(inspector) {
                            const { Debugger, HeapProfiler, Profiler, Runtime } = inspector;
                          
                            let repl; // eslint-disable-line prefer-const
                          
                          
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 mo to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 286..1107

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                          class RemoteObject {
                            constructor(attributes) {
                              Object.assign(this, attributes);
                              if (this.type === 'number') {
                                this.value =
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 4 days to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 159..251

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

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

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

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

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

                          Refactorings

                          Further Reading

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

                          class ScopeSnapshot {
                            constructor(scope, properties) {
                              Object.assign(this, scope);
                              this.properties = new Map(properties.map((prop) => {
                                const value = new RemoteObject(prop.value);
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 day to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 253..270

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

                          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 getRelativePath(filenameOrURL) {
                            const dir = Path.join(Path.resolve(), 'x').slice(0, -1);
                          
                            const filename = filenameOrURL.startsWith('file://') ?
                              fileURLToPath(filenameOrURL) : filenameOrURL;
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 3 hrs to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 100..111

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 109.

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

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

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

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

                          Refactorings

                          Further Reading

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

                          function markSourceColumn(sourceText, position, useColors) {
                            if (!sourceText) return '';
                          
                            const head = sourceText.slice(0, position);
                            let tail = sourceText.slice(position);
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 3 hrs to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 130..143

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 96.

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

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

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

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

                          Refactorings

                          Further Reading

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

                          function leftPad(n, prefix, maxN) {
                            const s = n.toString();
                            const nchars = Math.max(2, String(maxN).length) + 1;
                            const nspaces = nchars - s.length - 1;
                          
                          
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 2 hrs to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 122..128

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

                          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 convertResultToError(result) {
                            const { className, description } = result;
                            const err = new Error(extractErrorMessage(description));
                            err.stack = description;
                            Object.defineProperty(err, 'name', { value: className });
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 2 hrs to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 151..157

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

                          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 isNativeUrl(url) {
                            url = url.replace(/\.js$/, '');
                            if (PUBLIC_BUILTINS) {
                              if (url.startsWith('internal/') || PUBLIC_BUILTINS.includes(url))
                                return true;
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 hr to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 90..98

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 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 aliasProperties(target, mapping) {
                            Object.keys(mapping).forEach((key) => {
                              const descriptor = Object.getOwnPropertyDescriptor(target, key);
                              Object.defineProperty(target, mapping[key], descriptor);
                            });
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 hr to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 279..284

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

                          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 toCallback(promise, callback) {
                            function forward(...args) {
                              process.nextTick(() => callback(...args));
                            }
                            promise.then(forward.bind(null, null), forward);
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 hr to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 113..118

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 65.

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

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

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

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

                          Refactorings

                          Further Reading

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

                          function copyOwnProperties(target, source) {
                            Object.getOwnPropertyNames(source).forEach((prop) => {
                              const descriptor = Object.getOwnPropertyDescriptor(source, prop);
                              Object.defineProperty(target, prop, descriptor);
                            });
                          Severity: Major
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 1 hr to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 272..277

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

                          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 SHORTCUTS = {
                            cont: 'c',
                            next: 'n',
                            step: 's',
                            out: 'o',
                          Severity: Minor
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 40 mins to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 32..41

                          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

                          function extractFunctionName(description) {
                            const fnNameMatch = description.match(FUNCTION_NAME_PATTERN);
                            return fnNameMatch ? `: ${fnNameMatch[1]}` : '';
                          }
                          Severity: Minor
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 35 mins to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 83..86

                          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

                          function extractErrorMessage(stack) {
                            if (!stack) return '<unknown>';
                            const m = stack.match(/^\w+: ([^\n]+)/);
                            return m ? m[1] : stack;
                          }
                          Severity: Minor
                          Found in lts/deps/node-inspect/lib/internal/inspect_repl.js and 1 other location - About 35 mins to fix
                          current/deps/node-inspect/lib/internal/inspect_repl.js on lines 145..149

                          Duplicated Code

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

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

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

                          Tuning

                          This issue has a mass of 46.

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

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

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

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

                          Refactorings

                          Further Reading

                          There are no issues that match your filters.

                          Category
                          Status