src/text-editor.js

Summary

Maintainability
F
1 mo
Test Coverage

File text-editor.js has 3486 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const _ = require('underscore-plus');
const path = require('path');
const fs = require('fs-plus');
const Grim = require('grim');
const dedent = require('dedent');
Severity: Major
Found in src/text-editor.js - About 1 wk to fix

    exports has 458 functions (exceeds 20 allowed). Consider refactoring.
    Open

    module.exports = class TextEditor {
      static setClipboard(clipboard) {
        this.clipboard = clipboard;
      }
    
    
    Severity: Major
    Found in src/text-editor.js - About 1 wk to fix

      Function toggleLineCommentsForBufferRows has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
      Open

        toggleLineCommentsForBufferRows(start, end, options = {}) {
          const languageMode = this.buffer.getLanguageMode();
          let { commentStartString, commentEndString } =
            (languageMode.commentStringsForPosition &&
              languageMode.commentStringsForPosition(new Point(start, 0))) ||
      Severity: Minor
      Found in src/text-editor.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 constructor has 164 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(params = {}) {
          if (this.constructor.clipboard == null) {
            throw new Error(
              'Must call TextEditor.setClipboard at least once before creating TextEditor instances'
            );
      Severity: Major
      Found in src/text-editor.js - About 6 hrs to fix

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

          constructor(params = {}) {
            if (this.constructor.clipboard == null) {
              throw new Error(
                'Must call TextEditor.setClipboard at least once before creating TextEditor instances'
              );
        Severity: Minor
        Found in src/text-editor.js - About 5 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function toggleLineCommentsForBufferRows has 129 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          toggleLineCommentsForBufferRows(start, end, options = {}) {
            const languageMode = this.buffer.getLanguageMode();
            let { commentStartString, commentEndString } =
              (languageMode.commentStringsForPosition &&
                languageMode.commentStringsForPosition(new Point(start, 0))) ||
        Severity: Major
        Found in src/text-editor.js - About 5 hrs to fix

          Function update has 103 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            update(params) {
              const displayLayerParams = {};
          
              for (let param of Object.keys(params)) {
                const value = params[param];
          Severity: Major
          Found in src/text-editor.js - About 4 hrs to fix

            Function moveLineUp has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              moveLineUp(options = {}) {
                if (!this.ensureWritable('moveLineUp', options)) return;
            
                const selections = this.getSelectedBufferRanges().sort((a, b) =>
                  a.compare(b)
            Severity: Major
            Found in src/text-editor.js - About 2 hrs to fix

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

                getLongTitle() {
                  if (this.getPath()) {
                    const fileName = this.getFileName();
              
                    let myPathSegments;
              Severity: Minor
              Found in src/text-editor.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 moveLineDown has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                moveLineDown(options = {}) {
                  if (!this.ensureWritable('moveLineDown', options)) return;
              
                  const selections = this.getSelectedBufferRanges();
                  selections.sort((a, b) => b.compare(a));
              Severity: Major
              Found in src/text-editor.js - About 2 hrs to fix

                Function duplicateLines has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  duplicateLines(options = {}) {
                    if (!this.ensureWritable('duplicateLines', options)) return;
                    this.transact(() => {
                      const selections = this.getSelectionsOrderedByBufferPosition();
                      const previousSelectionRanges = [];
                Severity: Major
                Found in src/text-editor.js - About 2 hrs to fix

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

                    screenPositionForBufferPosition(bufferPosition, options) {
                      if (options && options.clip) {
                        Grim.deprecate(
                          'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                        );
                  Severity: Minor
                  Found in src/text-editor.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 bufferPositionForScreenPosition has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    bufferPositionForScreenPosition(screenPosition, options) {
                      if (options && options.clip) {
                        Grim.deprecate(
                          'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                        );
                  Severity: Minor
                  Found in src/text-editor.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 clipScreenPosition has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    clipScreenPosition(screenPosition, options) {
                      if (options && options.clip) {
                        Grim.deprecate(
                          'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                        );
                  Severity: Minor
                  Found in src/text-editor.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 setCursorScreenPosition has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                    setCursorScreenPosition(position, options) {
                      if (options && options.clip) {
                        Grim.deprecate(
                          'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                        );
                  Severity: Minor
                  Found in src/text-editor.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 pasteText has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    pasteText(options = {}) {
                      if (!this.ensureWritable('parseText', options)) return;
                      options = Object.assign({}, options);
                      let {
                        text: clipboardText,
                  Severity: Minor
                  Found in src/text-editor.js - About 1 hr to fix

                    Function getLongTitle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      getLongTitle() {
                        if (this.getPath()) {
                          const fileName = this.getFileName();
                    
                          let myPathSegments;
                    Severity: Minor
                    Found in src/text-editor.js - About 1 hr to fix

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

                        foldBufferRow(bufferRow) {
                          let position = Point(bufferRow, Infinity);
                          const languageMode = this.buffer.getLanguageMode();
                          while (true) {
                            const foldableRange =
                      Severity: Minor
                      Found in src/text-editor.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 rowRangeForParagraphAtBufferRow has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                        rowRangeForParagraphAtBufferRow(bufferRow) {
                          if (!NON_WHITESPACE_REGEXP.test(this.lineTextForBufferRow(bufferRow)))
                            return;
                      
                          const languageMode = this.buffer.getLanguageMode();
                      Severity: Minor
                      Found in src/text-editor.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 serialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        serialize() {
                          return {
                            deserializer: 'TextEditor',
                            version: SERIALIZATION_VERSION,
                      
                      
                      Severity: Minor
                      Found in src/text-editor.js - About 1 hr to fix

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

                          updateMini(value, finish, displayLayerParams = {}) {
                            if (value !== this.mini) {
                              this.mini = value;
                              this.emitter.emit('did-change-mini', value);
                              displayLayerParams.invisibles = this.getInvisibles();
                        Severity: Minor
                        Found in src/text-editor.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 subscribeToDisplayLayer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          subscribeToDisplayLayer() {
                            this.disposables.add(
                              this.displayLayer.onDidChange(changes => {
                                this.mergeIntersectingSelections();
                                if (this.component) this.component.didChangeDisplayLayer(changes);
                        Severity: Minor
                        Found in src/text-editor.js - About 1 hr to fix

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

                            setCursorScreenPosition(position, options) {
                              if (options && options.clip) {
                                Grim.deprecate(
                                  'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                                );
                          Severity: Minor
                          Found in src/text-editor.js - About 1 hr to fix

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

                              foldBufferRow(bufferRow) {
                                let position = Point(bufferRow, Infinity);
                                const languageMode = this.buffer.getLanguageMode();
                                while (true) {
                                  const foldableRange =
                            Severity: Minor
                            Found in src/text-editor.js - About 1 hr to fix

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

                                setDefaultCharWidth(
                                  defaultCharWidth,
                                  doubleWidthCharWidth,
                                  halfWidthCharWidth,
                                  koreanCharWidth
                              Severity: Minor
                              Found in src/text-editor.js - About 1 hr to fix

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

                                  moveSelectionRight(options = {}) {
                                    if (!this.ensureWritable('moveSelectionRight', options)) return;
                                    const selections = this.getSelectedBufferRanges();
                                    const noSelectionAtEndOfLine = selections.every(selection => {
                                      return (
                                Severity: Minor
                                Found in src/text-editor.js - About 1 hr to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              if (indentLevel < minBlankIndentLevel)
                                                minBlankIndentLevel = indentLevel;
                                  Severity: Major
                                  Found in src/text-editor.js - About 45 mins to fix

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

                                      static deserialize(state, atomEnvironment) {
                                        if (state.version !== SERIALIZATION_VERSION) return null;
                                    
                                        let bufferId = state.tokenizedBuffer
                                          ? state.tokenizedBuffer.bufferId
                                    Severity: Minor
                                    Found in src/text-editor.js - About 45 mins to fix

                                    Cognitive Complexity

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

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

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

                                    Further reading

                                    Avoid deeply nested control flow statements.
                                    Open

                                                  if (oldRange.start.column === endLineLength) {
                                                    const endCol = endLineLength - commentEndString.length - 1;
                                                    options.selection.setBufferRange(
                                                      [[end, endCol], [end, endCol]],
                                                      { autoscroll: false }
                                    Severity: Major
                                    Found in src/text-editor.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if (indentLevel < minIndentLevel) minIndentLevel = indentLevel;
                                      Severity: Major
                                      Found in src/text-editor.js - About 45 mins to fix

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

                                          setDefaultCharWidth(
                                            defaultCharWidth,
                                            doubleWidthCharWidth,
                                            halfWidthCharWidth,
                                            koreanCharWidth
                                        Severity: Minor
                                        Found in src/text-editor.js - About 45 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

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

                                          insertText(text, options = {}) {
                                            if (!this.ensureWritable('insertText', options)) return;
                                            if (!this.emitWillInsertTextEvent(text)) return false;
                                        
                                            let groupLastChanges = false;
                                        Severity: Minor
                                        Found in src/text-editor.js - About 35 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

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

                                          usesSoftTabs() {
                                            const languageMode = this.buffer.getLanguageMode();
                                            const hasIsRowCommented = languageMode.isRowCommented;
                                            for (
                                              let bufferRow = 0, end = Math.min(1000, this.buffer.getLastRow());
                                        Severity: Minor
                                        Found in src/text-editor.js - About 35 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

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

                                          addSelection(marker, options = {}) {
                                            const cursor = this.addCursor(marker);
                                            let selection = new Selection(
                                              Object.assign({ editor: this, marker, cursor }, options)
                                            );
                                        Severity: Minor
                                        Found in src/text-editor.js - About 35 mins to fix

                                        Cognitive Complexity

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

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

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

                                        Further reading

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

                                          update(params) {
                                            const displayLayerParams = {};
                                        
                                            for (let param of Object.keys(params)) {
                                              const value = params[param];
                                        Severity: Minor
                                        Found in src/text-editor.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 mergeSelections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          mergeSelections(...args) {
                                            const mergePredicate = args.pop();
                                            let fn = args.pop();
                                            let options = args.pop();
                                            if (typeof fn !== 'function') {
                                        Severity: Minor
                                        Found in src/text-editor.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 3 locations. Consider refactoring.
                                        Open

                                          screenPositionForBufferPosition(bufferPosition, options) {
                                            if (options && options.clip) {
                                              Grim.deprecate(
                                                'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                                              );
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
                                        src/text-editor.js on lines 2555..2582
                                        src/text-editor.js on lines 2669..2696

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          bufferPositionForScreenPosition(screenPosition, options) {
                                            if (options && options.clip) {
                                              Grim.deprecate(
                                                'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                                              );
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
                                        src/text-editor.js on lines 2518..2545
                                        src/text-editor.js on lines 2669..2696

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

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          clipScreenPosition(screenPosition, options) {
                                            if (options && options.clip) {
                                              Grim.deprecate(
                                                'The `clip` parameter has been deprecated and will be removed soon. Please, use `clipDirection` instead.'
                                              );
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 7 hrs to fix
                                        src/text-editor.js on lines 2518..2545
                                        src/text-editor.js on lines 2555..2582

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

                                        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

                                          setSelectedScreenRanges(screenRanges, options = {}) {
                                            if (!screenRanges.length)
                                              throw new Error('Passed an empty array to setSelectedScreenRanges');
                                        
                                            const selections = this.getSelections();
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 7 hrs to fix
                                        src/text-editor.js on lines 3490..3510

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 183.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          setSelectedBufferRanges(bufferRanges, options = {}) {
                                            if (!bufferRanges.length)
                                              throw new Error('Passed an empty array to setSelectedBufferRanges');
                                        
                                            const selections = this.getSelections();
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 7 hrs to fix
                                        src/text-editor.js on lines 3550..3570

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 183.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateReadOnly(value, finish) {
                                            if (value !== this.readOnly) {
                                              this.readOnly = value;
                                              if (this.component != null) {
                                                this.component.scheduleUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 657..665
                                        src/text-editor.js on lines 698..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 79.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateKeyboardInputEnabled(value, finish) {
                                            if (value !== this.keyboardInputEnabled) {
                                              this.keyboardInputEnabled = value;
                                              if (this.component != null) {
                                                this.component.scheduleUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 647..655
                                        src/text-editor.js on lines 698..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 79.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateShowLineNumbers(value, finish) {
                                            if (value !== this.showLineNumbers) {
                                              this.showLineNumbers = value;
                                              if (this.component != null) {
                                                this.component.scheduleUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 647..655
                                        src/text-editor.js on lines 657..665

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 79.

                                        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

                                          addCursorAtBufferPosition(bufferPosition, options) {
                                            this.selectionsMarkerLayer.markBufferPosition(bufferPosition, {
                                              invalidate: 'never'
                                            });
                                            if (!options || options.autoscroll !== false)
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 2 hrs to fix
                                        src/text-editor.js on lines 3226..3233

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

                                        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

                                          addCursorAtScreenPosition(screenPosition, options) {
                                            this.selectionsMarkerLayer.markScreenPosition(screenPosition, {
                                              invalidate: 'never'
                                            });
                                            if (!options || options.autoscroll !== false)
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 2 hrs to fix
                                        src/text-editor.js on lines 3212..3219

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

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

                                          updateShowInvisibles(value, finish, displayLayerParams = {}) {
                                            if (value !== this.showInvisibles) {
                                              this.showInvisibles = value;
                                              displayLayerParams.invisibles = this.getInvisibles();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 601..607
                                        src/text-editor.js on lines 609..615
                                        src/text-editor.js on lines 617..623
                                        src/text-editor.js on lines 690..696
                                        src/text-editor.js on lines 732..738

                                        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

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

                                          updateShowIndentGuide(value, finish, displayLayerParams = {}) {
                                            if (value !== this.showIndentGuide) {
                                              this.showIndentGuide = value;
                                              displayLayerParams.showIndentGuides = this.doesShowIndentGuide();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 601..607
                                        src/text-editor.js on lines 609..615
                                        src/text-editor.js on lines 617..623
                                        src/text-editor.js on lines 708..714
                                        src/text-editor.js on lines 732..738

                                        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

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

                                          updateMaxScreenLineLength(value, finish, displayLayerParams = {}) {
                                            if (value !== this.maxScreenLineLength) {
                                              this.maxScreenLineLength = value;
                                              displayLayerParams.softWrapColumn = this.getSoftWrapColumn();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 601..607
                                        src/text-editor.js on lines 609..615
                                        src/text-editor.js on lines 690..696
                                        src/text-editor.js on lines 708..714
                                        src/text-editor.js on lines 732..738

                                        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

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

                                          updatePreferredLineLength(value, finish, displayLayerParams = {}) {
                                            if (value !== this.preferredLineLength) {
                                              this.preferredLineLength = value;
                                              displayLayerParams.softWrapColumn = this.getSoftWrapColumn();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 601..607
                                        src/text-editor.js on lines 617..623
                                        src/text-editor.js on lines 690..696
                                        src/text-editor.js on lines 708..714
                                        src/text-editor.js on lines 732..738

                                        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

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

                                          updateWidth(value, finish, displayLayerParams = {}) {
                                            if (value !== this.width) {
                                              this.width = value;
                                              displayLayerParams.softWrapColumn = this.getSoftWrapColumn();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 601..607
                                        src/text-editor.js on lines 609..615
                                        src/text-editor.js on lines 617..623
                                        src/text-editor.js on lines 690..696
                                        src/text-editor.js on lines 708..714

                                        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

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

                                          updateSoftWrapAtPreferredLineLength(value, finish, displayLayerParams = {}) {
                                            if (value !== this.softWrapAtPreferredLineLength) {
                                              this.softWrapAtPreferredLineLength = value;
                                              displayLayerParams.softWrapColumn = this.getSoftWrapColumn();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 5 other locations - About 2 hrs to fix
                                        src/text-editor.js on lines 609..615
                                        src/text-editor.js on lines 617..623
                                        src/text-editor.js on lines 690..696
                                        src/text-editor.js on lines 708..714
                                        src/text-editor.js on lines 732..738

                                        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

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

                                            if (!opts.bypassReadOnly && this.isReadOnly()) {
                                              if (atom.inDevMode() || atom.inSpecMode()) {
                                                const e = new Error('Attempt to mutate a read-only TextEditor');
                                                e.detail =
                                                  `Your package is attempting to call ${methodName} on an editor that has been marked read-only. ` +
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/selection.js on lines 461..474

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 74.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          undo(options = {}) {
                                            if (!this.ensureWritable('undo', options)) return;
                                            this.avoidMergingSelections(() =>
                                              this.buffer.undo({ selectionsMarkerLayer: this.selectionsMarkerLayer })
                                            );
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 2428..2434

                                        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

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

                                          redo(options = {}) {
                                            if (!this.ensureWritable('redo', options)) return;
                                            this.avoidMergingSelections(() =>
                                              this.buffer.redo({ selectionsMarkerLayer: this.selectionsMarkerLayer })
                                            );
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 2416..2422

                                        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

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

                                          updateScrollPastEnd(value, finish) {
                                            if (value !== this.scrollPastEnd) {
                                              this.scrollPastEnd = value;
                                              if (this.component) this.component.scheduleUpdate();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 762..768

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 72.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateShowCursorOnSelection(value, finish) {
                                            if (value !== this.showCursorOnSelection) {
                                              this.showCursorOnSelection = value;
                                              if (this.component) this.component.scheduleUpdate();
                                            }
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 740..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 72.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          deleteToEndOfSubword(options = {}) {
                                            if (!this.ensureWritable('deleteToEndOfSubword', options)) return;
                                            this.mutateSelectedText(selection =>
                                              selection.deleteToEndOfSubword(options)
                                            );
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 2323..2328

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

                                          deleteToBeginningOfSubword(options = {}) {
                                            if (!this.ensureWritable('deleteToBeginningOfSubword', options)) return;
                                            this.mutateSelectedText(selection =>
                                              selection.deleteToBeginningOfSubword(options)
                                            );
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 2336..2341

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

                                          autoIndentSelectedRows(options = {}) {
                                            if (!this.ensureWritable('autoIndentSelectedRows', options)) return;
                                            return this.mutateSelectedText(selection =>
                                              selection.autoIndentSelectedRows(options)
                                            );
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 1762..1765

                                        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

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

                                          delete(options = {}) {
                                            if (!this.ensureWritable('delete', options)) return;
                                            return this.mutateSelectedText(selection => selection.delete(options));
                                          }
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 4448..4453

                                        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

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

                                          cutToEndOfLine(options = {}) {
                                            if (!this.ensureWritable('cutToEndOfLine', options)) return;
                                            let maintainClipboard = false;
                                            this.mutateSelectedText(selection => {
                                              selection.cutToEndOfLine(maintainClipboard, options);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 4751..4758

                                        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

                                          cutToEndOfBufferLine(options = {}) {
                                            if (!this.ensureWritable('cutToEndOfBufferLine', options)) return;
                                            let maintainClipboard = false;
                                            this.mutateSelectedText(selection => {
                                              selection.cutToEndOfBufferLine(maintainClipboard, options);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 4736..4743

                                        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

                                          updateSoftWrapHangingIndentLength(value, finish, displayLayerParams = {}) {
                                            if (value !== this.displayLayer.softWrapHangingIndent) {
                                              displayLayerParams.softWrapHangingIndent = value;
                                            }
                                            if (finish) this.finishUpdate(displayLayerParams);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 571..576

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

                                          updateAtomicSoftTabs(value, finish, displayLayerParams = {}) {
                                            if (value !== this.displayLayer.atomicSoftTabs) {
                                              displayLayerParams.atomicSoftTabs = value;
                                            }
                                            if (finish) this.finishUpdate(displayLayerParams);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 594..599

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

                                            while (startRow > 0) {
                                              if (!NON_WHITESPACE_REGEXP.test(this.lineTextForBufferRow(startRow - 1)))
                                                break;
                                              if (languageMode.isRowCommented(startRow - 1) !== isCommented) break;
                                              startRow--;
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 5786..5791

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 57.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            while (endRow + 1 < rowCount) {
                                              if (!NON_WHITESPACE_REGEXP.test(this.lineTextForBufferRow(endRow + 1)))
                                                break;
                                              if (languageMode.isRowCommented(endRow + 1) !== isCommented) break;
                                              endRow++;
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 5777..5782

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 57.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                while (
                                                  selection.end.row ===
                                                  (selections[0] != null ? selections[0].start.row : undefined)
                                                ) {
                                                  selectionsToMove.push(selections[0]);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 1908..1915

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 56.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                while (
                                                  selection.start.row ===
                                                  (selections[0] != null ? selections[0].end.row : undefined)
                                                ) {
                                                  selectionsToMove.push(selections[0]);
                                        Severity: Major
                                        Found in src/text-editor.js and 1 other location - About 1 hr to fix
                                        src/text-editor.js on lines 1822..1829

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 56.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          observeCursors(callback) {
                                            this.getCursors().forEach(callback);
                                            return this.onDidAddCursor(callback);
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 55 mins to fix
                                        src/text-editor.js on lines 1126..1129

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 53.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          observeSelections(callback) {
                                            this.getSelections().forEach(callback);
                                            return this.onDidAddSelection(callback);
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 55 mins to fix
                                        src/text-editor.js on lines 1094..1097

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 53.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          onDidChangeCursorPosition(callback) {
                                            return this.emitter.on('did-change-cursor-position', callback);
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 50 mins to fix
                                        src/atom-environment.js on lines 489..491

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 51.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (
                                                  selection.end.row > selection.start.row &&
                                                  selection.end.column === 0
                                                ) {
                                                  // Don't move the last line of a multi-line selection if the selection ends at column 0
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 1921..1927

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                                if (
                                                  selection.end.row > selection.start.row &&
                                                  selection.end.column === 0
                                                ) {
                                                  // Don't move the last line of a multi-line selection if the selection ends at column 0
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 1835..1841

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateAutoWidth(value, finish) {
                                            if (value !== this.autoWidth) {
                                              this.autoWidth = value;
                                            }
                                            if (finish) this.finishUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 45 mins to fix
                                        src/text-editor.js on lines 564..569
                                        src/text-editor.js on lines 748..753

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateAutoHight(value, finish) {
                                            if (value !== this.autoHeight) {
                                              this.autoHeight = value;
                                            }
                                            if (finish) this.finishUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 45 mins to fix
                                        src/text-editor.js on lines 564..569
                                        src/text-editor.js on lines 755..760

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          updateSoftTabs(value, finish) {
                                            if (value !== this.softTabs) {
                                              this.softTabs = value;
                                            }
                                            if (finish) this.finishUpdate();
                                        Severity: Major
                                        Found in src/text-editor.js and 2 other locations - About 45 mins to fix
                                        src/text-editor.js on lines 748..753
                                        src/text-editor.js on lines 755..760

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          getCursorBufferPositions() {
                                            return this.getCursors().map(cursor => cursor.getBufferPosition());
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 3164..3166

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          getCursorScreenPositions() {
                                            return this.getCursors().map(cursor => cursor.getScreenPosition());
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 3123..3125

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          upperCase(options = {}) {
                                            if (!this.ensureWritable('upperCase', options)) return;
                                            this.replaceSelectedText({ selectWordIfEmpty: true }, text =>
                                              text.toUpperCase(options)
                                            );
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 2205..2210

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          lowerCase(options = {}) {
                                            if (!this.ensureWritable('lowerCase', options)) return;
                                            this.replaceSelectedText({ selectWordIfEmpty: true }, text =>
                                              text.toLowerCase(options)
                                            );
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 45 mins to fix
                                        src/text-editor.js on lines 2191..2196

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 50.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          moveUp(lineCount) {
                                            return this.moveCursors(cursor =>
                                              cursor.moveUp(lineCount, { moveToEndOfSelection: true })
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3252..3256
                                        src/text-editor.js on lines 3261..3265

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 47.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.languageModeSubscription =
                                              languageMode.onDidTokenize &&
                                              languageMode.onDidTokenize(() => {
                                                this.emitter.emit('did-tokenize');
                                              });
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 35 mins to fix
                                        src/text-editor.js on lines 233..237

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

                                          moveLeft(columnCount) {
                                            return this.moveCursors(cursor =>
                                              cursor.moveLeft(columnCount, { moveToEndOfSelection: true })
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3243..3247
                                        src/text-editor.js on lines 3252..3256

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 47.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                            this.languageModeSubscription =
                                              languageMode.onDidTokenize &&
                                              languageMode.onDidTokenize(() => {
                                                this.emitter.emit('did-tokenize');
                                              });
                                        Severity: Minor
                                        Found in src/text-editor.js and 1 other location - About 35 mins to fix
                                        src/text-editor.js on lines 5222..5226

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

                                          moveDown(lineCount) {
                                            return this.moveCursors(cursor =>
                                              cursor.moveDown(lineCount, { moveToEndOfSelection: true })
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3243..3247
                                        src/text-editor.js on lines 3261..3265

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

                                          selectUp(rowCount) {
                                            return this.expandSelectionsBackward(selection =>
                                              selection.selectUp(rowCount)
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3662..3666
                                        src/text-editor.js on lines 3674..3678

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 46.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          selectLeft(columnCount) {
                                            return this.expandSelectionsBackward(selection =>
                                              selection.selectLeft(columnCount)
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3650..3654
                                        src/text-editor.js on lines 3662..3666

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 46.

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

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

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

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

                                        Refactorings

                                        Further Reading

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

                                          selectDown(rowCount) {
                                            return this.expandSelectionsForward(selection =>
                                              selection.selectDown(rowCount)
                                            );
                                          }
                                        Severity: Minor
                                        Found in src/text-editor.js and 2 other locations - About 35 mins to fix
                                        src/text-editor.js on lines 3650..3654
                                        src/text-editor.js on lines 3674..3678

                                        Duplicated Code

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

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

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

                                        Tuning

                                        This issue has a mass of 46.

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

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

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

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

                                        Refactorings

                                        Further Reading

                                        There are no issues that match your filters.

                                        Category
                                        Status