enclose-io/compiler

View on GitHub
current/lib/readline.js

Summary

Maintainability
F
1 mo
Test Coverage

File readline.js has 945 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/readline.js - About 2 days to fix

    Function _ttyWrite has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

    Interface.prototype._ttyWrite = function(s, key) {
      const previousKey = this._previousKey;
      key = key || {};
      this._previousKey = key;
    
    
    Severity: Minor
    Found in current/lib/readline.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 _ttyWrite has 176 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Interface.prototype._ttyWrite = function(s, key) {
      const previousKey = this._previousKey;
      key = key || {};
      this._previousKey = key;
    
    
    Severity: Major
    Found in current/lib/readline.js - About 7 hrs to fix

      Function Interface has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      function Interface(input, output, completer, terminal) {
        if (!(this instanceof Interface)) {
          return new Interface(input, output, completer, terminal);
        }
      
      
      Severity: Minor
      Found in current/lib/readline.js - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function Interface has 133 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Interface(input, output, completer, terminal) {
        if (!(this instanceof Interface)) {
          return new Interface(input, output, completer, terminal);
        }
      
      
      Severity: Major
      Found in current/lib/readline.js - About 5 hrs to fix

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

        function emitKeypressEvents(stream, iface = {}) {
          if (stream[KEYPRESS_DECODER]) return;
        
          stream[KEYPRESS_DECODER] = new StringDecoder('utf8');
        
        
        Severity: Minor
        Found in current/lib/readline.js - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

        Interface.prototype._tabComplete = function(lastKeypressWasTab) {
          this.pause();
          this.completer(this.line.slice(0, this.cursor), (err, value) => {
            this.resume();
        
        
        Severity: Minor
        Found in current/lib/readline.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 _ttyWriteDumb has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

        function _ttyWriteDumb(s, key) {
          key = key || {};
        
          if (key.name === 'escape') return;
        
        
        Severity: Minor
        Found in current/lib/readline.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 _tabComplete has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Interface.prototype._tabComplete = function(lastKeypressWasTab) {
          this.pause();
          this.completer(this.line.slice(0, this.cursor), (err, value) => {
            this.resume();
        
        
        Severity: Major
        Found in current/lib/readline.js - About 2 hrs to fix

          Function emitKeypressEvents has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function emitKeypressEvents(stream, iface = {}) {
            if (stream[KEYPRESS_DECODER]) return;
          
            stream[KEYPRESS_DECODER] = new StringDecoder('utf8');
          
          
          Severity: Minor
          Found in current/lib/readline.js - About 1 hr to fix

            Function _ttyWriteDumb has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function _ttyWriteDumb(s, key) {
              key = key || {};
            
              if (key.name === 'escape') return;
            
            
            Severity: Minor
            Found in current/lib/readline.js - About 1 hr to fix

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

              Interface.prototype._addHistory = function() {
                if (this.line.length === 0) return '';
              
                // If the history is disabled then return the line
                if (this.historySize === 0) return this.line;
              Severity: Minor
              Found in current/lib/readline.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

              Interface.prototype._getDisplayPos = function(str) {
                let offset = 0;
                const col = this.columns;
                let rows = 0;
                str = stripVTControlCharacters(str);
              Severity: Minor
              Found in current/lib/readline.js - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

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

              Interface.prototype[SymbolAsyncIterator] = function() {
                if (this[kLineObjectStream] === undefined) {
                  if (Readable === undefined) {
                    Readable = require('stream').Readable;
                  }
              Severity: Minor
              Found in current/lib/readline.js - About 1 hr to fix

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

                  function onData(input) {
                    if (stream.listenerCount('keypress') > 0) {
                      const string = stream[KEYPRESS_DECODER].write(input);
                      if (string) {
                        clearTimeout(timeoutId);
                Severity: Minor
                Found in current/lib/readline.js - About 1 hr to fix

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

                  Interface.prototype._historyPrev = function() {
                    if (this.historyIndex < this.history.length && this.history.length) {
                      const search = this[kSubstringSearch] || '';
                      let index = this.historyIndex + 1;
                      while (index < this.history.length &&
                  Severity: Minor
                  Found in current/lib/readline.js - About 1 hr to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                  Interface.prototype._normalWrite = function(b) {
                    if (b === undefined) {
                      return;
                    }
                    let string = this._decoder.write(b);
                  Severity: Minor
                  Found in current/lib/readline.js - About 1 hr to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function _getDisplayPos has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Interface.prototype._getDisplayPos = function(str) {
                    let offset = 0;
                    const col = this.columns;
                    let rows = 0;
                    str = stripVTControlCharacters(str);
                  Severity: Minor
                  Found in current/lib/readline.js - About 1 hr to fix

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

                    function moveCursor(stream, dx, dy, callback) {
                      if (callback !== undefined && typeof callback !== 'function')
                        throw new ERR_INVALID_CALLBACK(callback);
                    
                      if (stream == null || !(dx || dy)) {
                    Severity: Minor
                    Found in current/lib/readline.js - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    function clearLine(stream, dir, callback) {
                      if (callback !== undefined && typeof callback !== 'function')
                        throw new ERR_INVALID_CALLBACK(callback);
                    
                      if (stream === null || stream === undefined) {
                    Severity: Minor
                    Found in current/lib/readline.js - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    Interface.prototype._historyNext = function() {
                      if (this.historyIndex >= 0) {
                        const search = this[kSubstringSearch] || '';
                        let index = this.historyIndex - 1;
                        while (index >= 0 &&
                    Severity: Minor
                    Found in current/lib/readline.js - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

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

                    function cursorTo(stream, x, y, callback) {
                      if (callback !== undefined && typeof callback !== 'function')
                        throw new ERR_INVALID_CALLBACK(callback);
                    
                      if (typeof y === 'function') {
                    Severity: Minor
                    Found in current/lib/readline.js - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Avoid deeply nested control flow statements.
                    Open

                            if (typeof s === 'string' && s) {
                              const lines = s.split(/\r\n|\n|\r/);
                              for (let i = 0, len = lines.length; i < len; i++) {
                                if (i > 0) {
                                  this._line();
                    Severity: Major
                    Found in current/lib/readline.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                              if (this._sawReturnAt === 0 ||
                                  DateNow() - this._sawReturnAt > this.crlfDelay) {
                                this._line();
                              }
                      Severity: Major
                      Found in current/lib/readline.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    if (!this.paused) {
                                      // Stream must be paused and resumed after SIGCONT to catch
                                      // SIGINT, SIGTSTP, and EOF.
                                      this.pause();
                                      this.emit('SIGCONT');
                        Severity: Major
                        Found in current/lib/readline.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  if (typeof this.completer === 'function' && this.isCompletionEnabled) {
                                    const lastKeypressWasTab = previousKey && previousKey.name === 'tab';
                                    this._tabComplete(lastKeypressWasTab);
                                    break;
                                  }
                          Severity: Major
                          Found in current/lib/readline.js - About 45 mins to fix

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

                            function clearScreenDown(stream, callback) {
                              if (callback !== undefined && typeof callback !== 'function')
                                throw new ERR_INVALID_CALLBACK(callback);
                            
                              if (stream === null || stream === undefined) {
                            Severity: Minor
                            Found in current/lib/readline.js - About 25 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                            Interface.prototype[SymbolAsyncIterator] = function() {
                              if (this[kLineObjectStream] === undefined) {
                                if (Readable === undefined) {
                                  Readable = require('stream').Readable;
                                }
                            Severity: Minor
                            Found in current/lib/readline.js - About 25 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

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

                            Interface.prototype._ttyWrite = function(s, key) {
                              const previousKey = this._previousKey;
                              key = key || {};
                              this._previousKey = key;
                            
                            
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 wk to fix
                            lts/lib/readline.js on lines 825..1068

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

                            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

                            Interface.prototype._tabComplete = function(lastKeypressWasTab) {
                              this.pause();
                              this.completer(this.line.slice(0, this.cursor), (err, value) => {
                                this.resume();
                            
                            
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 3 days to fix
                            lts/lib/readline.js on lines 500..561

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

                            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 emitKeypressEvents(stream, iface = {}) {
                              if (stream[KEYPRESS_DECODER]) return;
                            
                              stream[KEYPRESS_DECODER] = new StringDecoder('utf8');
                            
                            
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 days to fix
                            lts/lib/readline.js on lines 1107..1170

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

                            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 _ttyWriteDumb(s, key) {
                              key = key || {};
                            
                              if (key.name === 'escape') return;
                            
                            
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 776..822

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

                            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 (!this.terminal) {
                                function onSelfCloseWithoutTerminal() {
                                  input.removeListener('data', ondata);
                                  input.removeListener('end', onend);
                                }
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 222..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 316.

                            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

                            Interface.prototype._normalWrite = function(b) {
                              if (b === undefined) {
                                return;
                              }
                              let string = this._decoder.write(b);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 447..479

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

                            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

                            Interface.prototype._refreshLine = function() {
                              // line length
                              const line = this._prompt + this.line;
                              const dispPos = this._getDisplayPos(line);
                              const lineCols = dispPos.cols;
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 368..406

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

                            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

                            Interface.prototype._addHistory = function() {
                              if (this.line.length === 0) return '';
                            
                              // If the history is disabled then return the line
                              if (this.historySize === 0) return this.line;
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 341..365

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

                            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

                            Interface.prototype[SymbolAsyncIterator] = function() {
                              if (this[kLineObjectStream] === undefined) {
                                if (Readable === undefined) {
                                  Readable = require('stream').Readable;
                                }
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 1070..1101

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

                            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

                            Interface.prototype._historyPrev = function() {
                              if (this.historyIndex < this.history.length && this.history.length) {
                                const search = this[kSubstringSearch] || '';
                                let index = this.historyIndex + 1;
                                while (index < this.history.length &&
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 688..706

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

                            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 moveCursor(stream, dx, dy, callback) {
                              if (callback !== undefined && typeof callback !== 'function')
                                throw new ERR_INVALID_CALLBACK(callback);
                            
                              if (stream == null || !(dx || dy)) {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 1202..1227

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

                            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

                            Interface.prototype._historyNext = function() {
                              if (this.historyIndex >= 0) {
                                const search = this[kSubstringSearch] || '';
                                let index = this.historyIndex - 1;
                                while (index >= 0 &&
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 668..686

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

                            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

                            Interface.prototype._insertString = function(c) {
                              if (this.cursor < this.line.length) {
                                const beg = this.line.slice(0, this.cursor);
                                const end = this.line.slice(this.cursor, this.line.length);
                                this.line = beg + c + end;
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 481..498

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 221.

                            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

                            Interface.prototype._moveCursor = function(dx) {
                              if (dx === 0) {
                                return;
                              }
                              const oldPos = this.getCursorPos();
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 751..774

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

                            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 cursorTo(stream, x, y, callback) {
                              if (callback !== undefined && typeof callback !== 'function')
                                throw new ERR_INVALID_CALLBACK(callback);
                            
                              if (typeof y === 'function') {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 1176..1196

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 213.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._deleteWordLeft = function() {
                              if (this.cursor > 0) {
                                // Reverse the string and match a word near beginning
                                // to avoid quadratic time complexity
                                let leading = this.line.slice(0, this.cursor);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 day to fix
                            lts/lib/readline.js on lines 607..619

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

                            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

                            Interface.prototype._deleteLeft = function() {
                              if (this.cursor > 0 && this.line.length > 0) {
                                // The number of UTF-16 units comprising the character to the left
                                const charSize = charLengthLeft(this.line, this.cursor);
                                this.line = this.line.slice(0, this.cursor - charSize) +
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 6 hrs to fix
                            lts/lib/readline.js on lines 583..593

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

                            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

                            Interface.prototype._deleteWordRight = function() {
                              if (this.cursor < this.line.length) {
                                const trailing = this.line.slice(this.cursor);
                                const match = trailing.match(/^(?:\s+|\W+|\w+)\s*/);
                                this.line = this.line.slice(0, this.cursor) +
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 5 hrs to fix
                            lts/lib/readline.js on lines 622..630

                            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

                            Interface.prototype._deleteRight = function() {
                              if (this.cursor < this.line.length) {
                                // The number of UTF-16 units comprising the character to the left
                                const charSize = charLengthAt(this.line, this.cursor);
                                this.line = this.line.slice(0, this.cursor) +
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 5 hrs to fix
                            lts/lib/readline.js on lines 596..604

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

                            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

                            Interface.prototype._wordLeft = function() {
                              if (this.cursor > 0) {
                                // Reverse the string and match a word near beginning
                                // to avoid quadratic time complexity
                                const leading = this.line.slice(0, this.cursor);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 4 hrs to fix
                            lts/lib/readline.js on lines 563..572

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 128.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            function clearLine(stream, dir, callback) {
                              if (callback !== undefined && typeof callback !== 'function')
                                throw new ERR_INVALID_CALLBACK(callback);
                            
                              if (stream === null || stream === undefined) {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 4 hrs to fix
                            lts/lib/readline.js on lines 1236..1252

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

                            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

                            Interface.prototype.prompt = function(preserveCursor) {
                              if (this.paused) this.resume();
                              if (this.terminal && process.env.TERM !== 'dumb') {
                                if (!preserveCursor) this.cursor = 0;
                                this._refreshLine();
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 3 hrs to fix
                            lts/lib/readline.js on lines 297..305

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

                            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

                            Interface.prototype.question = function(query, cb) {
                              if (typeof cb === 'function') {
                                if (this._questionCallback) {
                                  this.prompt();
                                } else {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 3 hrs to fix
                            lts/lib/readline.js on lines 308..319

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 107.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._wordRight = function() {
                              if (this.cursor < this.line.length) {
                                const trailing = this.line.slice(this.cursor);
                                const match = trailing.match(/^(?:\s+|[^\w\s]+|\w+)\s*/);
                                this._moveCursor(match[0].length);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 3 hrs to fix
                            lts/lib/readline.js on lines 575..581

                            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

                            function clearScreenDown(stream, callback) {
                              if (callback !== undefined && typeof callback !== 'function')
                                throw new ERR_INVALID_CALLBACK(callback);
                            
                              if (stream === null || stream === undefined) {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 1258..1269

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 93.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._onLine = function(line) {
                              if (this._questionCallback) {
                                const cb = this._questionCallback;
                                this._questionCallback = null;
                                this.setPrompt(this._oldPrompt);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 322..331

                            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 onkeypress(s, key) {
                                self._ttyWrite(s, key);
                                if (key && key.sequence) {
                                  // If the key.sequence is half of a surrogate pair
                                  // (>= 0xd800 and <= 0xdfff), refresh the line so
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 204..214

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

                            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

                            Interface.prototype.close = function() {
                              if (this.closed) return;
                              this.pause();
                              if (this.terminal) {
                                this._setRawMode(false);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 409..417

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 83.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype.write = function(d, key) {
                              if (this.paused) this.resume();
                              if (this.terminal) {
                                this._ttyWrite(d, key);
                              } else {
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 438..445

                            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

                            Interface.prototype.clearLine = function() {
                              this._moveCursor(+Infinity);
                              this._writeToOutput('\r\n');
                              this.line = '';
                              this.cursor = 0;
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 646..652

                            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

                            Interface.prototype._setRawMode = function(mode) {
                              const wasInRawMode = this.input.isRaw;
                            
                              if (typeof this.input.setRawMode === 'function') {
                                this.input.setRawMode(mode);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 2 hrs to fix
                            lts/lib/readline.js on lines 286..294

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 75.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._writeToOutput = function _writeToOutput(stringToWrite) {
                              validateString(stringToWrite, 'stringToWrite');
                            
                              if (this.output !== null && this.output !== undefined) {
                                this.output.write(stringToWrite);
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 333..339

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

                            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

                            Interface.prototype.resume = function() {
                              if (!this.paused) return;
                              this.input.resume();
                              this.paused = false;
                              this.emit('resume');
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 429..435

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 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

                            ObjectDefineProperty(Interface.prototype, 'columns', {
                              configurable: true,
                              enumerable: true,
                              get: function() {
                                if (this.output && this.output.columns)
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 271..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 68.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._deleteLineLeft = function() {
                              this.line = this.line.slice(this.cursor);
                              this.cursor = 0;
                              this._refreshLine();
                            };
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 633..637

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 68.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype.pause = function() {
                              if (this.paused) return;
                              this.input.pause();
                              this.paused = true;
                              this.emit('pause');
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 420..426

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 68.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              function onend() {
                                if (typeof self._line_buffer === 'string' &&
                                    self._line_buffer.length > 0) {
                                  self.emit('line', self._line_buffer);
                                }
                            Severity: Major
                            Found in current/lib/readline.js and 3 other locations - About 1 hr to fix
                            current/lib/readline.js on lines 205..210
                            lts/lib/readline.js on lines 189..195
                            lts/lib/readline.js on lines 197..202

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 67.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              function ontermend() {
                                if (typeof self.line === 'string' && self.line.length > 0) {
                                  self.emit('line', self.line);
                                }
                                self.close();
                            Severity: Major
                            Found in current/lib/readline.js and 3 other locations - About 1 hr to fix
                            current/lib/readline.js on lines 197..203
                            lts/lib/readline.js on lines 189..195
                            lts/lib/readline.js on lines 197..202

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 67.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype.getCursorPos = function() {
                              const strBeforeCursor = this._prompt + this.line.substring(0, this.cursor);
                              return this._getDisplayPos(strBeforeCursor);
                            };
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 743..746

                            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

                            Interface.prototype._line = function() {
                              const line = this._addHistory();
                              this.clearLine();
                              this._onLine(line);
                            };
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 655..659

                            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

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

                                if (width === 0 || width === 1) {
                                  offset += width;
                                } else { // width === 2
                                  if ((offset + 1) % col === 0) {
                                    offset++;
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 728..735

                            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

                              if (typeof completer === 'function') {
                                this.completer = completer.length === 2 ?
                                  completer :
                                  function completerWrapper(v, cb) {
                                    cb(null, completer(v));
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 169..175

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

                            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 (input.escapeCodeTimeout !== undefined) {
                                  if (NumberIsFinite(input.escapeCodeTimeout)) {
                                    this.escapeCodeTimeout = input.escapeCodeTimeout;
                                  } else {
                                    throw new ERR_INVALID_OPT_VALUE(
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 125..134

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

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

                            const {
                              DateNow,
                              MathCeil,
                              MathFloor,
                              MathMax,
                            Severity: Major
                            Found in current/lib/readline.js and 9 other locations - About 1 hr to fix
                            current/lib/internal/http2/core.js on lines 215..226
                            current/lib/internal/source_map/source_map_cache.js on lines 3..14
                            lts/lib/internal/source_map/source_map_cache.js on lines 3..14
                            current/lib/internal/event_target.js on lines 3..14
                            current/lib/internal/worker.js on lines 33..44
                            current/lib/util.js on lines 24..35
                            lts/lib/internal/worker.js on lines 33..44
                            lts/lib/readline.js on lines 30..41
                            lts/lib/util.js on lines 24..35

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 58.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            Interface.prototype._deleteLineRight = function() {
                              this.line = this.line.slice(0, this.cursor);
                              this._refreshLine();
                            };
                            Severity: Major
                            Found in current/lib/readline.js and 1 other location - About 1 hr to fix
                            lts/lib/readline.js on lines 640..643

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 58.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            module.exports = {
                              Interface,
                              clearLine,
                              clearScreenDown,
                              createInterface,
                            Severity: Major
                            Found in current/lib/readline.js and 3 other locations - About 35 mins to fix
                            current/lib/internal/dns/utils.js on lines 168..176
                            lts/lib/internal/dns/utils.js on lines 168..176
                            lts/lib/readline.js on lines 1271..1279

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 47.

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

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

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

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

                            Refactorings

                            Further Reading

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

                              if (terminal === undefined && !(output === null || output === undefined)) {
                                terminal = !!output.isTTY;
                              }
                            Severity: Minor
                            Found in current/lib/readline.js and 1 other location - About 35 mins to fix
                            lts/lib/readline.js on lines 155..157

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 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

                            There are no issues that match your filters.

                            Category
                            Status