enclose-io/compiler

View on GitHub
current/lib/repl.js

Summary

Maintainability
F
1 mo
Test Coverage

Function REPLServer has a Cognitive Complexity of 267 (exceeds 5 allowed). Consider refactoring.
Open

function REPLServer(prompt,
                    stream,
                    eval_,
                    useGlobal,
                    ignoreUndefined,
Severity: Minor
Found in current/lib/repl.js - About 5 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

File repl.js has 1274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
Severity: Major
Found in current/lib/repl.js - About 3 days to fix

    Function REPLServer has 606 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function REPLServer(prompt,
                        stream,
                        eval_,
                        useGlobal,
                        ignoreUndefined,
    Severity: Major
    Found in current/lib/repl.js - About 3 days to fix

      Function complete has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
      Open

      function complete(line, callback) {
        // List of completion lists, one for each inheritance "level"
        let completionGroups = [];
        let completeOn, group;
      
      
      Severity: Minor
      Found in current/lib/repl.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 complete has 163 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function complete(line, callback) {
        // List of completion lists, one for each inheritance "level"
        let completionGroups = [];
        let completeOn, group;
      
      
      Severity: Major
      Found in current/lib/repl.js - About 6 hrs to fix

        Function defaultEval has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function defaultEval(code, context, file, cb) {
            const asyncESM = require('internal/process/esm_loader');
        
            let result, script, wrappedErr;
            let err = null;
        Severity: Major
        Found in current/lib/repl.js - About 5 hrs to fix

          Function defineDefaultCommands has 94 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function defineDefaultCommands(repl) {
            repl.defineCommand('break', {
              help: 'Sometimes you get stuck, this gets you out',
              action: function() {
                this.clearBufferedCommand();
          Severity: Major
          Found in current/lib/repl.js - About 3 hrs to fix

            Function debugDomainError has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              self._domain.on('error', function debugDomainError(e) {
                debug('domain error');
                let errStack = '';
            
                if (typeof e === 'object' && e !== null) {
            Severity: Major
            Found in current/lib/repl.js - About 3 hrs to fix

              Function _memory has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              function _memory(cmd) {
                const self = this;
                self.lines = self.lines || [];
                self.lines.level = self.lines.level || [];
              
              
              Severity: Minor
              Found in current/lib/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 onLine has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                self.on('line', function onLine(cmd) {
                  debug('line %j', cmd);
                  cmd = cmd || '';
                  sawSIGINT = false;
              
              
              Severity: Major
              Found in current/lib/repl.js - About 2 hrs to fix

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

                function defineDefaultCommands(repl) {
                  repl.defineCommand('break', {
                    help: 'Sometimes you get stuck, this gets you out',
                    action: function() {
                      this.clearBufferedCommand();
                Severity: Minor
                Found in current/lib/repl.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 _ttyWrite has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  self._ttyWrite = (d, key) => {
                    key = key || {};
                    if (paused && !(self.breakEvalOnSigint && key.ctrl && key.name === 'c')) {
                      pausedBuffer.push(['key', [d, key], self.isCompletionEnabled]);
                      return;
                Severity: Minor
                Found in current/lib/repl.js - About 1 hr to fix

                  Function createContext has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  REPLServer.prototype.createContext = function() {
                    let context;
                    if (this.useGlobal) {
                      context = global;
                    } else {
                  Severity: Minor
                  Found in current/lib/repl.js - About 1 hr to fix

                    Function _memory has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function _memory(cmd) {
                      const self = this;
                      self.lines = self.lines || [];
                      self.lines.level = self.lines.level || [];
                    
                    
                    Severity: Minor
                    Found in current/lib/repl.js - About 1 hr to fix

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

                      REPLServer.prototype.resetContext = function() {
                        this.context = this.createContext();
                        this.underscoreAssigned = false;
                        this.underscoreErrAssigned = false;
                        // TODO(BridgeAR): Deprecate the lines.
                      Severity: Minor
                      Found in current/lib/repl.js - About 1 hr to fix

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

                          function completionGroupsLoaded() {
                            // Filter, sort (within each group), uniq and merge the completion groups.
                            if (completionGroups.length && filter) {
                              const newCompletionGroups = [];
                              for (const group of completionGroups) {
                        Severity: Minor
                        Found in current/lib/repl.js - About 1 hr to fix

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

                              function finish(e, ret) {
                                debug('finish', e, ret);
                                _memory.call(self, cmd);
                          
                                if (e && !self[kBufferedCommandSymbol] && cmd.trim().startsWith('npm ')) {
                          Severity: Minor
                          Found in current/lib/repl.js - About 1 hr to fix

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

                            function REPLServer(prompt,
                                                stream,
                                                eval_,
                                                useGlobal,
                                                ignoreUndefined,
                            Severity: Minor
                            Found in current/lib/repl.js - About 45 mins to fix

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

                              function isIdentifier(str) {
                                if (str === '') {
                                  return false;
                                }
                                const first = str.codePointAt(0);
                              Severity: Minor
                              Found in current/lib/repl.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 (StringPrototypeIncludes(e.message, importErrorStr)) {
                                            e.message = 'Cannot use import statement inside the Node.js ' +
                                              'REPL, alternatively use dynamic import';
                                            e.stack = e.stack.replace(/SyntaxError:.*\n/,
                                                                      `SyntaxError: ${e.message}\n`);
                              Severity: Major
                              Found in current/lib/repl.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                        if (!dirent.isDirectory()) {
                                          if (extensions.includes(extension) && (!subdir || base !== 'index')) {
                                            group.push(`${subdir}${base}`);
                                          }
                                          continue;
                                Severity: Major
                                Found in current/lib/repl.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                        if (!this.useGlobal) {
                                          // When the context is not `global`, builtins are not own
                                          // properties of it.
                                          contextOwnNames.push(...globalBuiltins);
                                        }
                                  Severity: Major
                                  Found in current/lib/repl.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                            for (const group of memberGroups) {
                                              completionGroups.push(group.map((member) => `${expr}${member}`));
                                            }
                                    Severity: Major
                                    Found in current/lib/repl.js - About 45 mins to fix

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

                                      function start(prompt, source, eval_, useGlobal, ignoreUndefined, replMode) {
                                      Severity: Minor
                                      Found in current/lib/repl.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                if (filter) {
                                                  filter = `${expr}${filter}`;
                                                }
                                        Severity: Major
                                        Found in current/lib/repl.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                    } else if (self.replMode === module.exports.REPL_MODE_STRICT) {
                                                      e.stack = e.stack.replace(/(\s+at\s+REPL\d+:)(\d+)/,
                                                                                (_, pre, line) => pre + (line - 1));
                                                    }
                                          Severity: Major
                                          Found in current/lib/repl.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                    if (versionedFileNamesRe.test(dirent.name) || dirent.name === '.npm') {
                                                      // Exclude versioned names that 'npm' installs.
                                                      continue;
                                                    }
                                            Severity: Major
                                            Found in current/lib/repl.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                    if (filter !== '') addCommonWords(completionGroups);
                                              Severity: Major
                                              Found in current/lib/repl.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                        for (const subfile of subfiles) {
                                                          if (indexes.includes(subfile)) {
                                                            group.push(`${subdir}${dirent.name}`);
                                                            break;
                                                          }
                                                Severity: Major
                                                Found in current/lib/repl.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                        while (contextProto = ObjectGetPrototypeOf(contextProto)) {
                                                          completionGroups.push(filteredOwnPropertyNames(contextProto));
                                                        }
                                                  Severity: Major
                                                  Found in current/lib/repl.js - About 45 mins to fix

                                                    Function createContext has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                    Open

                                                    REPLServer.prototype.createContext = function() {
                                                      let context;
                                                      if (this.useGlobal) {
                                                        context = global;
                                                      } else {
                                                    Severity: Minor
                                                    Found in current/lib/repl.js - About 35 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 defineDefaultCommands(repl) {
                                                      repl.defineCommand('break', {
                                                        help: 'Sometimes you get stuck, this gets you out',
                                                        action: function() {
                                                          this.clearBufferedCommand();
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 days to fix
                                                    lts/lib/repl.js on lines 1483..1583

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

                                                    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 (!err) {
                                                          // Unset raw mode during evaluation so that Ctrl+C raises a signal.
                                                          let previouslyInRawMode;
                                                          if (self.breakEvalOnSigint) {
                                                            // Start the SIGINT watchdog before entering raw mode so that a very
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 days to fix
                                                    lts/lib/repl.js on lines 414..494

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

                                                    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 _memory(cmd) {
                                                      const self = this;
                                                      self.lines = self.lines || [];
                                                      self.lines.level = self.lines.level || [];
                                                    
                                                    
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 days to fix
                                                    lts/lib/repl.js on lines 1396..1459

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

                                                    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 (options[kStandaloneREPL] &&
                                                            process.listenerCount('uncaughtException') !== 0) {
                                                          process.nextTick(() => {
                                                            process.emit('uncaughtException', e);
                                                            self.clearBufferedCommand();
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 days to fix
                                                    lts/lib/repl.js on lines 562..598

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

                                                    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

                                                    REPLServer.prototype.createContext = function() {
                                                      let context;
                                                      if (this.useGlobal) {
                                                        context = global;
                                                      } else {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 days to fix
                                                    lts/lib/repl.js on lines 938..986

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

                                                    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 finish(e, ret) {
                                                          debug('finish', e, ret);
                                                          _memory.call(self, cmd);
                                                    
                                                          if (e && !self[kBufferedCommandSymbol] && cmd.trim().startsWith('npm ')) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 day to fix
                                                    lts/lib/repl.js on lines 762..807

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

                                                    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

                                                      self.on('SIGINT', function onSigInt() {
                                                        if (prioritizedSigintQueue.size > 0) {
                                                          for (const task of prioritizedSigintQueue) {
                                                            task();
                                                          }
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 day to fix
                                                    lts/lib/repl.js on lines 685..713

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

                                                    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

                                                          overrideStackTrace.set(e, (error, stackFrames) => {
                                                            let frames;
                                                            if (typeof stackFrames === 'object') {
                                                              // Search from the bottom of the call stack to
                                                              // find the first frame with a null function name
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 7 hrs to fix
                                                    lts/lib/repl.js on lines 508..529

                                                    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

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

                                                        if (trimmedCmd) {
                                                          if (trimmedCmd.charAt(0) === '.' && trimmedCmd.charAt(1) !== '.' &&
                                                              NumberIsNaN(parseFloat(trimmedCmd))) {
                                                            const matches = trimmedCmd.match(/^\.([^\s]+)\s*(.*)$/);
                                                            const keyword = matches && matches[1];
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 6 hrs to fix
                                                    lts/lib/repl.js on lines 740..755

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

                                                    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

                                                    REPLServer.prototype.displayPrompt = function(preserveCursor) {
                                                      let prompt = this._initialPrompt;
                                                      if (this[kBufferedCommandSymbol].length) {
                                                        prompt = '...';
                                                        const len = this.lines.level.length ? this.lines.level.length - 1 : 0;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 6 hrs to fix
                                                    lts/lib/repl.js on lines 1024..1036

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

                                                    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 (key.ctrl && !key.shift) {
                                                          switch (key.name) {
                                                            // TODO(BridgeAR): There should not be a special mode necessary for full
                                                            // multiline support.
                                                            case 'd': // End editor mode
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 6 hrs to fix
                                                    lts/lib/repl.js on lines 857..885

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

                                                    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 isIdentifier(str) {
                                                      if (str === '') {
                                                        return false;
                                                      }
                                                      const first = str.codePointAt(0);
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 5 hrs to fix
                                                    lts/lib/repl.js on lines 1054..1073

                                                    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

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

                                                      function unpause() {
                                                        if (!paused) return;
                                                        paused = false;
                                                        let entry;
                                                        const tmpCompletionEnabled = self.isCompletionEnabled;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 5 hrs to fix
                                                    lts/lib/repl.js on lines 292..315

                                                    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 (!expr) {
                                                          // Get global vars synchronously
                                                          completionGroups.push(getGlobalLexicalScopeNames(this[kContextId]));
                                                          let contextProto = this.context;
                                                          while (contextProto = ObjectGetPrototypeOf(contextProto)) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 5 hrs to fix
                                                    lts/lib/repl.js on lines 1256..1273

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

                                                    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

                                                        for (const group of completionGroups) {
                                                          group.sort((a, b) => (b > a ? 1 : -1));
                                                          const setSize = uniqueSet.size;
                                                          for (const entry of group) {
                                                            if (!uniqueSet.has(entry)) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 5 hrs to fix
                                                    lts/lib/repl.js on lines 1342..1355

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

                                                    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 (self.writer === writer) {
                                                        // Conditionally turn on ANSI coloring.
                                                        writer.options.colors = self.useColors;
                                                    
                                                        if (options[kStandaloneREPL]) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 hrs to fix
                                                    lts/lib/repl.js on lines 639..658

                                                    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

                                                      self.on('SIGCONT', function onSigCont() {
                                                        if (self.editorMode) {
                                                          self.output.write(`${self._initialPrompt}.editor\n`);
                                                          self.output.write(
                                                            '// Entering editor mode (^D to finish, ^C to cancel)\n');
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 hrs to fix
                                                    lts/lib/repl.js on lines 810..820

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

                                                    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 (self.editorMode) {
                                                          self[kBufferedCommandSymbol] += cmd + '\n';
                                                    
                                                          // code alignment
                                                          const matches = self._sawKeyPress ? cmd.match(/^\s+/) : null;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 hrs to fix
                                                    lts/lib/repl.js on lines 720..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 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

                                                    REPLServer.prototype.close = function close() {
                                                      if (this.terminal && this._flushing && !this._closingOnFlush) {
                                                        this._closingOnFlush = true;
                                                        this.once('flushHistory', () =>
                                                          Interface.prototype.close.call(this)
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 hrs to fix
                                                    lts/lib/repl.js on lines 924..936

                                                    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 (prompt !== null && typeof prompt === 'object') {
                                                        // An options object was given.
                                                        options = { ...prompt };
                                                        stream = options.stream || options.socket;
                                                        eval_ = options.eval;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 4 hrs to fix
                                                    lts/lib/repl.js on lines 178..189

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

                                                    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

                                                    REPLServer.prototype.completeOnEditorMode = (callback) => (err, results) => {
                                                      if (err) return callback(err);
                                                    
                                                      const [completions, completeOn = ''] = results;
                                                      let result = completions.filter((v) => v);
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    lts/lib/repl.js on lines 1366..1377

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

                                                    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 (completeOn === '.') {
                                                          group = ['./', '../'];
                                                        } else if (completeOn === '..') {
                                                          group = ['../'];
                                                        } else if (/^\.\.?\//.test(completeOn)) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    lts/lib/repl.js on lines 1143..1151

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

                                                    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(this, 'inputStream', {
                                                        get: pendingDeprecation ?
                                                          deprecate(() => this.input,
                                                                    'repl.inputStream and repl.outputStream are deprecated. ' +
                                                                      'Use repl.input and repl.output instead',
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    current/lib/repl.js on lines 248..263

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

                                                    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(this, 'outputStream', {
                                                        get: pendingDeprecation ?
                                                          deprecate(() => this.output,
                                                                    'repl.inputStream and repl.outputStream are deprecated. ' +
                                                                      'Use repl.input and repl.output instead',
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    current/lib/repl.js on lines 232..247

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

                                                    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 {
                                                            if (self.replMode === module.exports.REPL_MODE_STRICT &&
                                                                !/^\s*$/.test(code)) {
                                                              // "void 0" keeps the repl from returning "use strict" as the result
                                                              // value for statements and declarations that don't return a value.
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    lts/lib/repl.js on lines 362..392

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

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

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

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

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

                                                    Refactorings

                                                    Further Reading

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

                                                    const {
                                                      Error,
                                                      MathMax,
                                                      NumberIsNaN,
                                                      ObjectAssign,
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 2 other locations - About 3 hrs to fix
                                                    current/lib/buffer.js on lines 24..43
                                                    lts/lib/buffer.js on lines 24..43

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

                                                    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 (options.terminal && options.useColors === undefined) {
                                                        // If possible, check if stdout supports colors or not.
                                                        if (options.output.hasColors) {
                                                          options.useColors = options.output.hasColors();
                                                        } else if (process.env.NODE_DISABLE_COLORS === undefined) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 3 hrs to fix
                                                    lts/lib/repl.js on lines 208..215

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

                                                    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

                                                    REPLServer.prototype.defineCommand = function(keyword, cmd) {
                                                      if (typeof cmd === 'function') {
                                                        cmd = { action: cmd };
                                                      } else if (typeof cmd.action !== 'function') {
                                                        throw new ERR_INVALID_ARG_TYPE('cmd.action', 'Function', cmd.action);
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 1379..1386

                                                    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

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

                                                      ObjectDefineProperty(this.context, '_error', {
                                                        configurable: true,
                                                        get: () => this.lastError,
                                                        set: (value) => {
                                                          this.lastError = value;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 1007..1018

                                                    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

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

                                                      ObjectDefineProperty(this.context, '_', {
                                                        configurable: true,
                                                        get: () => this.last,
                                                        set: (value) => {
                                                          this.last = value;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 995..1005

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

                                                    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 (experimentalREPLAwait && code.includes('await')) {
                                                          if (processTopLevelAwait === undefined) {
                                                            ({ processTopLevelAwait } = require('internal/repl/await'));
                                                          }
                                                    
                                                    
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 336..347

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

                                                    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 finishExecution(err, result) {
                                                          if (finished) return;
                                                          finished = true;
                                                    
                                                          // After executing the current expression, store the values of RegExp
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 401..412

                                                    Duplicated Code

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

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

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

                                                    Tuning

                                                    This issue has a mass of 89.

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

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

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

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

                                                    Refactorings

                                                    Further Reading

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

                                                      if (!options.input && !options.output) {
                                                        // Legacy API, passing a 'stream'/'socket' option.
                                                        if (!stream) {
                                                          // Use stdin and stdout as the default streams if none were given.
                                                          stream = process;
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 191..201

                                                    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

                                                    function getGlobalLexicalScopeNames(contextId) {
                                                      return sendInspectorCommand((session) => {
                                                        let names = [];
                                                        session.post('Runtime.globalLexicalScopeNames', {
                                                          executionContextId: contextId
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 1081..1091

                                                    Duplicated Code

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

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

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

                                                    Tuning

                                                    This issue has a mass of 81.

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

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

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

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

                                                    Refactorings

                                                    Further Reading

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

                                                    try {
                                                      // Hack for require.resolve("./relative") to work properly.
                                                      module.filename = path.resolve('repl');
                                                    } catch {
                                                      // path.resolve('repl') fails when the current working directory has been
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 140..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 78.

                                                    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

                                                        process.prependListener('newListener', (event, listener) => {
                                                          if (event === 'uncaughtException' &&
                                                              process.domain &&
                                                              listener.name !== 'domainUncaughtExceptionClear' &&
                                                              domainSet.has(process.domain)) {
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 2 hrs to fix
                                                    lts/lib/repl.js on lines 247..259

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

                                                    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 regExMatcher = new RegExp(`^${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` +
                                                                                      `${sep}(.*)${sep}(.*)${sep}(.*)${sep}(.*)` +
                                                                                      `${sep}(.*)$`);
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 277..279

                                                    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

                                                        if (/^\s*{/.test(code) && !/;\s*$/.test(code)) {
                                                          code = `(${code.trim()})\n`;
                                                          wrappedCmd = true;
                                                        }
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 331..334

                                                    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

                                                          if (key.ctrl && key.name === 'd' &&
                                                              self.cursor === 0 && self.line.length === 0) {
                                                            self.clearLine();
                                                          }
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 844..847

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

                                                    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 addCommonWords(completionGroups) {
                                                      // Only words which do not yet exist as global property should be added to
                                                      // this list.
                                                      completionGroups.push([
                                                        'async', 'await', 'break', 'case', 'catch', 'const', 'continue',
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 1461..1471

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

                                                    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 (paused && !(self.breakEvalOnSigint && key.ctrl && key.name === 'c')) {
                                                          pausedBuffer.push(['key', [d, key], self.isCompletionEnabled]);
                                                          return;
                                                        }
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 838..841

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

                                                    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

                                                    REPLServer.prototype.setPrompt = function setPrompt(prompt) {
                                                      this._initialPrompt = prompt;
                                                      Interface.prototype.setPrompt.call(this, prompt);
                                                    };
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 1039..1042

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

                                                    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

                                                      ObjectDefineProperty(this, 'bufferedCommand', {
                                                        get: deprecate(() => self[kBufferedCommandSymbol],
                                                                       'REPLServer.bufferedCommand is deprecated',
                                                                       'DEP0074'),
                                                        set: deprecate((val) => self[kBufferedCommandSymbol] = val,
                                                    Severity: Major
                                                    Found in current/lib/repl.js and 1 other location - About 1 hr to fix
                                                    lts/lib/repl.js on lines 605..613

                                                    Duplicated Code

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

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

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

                                                    Tuning

                                                    This issue has a mass of 55.

                                                    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 _parseREPLKeyword(keyword, rest) {
                                                        const cmd = this.commands[keyword];
                                                        if (cmd) {
                                                          cmd.action.call(this, rest);
                                                          return true;
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 55 mins to fix
                                                    lts/lib/repl.js on lines 660..667

                                                    Duplicated Code

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

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

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

                                                    Tuning

                                                    This issue has a mass of 54.

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

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

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

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

                                                    Refactorings

                                                    Further Reading

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

                                                            script = vm.createScript(code, {
                                                              filename: file,
                                                              displayErrors: true,
                                                              importModuleDynamically: async (specifier) => {
                                                                return asyncESM.ESMLoader.import(specifier, parentURL);
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 55 mins to fix
                                                    lts/lib/repl.js on lines 369..375

                                                    Duplicated Code

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

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

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

                                                    Tuning

                                                    This issue has a mass of 54.

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

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

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

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

                                                    Refactorings

                                                    Further Reading

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

                                                      ObjectDefineProperty(this, 'rli', {
                                                        get: deprecate(() => rli,
                                                                       'REPLServer.rli is deprecated', 'DEP0124'),
                                                        set: deprecate((val) => rli = val,
                                                                       'REPLServer.rli is deprecated', 'DEP0124'),
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 55 mins to fix
                                                    lts/lib/repl.js on lines 266..273

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

                                                    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

                                                      self.on('close', function emitExit() {
                                                        if (paused) {
                                                          pausedBuffer.push(['close']);
                                                          return;
                                                        }
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 50 mins to fix
                                                    lts/lib/repl.js on lines 674..680

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

                                                    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 {
                                                          const { pathToFileURL } = require('url');
                                                          // Adding `/repl` prevents dynamic imports from loading relative
                                                          // to the parent of `process.cwd()`.
                                                          parentURL = pathToFileURL(path.join(process.cwd(), 'repl')).href;
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 50 mins to fix
                                                    lts/lib/repl.js on lines 354..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 51.

                                                    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 (line.length !== 0) {
                                                          const bits = match.split('.');
                                                          filter = bits.pop();
                                                          expr = bits.join('.');
                                                        }
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 40 mins to fix
                                                    lts/deps/npm/lib/config.js on lines 146..152

                                                    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

                                                            while (p !== null && sentinel-- !== 0) {
                                                              memberGroups.push(filteredOwnPropertyNames(p));
                                                              p = ObjectGetPrototypeOf(p);
                                                            }
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 35 mins to fix
                                                    lts/lib/repl.js on lines 1298..1301

                                                    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

                                                      const completions = fileList
                                                        .filter((dirent) => dirent.name.startsWith(baseName))
                                                        .map((d) => d.name);
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 35 mins to fix
                                                    lts/lib/repl.js on lines 1215..1217

                                                    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

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

                                                    function filteredOwnPropertyNames(obj) {
                                                      if (!obj) return [];
                                                      const filter = ALL_PROPERTIES | SKIP_SYMBOLS;
                                                      return getOwnNonIndexProperties(obj, filter).filter(isIdentifier);
                                                    }
                                                    Severity: Minor
                                                    Found in current/lib/repl.js and 1 other location - About 35 mins to fix
                                                    lts/lib/repl.js on lines 1075..1079

                                                    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