src/text-editor-component.js

Summary

Maintainability
F
1 mo
Test Coverage

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

/* global ResizeObserver */

const etch = require('etch');
const { Point, Range } = require('text-buffer');
const LineTopIndex = require('line-top-index');
Severity: Major
Found in src/text-editor-component.js - About 1 wk to fix

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

    module.exports = class TextEditorComponent {
      static setScheduler(scheduler) {
        etch.setScheduler(scheduler);
      }
    
    
    Severity: Major
    Found in src/text-editor-component.js - About 3 days to fix

      Function populateTextDecorationsToRender has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
      Open

        populateTextDecorationsToRender() {
          // Sort all boundaries in ascending order of position
          this.textDecorationBoundaries.sort((a, b) =>
            a.position.compare(b.position)
          );
      Severity: Minor
      Found in src/text-editor-component.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 render has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          const {
            rootComponent,
            showLineNumbers,
            height,
      Severity: Minor
      Found in src/text-editor-component.js - About 6 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function constructor has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(props) {
          this.props = props;
      
          if (!props.model) {
            props.model = new TextEditor({
      Severity: Major
      Found in src/text-editor-component.js - About 5 hrs to fix

        Function didMouseDownOnContent has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

          didMouseDownOnContent(event) {
            const { model } = this.props;
            const { target, button, detail, ctrlKey, shiftKey, metaKey } = event;
            const platform = this.getPlatform();
        
        
        Severity: Minor
        Found in src/text-editor-component.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 shouldUpdate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

          shouldUpdate(newProps) {
            const oldProps = this.props;
        
            if (!newProps.hasInitialMeasurements) return false;
        
        
        Severity: Minor
        Found in src/text-editor-component.js - About 4 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function render has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const {
              rootComponent,
              showLineNumbers,
              height,
        Severity: Major
        Found in src/text-editor-component.js - About 4 hrs to fix

          Function updateLines has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            updateLines(oldProps, newProps) {
              const {
                screenLines,
                tileStartRow,
                lineDecorations,
          Severity: Major
          Found in src/text-editor-component.js - About 4 hrs to fix

            Function shouldUpdate has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

              shouldUpdate(newProps) {
                const oldProps = this.props;
            
                if (oldProps.showLineNumbers !== newProps.showLineNumbers) return true;
                if (oldProps.height !== newProps.height) return true;
            Severity: Minor
            Found in src/text-editor-component.js - About 4 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function measureHorizontalPositionsOnLine has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

              measureHorizontalPositionsOnLine(
                lineNode,
                textNodes,
                columnsToMeasure,
                positions
            Severity: Minor
            Found in src/text-editor-component.js - About 4 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

            Function populateTextDecorationsToRender has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              populateTextDecorationsToRender() {
                // Sort all boundaries in ascending order of position
                this.textDecorationBoundaries.sort((a, b) =>
                  a.position.compare(b.position)
                );
            Severity: Major
            Found in src/text-editor-component.js - About 3 hrs to fix

              Function didMouseDownOnContent has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                didMouseDownOnContent(event) {
                  const { model } = this.props;
                  const { target, button, detail, ctrlKey, shiftKey, metaKey } = event;
                  const platform = this.getPlatform();
              
              
              Severity: Major
              Found in src/text-editor-component.js - About 3 hrs to fix

                Function getElement has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                  getElement(type, className, style) {
                    let element;
                    const elementsByDepth = this.elementsByType[type];
                    if (elementsByDepth) {
                      while (elementsByDepth.length > 0) {
                Severity: Minor
                Found in src/text-editor-component.js - About 3 hrs to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function didMouseDownOnLineNumberGutter has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  didMouseDownOnLineNumberGutter(event) {
                    const { model } = this.props;
                    const { target, button, ctrlKey, shiftKey, metaKey } = event;
                
                    // Only handle mousedown events for left mouse button
                Severity: Major
                Found in src/text-editor-component.js - About 3 hrs to fix

                  Function screenPositionForPixelPosition has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    screenPositionForPixelPosition({ top, left }) {
                      const { model } = this.props;
                  
                      const row = Math.min(
                        this.rowForPixelPosition(top),
                  Severity: Major
                  Found in src/text-editor-component.js - About 3 hrs to fix

                    Function addLineDecorationToRender has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                    Open

                      addLineDecorationToRender(type, decoration, screenRange, reversed) {
                        let decorationsToRender;
                        if (type === 'line') {
                          decorationsToRender = this.decorationsToRender.lines;
                        } else {
                    Severity: Minor
                    Found in src/text-editor-component.js - About 3 hrs to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function renderLineTiles has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      renderLineTiles() {
                        const style = {
                          position: 'absolute',
                          contain: 'strict',
                          overflow: 'hidden'
                    Severity: Major
                    Found in src/text-editor-component.js - About 2 hrs to fix

                      Function shouldUpdate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                      Open

                        shouldUpdate(newProps) {
                          const oldProps = this.props;
                          if (oldProps.top !== newProps.top) return true;
                          if (oldProps.height !== newProps.height) return true;
                          if (oldProps.width !== newProps.width) return true;
                      Severity: Minor
                      Found in src/text-editor-component.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 render has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const {
                            className,
                            screenRange,
                            lineHeight,
                      Severity: Major
                      Found in src/text-editor-component.js - About 2 hrs to fix

                        Function appendContents has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          appendContents() {
                            const { displayLayer, nodePool, screenLine, textDecorations } = this.props;
                        
                            this.textNodes.length = 0;
                        
                        
                        Severity: Major
                        Found in src/text-editor-component.js - About 2 hrs to fix

                          Function updateLines has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                            updateLines(oldProps, newProps) {
                              const {
                                screenLines,
                                tileStartRow,
                                lineDecorations,
                          Severity: Minor
                          Found in src/text-editor-component.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 updateSync has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                            updateSync(useScheduler = false) {
                              // Don't proceed if we know we are not visible
                              if (!this.visible) {
                                this.updateScheduled = false;
                                return;
                          Severity: Minor
                          Found in src/text-editor-component.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 appendContents has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                          Open

                            appendContents() {
                              const { displayLayer, nodePool, screenLine, textDecorations } = this.props;
                          
                              this.textNodes.length = 0;
                          
                          
                          Severity: Minor
                          Found in src/text-editor-component.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 renderLineNumberGutter has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            renderLineNumberGutter(gutter) {
                              const {
                                rootComponent,
                                showLineNumbers,
                                hasInitialMeasurements,
                          Severity: Major
                          Found in src/text-editor-component.js - About 2 hrs to fix

                            Function measureBlockDecorations has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              measureBlockDecorations() {
                                if (this.remeasureAllBlockDecorations) {
                                  this.remeasureAllBlockDecorations = false;
                            
                                  const decorations = this.props.model.getDecorations();
                            Severity: Major
                            Found in src/text-editor-component.js - About 2 hrs to fix

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

                                didAttach() {
                                  if (!this.attached) {
                                    this.attached = true;
                                    this.intersectionObserver = new IntersectionObserver(entries => {
                                      const { intersectionRect } = entries[entries.length - 1];
                              Severity: Minor
                              Found in src/text-editor-component.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 render has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render() {
                                  const { model } = this.props;
                                  const style = {};
                              
                                  if (!model.getAutoHeight() && !model.getAutoWidth()) {
                              Severity: Major
                              Found in src/text-editor-component.js - About 2 hrs to fix

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

                                  screenPositionForPixelPosition({ top, left }) {
                                    const { model } = this.props;
                                
                                    const row = Math.min(
                                      this.rowForPixelPosition(top),
                                Severity: Minor
                                Found in src/text-editor-component.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 updateSync has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  updateSync(useScheduler = false) {
                                    // Don't proceed if we know we are not visible
                                    if (!this.visible) {
                                      this.updateScheduled = false;
                                      return;
                                Severity: Major
                                Found in src/text-editor-component.js - About 2 hrs to fix

                                  Function measureHorizontalPositionsOnLine has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    measureHorizontalPositionsOnLine(
                                      lineNode,
                                      textNodes,
                                      columnsToMeasure,
                                      positions
                                  Severity: Major
                                  Found in src/text-editor-component.js - About 2 hrs to fix

                                    Function renderDummyScrollbars has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      renderDummyScrollbars() {
                                        if (this.shouldRenderDummyScrollbars && !this.props.model.isMini()) {
                                          let scrollHeight, scrollTop, horizontalScrollbarHeight;
                                          let scrollWidth,
                                            scrollLeft,
                                    Severity: Major
                                    Found in src/text-editor-component.js - About 2 hrs to fix

                                      Function shouldUpdate has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        shouldUpdate(newProps) {
                                          const oldProps = this.props;
                                      
                                          if (oldProps.showLineNumbers !== newProps.showLineNumbers) return true;
                                          if (oldProps.height !== newProps.height) return true;
                                      Severity: Major
                                      Found in src/text-editor-component.js - About 2 hrs to fix

                                        Function addCursorDecorationToMeasure has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          addCursorDecorationToMeasure(decoration, marker, screenRange, reversed) {
                                            const { model } = this.props;
                                            if (!model.getShowCursorOnSelection() && !screenRange.isEmpty()) return;
                                        
                                            let decorationToMeasure = this.decorationsToMeasure.cursors.get(marker);
                                        Severity: Minor
                                        Found in src/text-editor-component.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 textDecorationsEqual has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function textDecorationsEqual(oldDecorations, newDecorations) {
                                          if (!oldDecorations && newDecorations) return false;
                                          if (oldDecorations && !newDecorations) return false;
                                          if (oldDecorations && newDecorations) {
                                            if (oldDecorations.length !== newDecorations.length) return false;
                                        Severity: Minor
                                        Found in src/text-editor-component.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 update has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          update(props) {
                                            const {
                                              nodePool,
                                              className,
                                              width,
                                        Severity: Minor
                                        Found in src/text-editor-component.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 render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          render() {
                                            const {
                                              orientation,
                                              scrollWidth,
                                              scrollHeight,
                                        Severity: Major
                                        Found in src/text-editor-component.js - About 2 hrs to fix

                                          Function renderHiddenInput has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                            renderHiddenInput() {
                                              const {
                                                lineHeight,
                                                hiddenInputPosition,
                                                didBlurHiddenInput,
                                          Severity: Major
                                          Found in src/text-editor-component.js - About 2 hrs to fix

                                            Function addBlockDecoration has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                              addBlockDecoration(decoration, subscribeToChanges = true) {
                                                const marker = decoration.getMarker();
                                                const { item, position } = decoration.getProperties();
                                                const element = TextEditor.viewForItem(item);
                                            
                                            
                                            Severity: Minor
                                            Found in src/text-editor-component.js - About 2 hrs to fix

                                              Function addDecorationToRender has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                addDecorationToRender(type, decoration, marker, screenRange, reversed) {
                                                  if (Array.isArray(type)) {
                                                    for (let i = 0, length = type.length; i < length; i++) {
                                                      this.addDecorationToRender(
                                                        type[i],
                                              Severity: Minor
                                              Found in src/text-editor-component.js - About 2 hrs to fix

                                                Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  render() {
                                                    const {
                                                      lineHeight,
                                                      decorationsToRender,
                                                      scrollHeight,
                                                Severity: Minor
                                                Found in src/text-editor-component.js - About 1 hr to fix

                                                  Function shouldUpdate has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                    shouldUpdate(newProps) {
                                                      const oldProps = this.props;
                                                      if (oldProps.top !== newProps.top) return true;
                                                      if (oldProps.height !== newProps.height) return true;
                                                      if (oldProps.width !== newProps.width) return true;
                                                  Severity: Minor
                                                  Found in src/text-editor-component.js - About 1 hr to fix

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

                                                      measureHorizontalPositions() {
                                                        this.horizontalPositionsToMeasure.forEach((columnsToMeasure, row) => {
                                                          columnsToMeasure.sort((a, b) => a - b);
                                                    
                                                          const screenLine = this.renderedScreenLineForRow(row);
                                                    Severity: Minor
                                                    Found in src/text-editor-component.js - About 1 hr to fix

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

                                                        queryLineNumbersToRender() {
                                                          const { model } = this.props;
                                                          if (!model.anyLineNumberGutterVisible()) return;
                                                          if (this.showLineNumbers !== model.doesShowLineNumbers()) {
                                                            this.remeasureGutterDimensions = true;
                                                      Severity: Minor
                                                      Found in src/text-editor-component.js - About 1 hr to fix

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

                                                          addLineDecorationToRender(type, decoration, screenRange, reversed) {
                                                            let decorationsToRender;
                                                            if (type === 'line') {
                                                              decorationsToRender = this.decorationsToRender.lines;
                                                            } else {
                                                        Severity: Minor
                                                        Found in src/text-editor-component.js - About 1 hr to fix

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

                                                            render() {
                                                              const {
                                                                hasInitialMeasurements,
                                                                scrollTop,
                                                                scrollHeight,
                                                          Severity: Minor
                                                          Found in src/text-editor-component.js - About 1 hr to fix

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

                                                              autoscrollVertically(screenRange, options) {
                                                                const screenRangeTop = this.pixelPositionAfterBlocksForRow(
                                                                  screenRange.start.row
                                                                );
                                                                const screenRangeBottom =
                                                            Severity: Minor
                                                            Found in src/text-editor-component.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 update has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                              update(props) {
                                                                const {
                                                                  nodePool,
                                                                  className,
                                                                  width,
                                                            Severity: Minor
                                                            Found in src/text-editor-component.js - About 1 hr to fix

                                                              Function updateBlockDecorations has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                updateBlockDecorations(oldProps, newProps) {
                                                                  const { blockDecorations, lineComponentsByScreenLineId } = newProps;
                                                              
                                                                  if (oldProps.blockDecorations) {
                                                                    oldProps.blockDecorations.forEach((oldDecorations, screenLineId) => {
                                                              Severity: Minor
                                                              Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                function objectsEqual(a, b) {
                                                                  if (!a && b) return false;
                                                                  if (a && !b) return false;
                                                                  if (a && b) {
                                                                    for (const key in a) {
                                                                Severity: Minor
                                                                Found in src/text-editor-component.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 measureBlockDecorations has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                                                Open

                                                                  measureBlockDecorations() {
                                                                    if (this.remeasureAllBlockDecorations) {
                                                                      this.remeasureAllBlockDecorations = false;
                                                                
                                                                      const decorations = this.props.model.getDecorations();
                                                                Severity: Minor
                                                                Found in src/text-editor-component.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 update has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                  update(newProps) {
                                                                    if (this.shouldUpdate(newProps)) {
                                                                      this.props = newProps;
                                                                      const { height, width, lineHeight, highlightDecorations } = this.props;
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                    didAttach() {
                                                                      if (!this.attached) {
                                                                        this.attached = true;
                                                                        this.intersectionObserver = new IntersectionObserver(entries => {
                                                                          const { intersectionRect } = entries[entries.length - 1];
                                                                  Severity: Minor
                                                                  Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                      autoscrollOnMouseDrag({ clientX, clientY }, verticalOnly = false) {
                                                                        let {
                                                                          top,
                                                                          bottom,
                                                                          left,
                                                                    Severity: Minor
                                                                    Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                        getFirstElementForScreenLine(oldProps, screenLine) {
                                                                          const blockDecorations = oldProps.blockDecorations
                                                                            ? oldProps.blockDecorations.get(screenLine.id)
                                                                            : null;
                                                                          if (blockDecorations) {
                                                                      Severity: Minor
                                                                      Found in src/text-editor-component.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 updateClassList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                                                      Open

                                                                        updateClassList() {
                                                                          const { model } = this.props;
                                                                      
                                                                          const oldClassList = this.classList;
                                                                          const newClassList = ['editor'];
                                                                      Severity: Minor
                                                                      Found in src/text-editor-component.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 shouldUpdate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                        shouldUpdate(newProps) {
                                                                          const oldProps = this.props;
                                                                      
                                                                          if (!newProps.hasInitialMeasurements) return false;
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in src/text-editor-component.js - About 1 hr to fix

                                                                        Function autoscrollHorizontally has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                          autoscrollHorizontally(screenRange, options) {
                                                                            const horizontalScrollMargin = this.getHorizontalAutoscrollMargin();
                                                                        
                                                                            const gutterContainerWidth = this.getGutterContainerWidth();
                                                                            let left =
                                                                        Severity: Minor
                                                                        Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                            autoscrollVertically(screenRange, options) {
                                                                              const screenRangeTop = this.pixelPositionAfterBlocksForRow(
                                                                                screenRange.start.row
                                                                              );
                                                                              const screenRangeBottom =
                                                                          Severity: Minor
                                                                          Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                              updateOverlayToRender(decoration) {
                                                                                const windowInnerHeight = this.getWindowInnerHeight();
                                                                                const windowInnerWidth = this.getWindowInnerWidth();
                                                                                const contentClientRect = this.refs.content.getBoundingClientRect();
                                                                            
                                                                            
                                                                            Severity: Minor
                                                                            Found in src/text-editor-component.js - About 1 hr to fix

                                                                              Function addCursorDecorationToMeasure has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                                addCursorDecorationToMeasure(decoration, marker, screenRange, reversed) {
                                                                                  const { model } = this.props;
                                                                                  if (!model.getShowCursorOnSelection() && !screenRange.isEmpty()) return;
                                                                              
                                                                                  let decorationToMeasure = this.decorationsToMeasure.cursors.get(marker);
                                                                              Severity: Minor
                                                                              Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                  update(newProps) {
                                                                                    if (this.shouldUpdate(newProps)) {
                                                                                      this.props = newProps;
                                                                                      const { height, width, lineHeight, highlightDecorations } = this.props;
                                                                                
                                                                                
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.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 populateVisibleTiles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                                Open

                                                                                  populateVisibleTiles() {
                                                                                    const startRow = this.getRenderedStartRow();
                                                                                    const endRow = this.getRenderedEndRow();
                                                                                    const freeTileIds = [];
                                                                                    for (let i = 0; i < this.renderedTileStartRows.length; i++) {
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                                Open

                                                                                  update(newProps) {
                                                                                    const oldProps = this.props;
                                                                                    this.props = newProps;
                                                                                
                                                                                    if (newProps.top !== oldProps.top)
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.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 addBlockDecoration has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                                Open

                                                                                  addBlockDecoration(decoration, subscribeToChanges = true) {
                                                                                    const marker = decoration.getMarker();
                                                                                    const { item, position } = decoration.getProperties();
                                                                                    const element = TextEditor.viewForItem(item);
                                                                                
                                                                                
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                                Open

                                                                                  render() {
                                                                                    const { model } = this.props;
                                                                                    const style = {};
                                                                                
                                                                                    if (!model.getAutoHeight() && !model.getAutoWidth()) {
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.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 populateVisibleTiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                  populateVisibleTiles() {
                                                                                    const startRow = this.getRenderedStartRow();
                                                                                    const endRow = this.getRenderedEndRow();
                                                                                    const freeTileIds = [];
                                                                                    for (let i = 0; i < this.renderedTileStartRows.length; i++) {
                                                                                Severity: Minor
                                                                                Found in src/text-editor-component.js - About 1 hr to fix

                                                                                  Function getFirstElementForScreenLine has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                    getFirstElementForScreenLine(oldProps, screenLine) {
                                                                                      const blockDecorations = oldProps.blockDecorations
                                                                                        ? oldProps.blockDecorations.get(screenLine.id)
                                                                                        : null;
                                                                                      if (blockDecorations) {
                                                                                  Severity: Minor
                                                                                  Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                      addHighlightDecorationToMeasure(decoration, screenRange, key) {
                                                                                        screenRange = constrainRangeToRows(
                                                                                          screenRange,
                                                                                          this.getRenderedStartRow(),
                                                                                          this.getRenderedEndRow()
                                                                                    Severity: Minor
                                                                                    Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                        handleMouseDragUntilMouseUp({ didDrag, didStopDragging }) {
                                                                                          let dragging = false;
                                                                                          let lastMousemoveEvent;
                                                                                      
                                                                                          const animationFrameLoop = () => {
                                                                                      Severity: Minor
                                                                                      Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                          getElement(type, className, style) {
                                                                                            let element;
                                                                                            const elementsByDepth = this.elementsByType[type];
                                                                                            if (elementsByDepth) {
                                                                                              while (elementsByDepth.length > 0) {
                                                                                        Severity: Minor
                                                                                        Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                            queryDecorationsToRender() {
                                                                                              this.decorationsToRender.lineNumbers.clear();
                                                                                              this.decorationsToRender.lines = [];
                                                                                              this.decorationsToRender.overlays.length = 0;
                                                                                              this.decorationsToRender.customGutter.clear();
                                                                                          Severity: Minor
                                                                                          Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                              updateSyncBeforeMeasuringContent() {
                                                                                                this.measuredContent = false;
                                                                                                this.derivedDimensionsCache = {};
                                                                                                this.updateModelSoftWrapColumn();
                                                                                                if (this.pendingAutoscroll) {
                                                                                            Severity: Minor
                                                                                            Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                                queryLineNumbersToRender() {
                                                                                                  const { model } = this.props;
                                                                                                  if (!model.anyLineNumberGutterVisible()) return;
                                                                                                  if (this.showLineNumbers !== model.doesShowLineNumbers()) {
                                                                                                    this.remeasureGutterDimensions = true;
                                                                                              Severity: Minor
                                                                                              Found in src/text-editor-component.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 autoscrollHorizontally has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                                                                              Open

                                                                                                autoscrollHorizontally(screenRange, options) {
                                                                                                  const horizontalScrollMargin = this.getHorizontalAutoscrollMargin();
                                                                                              
                                                                                                  const gutterContainerWidth = this.getGutterContainerWidth();
                                                                                                  let left =
                                                                                              Severity: Minor
                                                                                              Found in src/text-editor-component.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 constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                                constructor(props) {
                                                                                                  this.props = props;
                                                                                                  this.element = document.createElement('atom-overlay');
                                                                                                  if (this.props.className != null)
                                                                                                    this.element.classList.add(this.props.className);
                                                                                              Severity: Minor
                                                                                              Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                                  measureContentDuringUpdateSync() {
                                                                                                    let gutterDimensionsChanged = false;
                                                                                                    if (this.remeasureGutterDimensions) {
                                                                                                      gutterDimensionsChanged = this.measureGutterDimensions();
                                                                                                      this.remeasureGutterDimensions = false;
                                                                                                Severity: Minor
                                                                                                Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                                    addBlockDecorationToRender(decoration, screenRange, reversed) {
                                                                                                      const { row } = reversed ? screenRange.start : screenRange.end;
                                                                                                      if (row < this.getRenderedStartRow() || row >= this.getRenderedEndRow())
                                                                                                        return;
                                                                                                  
                                                                                                  
                                                                                                  Severity: Minor
                                                                                                  Found in src/text-editor-component.js - About 1 hr to fix

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

                                                                                                      didChangeSelectionRange() {
                                                                                                        const { model } = this.props;
                                                                                                    
                                                                                                        if (this.getPlatform() === 'linux') {
                                                                                                          if (this.selectionClipboardImmediateId) {
                                                                                                    Severity: Minor
                                                                                                    Found in src/text-editor-component.js - About 55 mins to fix

                                                                                                    Cognitive Complexity

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

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

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

                                                                                                    Further reading

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

                                                                                                      measureGutterDimensions() {
                                                                                                        let dimensionsChanged = false;
                                                                                                    
                                                                                                        if (this.refs.gutterContainer) {
                                                                                                          const gutterContainerWidth = this.refs.gutterContainer.element
                                                                                                    Severity: Minor
                                                                                                    Found in src/text-editor-component.js - About 55 mins to fix

                                                                                                    Cognitive Complexity

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

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

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

                                                                                                    Further reading

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

                                                                                                      didMouseDownOnLineNumberGutter(event) {
                                                                                                        const { model } = this.props;
                                                                                                        const { target, button, ctrlKey, shiftKey, metaKey } = event;
                                                                                                    
                                                                                                        // Only handle mousedown events for left mouse button
                                                                                                    Severity: Minor
                                                                                                    Found in src/text-editor-component.js - About 55 mins to fix

                                                                                                    Cognitive Complexity

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

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

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

                                                                                                    Further reading

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

                                                                                                      release(node, depth = 0) {
                                                                                                        const { nodeName } = node;
                                                                                                        if (nodeName === '#text') {
                                                                                                          this.textNodes.push(node);
                                                                                                        } else {
                                                                                                    Severity: Minor
                                                                                                    Found in src/text-editor-component.js - About 55 mins to fix

                                                                                                    Cognitive Complexity

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

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

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

                                                                                                    Further reading

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                if (this.props.labelFn == null) {
                                                                                                                  number = softWrapped ? '•' : bufferRow + 1;
                                                                                                                  number =
                                                                                                                    NBSP_CHARACTER.repeat(maxDigits - number.length) + number;
                                                                                                                } else {
                                                                                                    Severity: Major
                                                                                                    Found in src/text-editor-component.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                while (oldScreenLineIndex < newScreenLineIndexInOldScreenLines) {
                                                                                                                  this.lineComponents[lineComponentIndex].destroy();
                                                                                                                  this.lineComponents.splice(lineComponentIndex, 1);
                                                                                                      
                                                                                                                  oldScreenLineIndex++;
                                                                                                      Severity: Major
                                                                                                      Found in src/text-editor-component.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                    if (className) {
                                                                                                                      className += ' ' + decoration.class;
                                                                                                                    } else {
                                                                                                                      className = decoration.class;
                                                                                                                    }
                                                                                                        Severity: Major
                                                                                                        Found in src/text-editor-component.js - About 45 mins to fix

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

                                                                                                            update(newProps) {
                                                                                                              const oldProps = this.props;
                                                                                                              this.props = Object.assign({}, oldProps, newProps);
                                                                                                              if (this.props.pixelTop != null)
                                                                                                                this.element.style.top = this.props.pixelTop + 'px';
                                                                                                          Severity: Minor
                                                                                                          Found in src/text-editor-component.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 (style) {
                                                                                                                        Object.assign(style, decoration.style);
                                                                                                                      } else {
                                                                                                                        style = Object.assign({}, decoration.style);
                                                                                                                      }
                                                                                                          Severity: Major
                                                                                                          Found in src/text-editor-component.js - About 45 mins to fix

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

                                                                                                              constructor(props) {
                                                                                                                this.props = props;
                                                                                                            
                                                                                                                if (!props.model) {
                                                                                                                  props.model = new TextEditor({
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 handleMouseDragUntilMouseUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              handleMouseDragUntilMouseUp({ didDrag, didStopDragging }) {
                                                                                                                let dragging = false;
                                                                                                                let lastMousemoveEvent;
                                                                                                            
                                                                                                                const animationFrameLoop = () => {
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              render() {
                                                                                                                const {
                                                                                                                  orientation,
                                                                                                                  scrollWidth,
                                                                                                                  scrollHeight,
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 queryGuttersToRender has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              queryGuttersToRender() {
                                                                                                                const oldGuttersToRender = this.guttersToRender;
                                                                                                                const oldGuttersVisibility = this.guttersVisibility;
                                                                                                                this.guttersToRender = this.props.model.getGutters();
                                                                                                                this.guttersVisibility = this.guttersToRender.map(g => g.visible);
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 addDecorationToRender has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              addDecorationToRender(type, decoration, marker, screenRange, reversed) {
                                                                                                                if (Array.isArray(type)) {
                                                                                                                  for (let i = 0, length = type.length; i < length; i++) {
                                                                                                                    this.addDecorationToRender(
                                                                                                                      type[i],
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 autoscrollOnMouseDrag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              autoscrollOnMouseDrag({ clientX, clientY }, verticalOnly = false) {
                                                                                                                let {
                                                                                                                  top,
                                                                                                                  bottom,
                                                                                                                  left,
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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 didTextInput has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                              didTextInput(event) {
                                                                                                                if (this.compositionCheckpoint) {
                                                                                                                  this.props.model.revertToCheckpoint(this.compositionCheckpoint);
                                                                                                                  this.compositionCheckpoint = null;
                                                                                                                }
                                                                                                            Severity: Minor
                                                                                                            Found in src/text-editor-component.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

                                                                                                            Avoid too many return statements within this function.
                                                                                                            Open

                                                                                                                  return true;
                                                                                                            Severity: Major
                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                              Avoid too many return statements within this function.
                                                                                                              Open

                                                                                                                    return;
                                                                                                              Severity: Major
                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                Avoid too many return statements within this function.
                                                                                                                Open

                                                                                                                    if (!arraysEqual(oldProps.decorations, newProps.decorations)) return true;
                                                                                                                Severity: Major
                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                  Avoid too many return statements within this function.
                                                                                                                  Open

                                                                                                                      if (oldProps.rowsPerTile !== newProps.rowsPerTile) return true;
                                                                                                                  Severity: Major
                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                    Avoid too many return statements within this function.
                                                                                                                    Open

                                                                                                                            if (blockDecorationsChanged) return true;
                                                                                                                    Severity: Major
                                                                                                                    Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                      Avoid too many return statements within this function.
                                                                                                                      Open

                                                                                                                          if (oldProps.startRow !== newProps.startRow) return true;
                                                                                                                      Severity: Major
                                                                                                                      Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                        Avoid too many return statements within this function.
                                                                                                                        Open

                                                                                                                            if (oldProps.labelFn !== newProps.labelFn) return true;
                                                                                                                        Severity: Major
                                                                                                                        Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                          Avoid too many return statements within this function.
                                                                                                                          Open

                                                                                                                              if (oldProps.className !== newProps.className) return true;
                                                                                                                          Severity: Major
                                                                                                                          Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                            Avoid too many return statements within this function.
                                                                                                                            Open

                                                                                                                                if (newProps.didMeasureVisibleBlockDecoration) return true;
                                                                                                                            Severity: Major
                                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                              Avoid too many return statements within this function.
                                                                                                                              Open

                                                                                                                                  if (!arraysEqual(oldProps.keys, newProps.keys)) return true;
                                                                                                                              Severity: Major
                                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                Open

                                                                                                                                    if (oldProps.endRow !== newProps.endRow) return true;
                                                                                                                                Severity: Major
                                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                  Open

                                                                                                                                            return true;
                                                                                                                                  Severity: Major
                                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                    Open

                                                                                                                                        if (oldProps.maxDigits !== newProps.maxDigits) return true;
                                                                                                                                    Severity: Major
                                                                                                                                    Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                          if (!arraysEqual(oldProps.bufferRows, newProps.bufferRows)) return true;
                                                                                                                                      Severity: Major
                                                                                                                                      Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                  return true;
                                                                                                                                        Severity: Major
                                                                                                                                        Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                  return true;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                      return true;
                                                                                                                                            Severity: Major
                                                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                        return true;
                                                                                                                                              Severity: Major
                                                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                        if (oldHighlight.endPixelTop !== newHighlight.endPixelTop) return true;
                                                                                                                                                Severity: Major
                                                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                    return true;
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                            if (blockDecorationsChanged) return true;
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                          return false;
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                            if (oldProps.tileEndRow !== newProps.tileEndRow) return true;
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                    return true;
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                    return true;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                      return false;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                    return false;
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                          if (newHighlight.flashRequested) return true;
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                          return true;
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                            return true;
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                          return true;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                return true;
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                if (!arraysEqual(oldProps.screenLines, newProps.screenLines)) return true;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                    return true;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                        return true;
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                  Open

                                                                                                                                                                                          return true;
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                    Open

                                                                                                                                                                                          if (blockDecorationsChanged) return true;
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                      Open

                                                                                                                                                                                            if (blockDecorationsChanged) return true;
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                                        Open

                                                                                                                                                                                            if (oldProps.tileStartRow !== newProps.tileStartRow) return true;
                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                        Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                          Open

                                                                                                                                                                                                return true;
                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                          Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                            Open

                                                                                                                                                                                                    if (oldHighlight.className !== newHighlight.className) return true;
                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                            Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                                              Open

                                                                                                                                                                                                    return true;
                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                              Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                                Open

                                                                                                                                                                                                        return true;
                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                Found in src/text-editor-component.js - About 30 mins to fix

                                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                                  Open

                                                                                                                                                                                                          return false;
                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                  Found in src/text-editor-component.js - About 30 mins to fix

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

                                                                                                                                                                                                      updateOverlayToRender(decoration) {
                                                                                                                                                                                                        const windowInnerHeight = this.getWindowInnerHeight();
                                                                                                                                                                                                        const windowInnerWidth = this.getWindowInnerWidth();
                                                                                                                                                                                                        const contentClientRect = this.refs.content.getBoundingClientRect();
                                                                                                                                                                                                    
                                                                                                                                                                                                    
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      render() {
                                                                                                                                                                                                        const {
                                                                                                                                                                                                          className,
                                                                                                                                                                                                          screenRange,
                                                                                                                                                                                                          lineHeight,
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.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 constrainRangeToRows has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                    function constrainRangeToRows(range, startRow, endRow) {
                                                                                                                                                                                                      if (range.start.row < startRow || range.end.row >= endRow) {
                                                                                                                                                                                                        range = range.copy();
                                                                                                                                                                                                        if (range.start.row < startRow) {
                                                                                                                                                                                                          range.start.row = startRow;
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      constructor(props) {
                                                                                                                                                                                                        this.props = props;
                                                                                                                                                                                                        this.element = document.createElement('atom-overlay');
                                                                                                                                                                                                        if (this.props.className != null)
                                                                                                                                                                                                          this.element.classList.add(this.props.className);
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.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 didResize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      didResize() {
                                                                                                                                                                                                        // Prevent the component from measuring the client container dimensions when
                                                                                                                                                                                                        // getting spurious resize events.
                                                                                                                                                                                                        if (this.isVisible()) {
                                                                                                                                                                                                          const clientContainerWidthChanged = this.measureClientContainerWidth();
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js - About 25 mins to fix

                                                                                                                                                                                                    Cognitive Complexity

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

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

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

                                                                                                                                                                                                    Further reading

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

                                                                                                                                                                                                        if (!options || options.reversed !== false) {
                                                                                                                                                                                                          if (desiredScrollRight > this.getScrollRight()) {
                                                                                                                                                                                                            this.setScrollRight(desiredScrollRight);
                                                                                                                                                                                                          }
                                                                                                                                                                                                          if (desiredScrollLeft < this.getScrollLeft()) {
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 5 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2321..2335

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

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (!options || options.reversed !== false) {
                                                                                                                                                                                                          if (desiredScrollBottom > this.getScrollBottom()) {
                                                                                                                                                                                                            this.setScrollBottom(desiredScrollBottom);
                                                                                                                                                                                                          }
                                                                                                                                                                                                          if (desiredScrollTop < this.getScrollTop()) {
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 5 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2363..2377

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

                                                                                                                                                                                                    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 (orientation === 'horizontal') {
                                                                                                                                                                                                          let right = verticalScrollbarWidth || 0;
                                                                                                                                                                                                          outerStyle.bottom = 0;
                                                                                                                                                                                                          outerStyle.left = 0;
                                                                                                                                                                                                          outerStyle.right = right + 'px';
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3462..3473

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 131.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        } else {
                                                                                                                                                                                                          let bottom = horizontalScrollbarHeight || 0;
                                                                                                                                                                                                          outerStyle.right = 0;
                                                                                                                                                                                                          outerStyle.top = 0;
                                                                                                                                                                                                          outerStyle.bottom = bottom + 'px';
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 4 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3451..3462

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 131.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                            if (wasValid) {
                                                                                                                                                                                                              wasValid = false;
                                                                                                                                                                                                              this.blockDecorationsToMeasure.delete(decoration);
                                                                                                                                                                                                              this.heightsByBlockDecoration.delete(decoration);
                                                                                                                                                                                                              this.blockDecorationsByElement.delete(element);
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2888..2905

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                              if (wasValid && !isValid) {
                                                                                                                                                                                                                wasValid = false;
                                                                                                                                                                                                                this.blockDecorationsToMeasure.delete(decoration);
                                                                                                                                                                                                                this.heightsByBlockDecoration.delete(decoration);
                                                                                                                                                                                                                this.blockDecorationsByElement.delete(element);
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 3 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2913..2921

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 96.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getNextUpdatePromise() {
                                                                                                                                                                                                        if (!this.nextUpdatePromise) {
                                                                                                                                                                                                          this.nextUpdatePromise = new Promise(resolve => {
                                                                                                                                                                                                            this.resolveNextUpdatePromise = () => {
                                                                                                                                                                                                              this.nextUpdatePromise = null;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3368..3379

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 93.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getNextUpdatePromise() {
                                                                                                                                                                                                        if (!this.nextUpdatePromise) {
                                                                                                                                                                                                          this.nextUpdatePromise = new Promise(resolve => {
                                                                                                                                                                                                            this.resolveNextUpdatePromise = () => {
                                                                                                                                                                                                              this.nextUpdatePromise = null;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 5004..5015

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 93.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getHorizontalAutoscrollMargin() {
                                                                                                                                                                                                        const maxMarginInBaseCharacters = Math.floor(
                                                                                                                                                                                                          (this.getScrollContainerClientWidth() / this.getBaseCharacterWidth() -
                                                                                                                                                                                                            1) /
                                                                                                                                                                                                            2
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2380..2389

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 87.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getVerticalAutoscrollMargin() {
                                                                                                                                                                                                        const maxMarginInLines = Math.floor(
                                                                                                                                                                                                          (this.getScrollContainerClientHeight() / this.getLineHeight() - 1) / 2
                                                                                                                                                                                                        );
                                                                                                                                                                                                        const marginInLines = Math.min(
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2391..2402

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 87.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (this.props.marginTop !== marginTop) {
                                                                                                                                                                                                          if (marginTop != null && marginTop > 0) {
                                                                                                                                                                                                            this.element.style.marginTop = marginTop + 'px';
                                                                                                                                                                                                          } else {
                                                                                                                                                                                                            this.element.style.marginTop = '';
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3946..3952

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

                                                                                                                                                                                                    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 (this.props.width !== width) {
                                                                                                                                                                                                          if (width != null && width > 0) {
                                                                                                                                                                                                            this.element.style.width = width + 'px';
                                                                                                                                                                                                          } else {
                                                                                                                                                                                                            this.element.style.width = '';
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3953..3959

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                      measureClientContainerHeight() {
                                                                                                                                                                                                        const clientContainerHeight = this.refs.clientContainer.offsetHeight;
                                                                                                                                                                                                        if (clientContainerHeight !== this.measurements.clientContainerHeight) {
                                                                                                                                                                                                          this.measurements.clientContainerHeight = clientContainerHeight;
                                                                                                                                                                                                          return true;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2506..2514

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 71.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      measureClientContainerWidth() {
                                                                                                                                                                                                        const clientContainerWidth = this.refs.clientContainer.offsetWidth;
                                                                                                                                                                                                        if (clientContainerWidth !== this.measurements.clientContainerWidth) {
                                                                                                                                                                                                          this.measurements.clientContainerWidth = clientContainerWidth;
                                                                                                                                                                                                          return true;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2496..2504

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 71.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        } else {
                                                                                                                                                                                                          const { bufferRow, screenRow } = event.target.dataset;
                                                                                                                                                                                                          this.props.onMouseDown({
                                                                                                                                                                                                            bufferRow: parseInt(bufferRow, 10),
                                                                                                                                                                                                            screenRow: parseInt(screenRow, 10),
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3892..3899

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (this.props.onMouseMove != null) {
                                                                                                                                                                                                          const { bufferRow, screenRow } = event.target.dataset;
                                                                                                                                                                                                          this.props.onMouseMove({
                                                                                                                                                                                                            bufferRow: parseInt(bufferRow, 10),
                                                                                                                                                                                                            screenRow: parseInt(screenRow, 10),
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3881..3888

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 70.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getFirstVisibleRow() {
                                                                                                                                                                                                        if (this.derivedDimensionsCache.firstVisibleRow == null) {
                                                                                                                                                                                                          this.derivedDimensionsCache.firstVisibleRow = this.rowForPixelPosition(
                                                                                                                                                                                                            this.getScrollTop()
                                                                                                                                                                                                          );
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3106..3114

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 68.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      getRenderedStartRow() {
                                                                                                                                                                                                        if (this.derivedDimensionsCache.renderedStartRow == null) {
                                                                                                                                                                                                          this.derivedDimensionsCache.renderedStartRow = this.tileStartRowForRow(
                                                                                                                                                                                                            this.getFirstVisibleRow()
                                                                                                                                                                                                          );
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3149..3157

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 68.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        const {
                                                                                                                                                                                                          lineHeight,
                                                                                                                                                                                                          hiddenInputPosition,
                                                                                                                                                                                                          didBlurHiddenInput,
                                                                                                                                                                                                          didFocusHiddenInput,
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/main-process/atom-application.js on lines 1266..1280

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 67.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                                var newScreenLineComponent = new LineComponent({
                                                                                                                                                                                                                  screenLine: newScreenLines[newScreenLineIndex],
                                                                                                                                                                                                                  screenRow: tileStartRow + newScreenLineIndex,
                                                                                                                                                                                                                  lineDecoration: lineDecorations[newScreenLineIndex],
                                                                                                                                                                                                                  textDecorations: textDecorations[newScreenLineIndex],
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 4396..4404

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 65.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                              var newScreenLineComponent = new LineComponent({
                                                                                                                                                                                                                screenLine: newScreenLines[newScreenLineIndex],
                                                                                                                                                                                                                screenRow: tileStartRow + newScreenLineIndex,
                                                                                                                                                                                                                lineDecoration: lineDecorations[newScreenLineIndex],
                                                                                                                                                                                                                textDecorations: textDecorations[newScreenLineIndex],
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 4356..4364

                                                                                                                                                                                                    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

                                                                                                                                                                                                            if (nextBoundary.ending) {
                                                                                                                                                                                                              if (boundary.ending) {
                                                                                                                                                                                                                boundary.ending.push(...nextBoundary.ending);
                                                                                                                                                                                                              } else {
                                                                                                                                                                                                                boundary.ending = nextBoundary.ending;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 1359..1365

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

                                                                                                                                                                                                    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 (nextBoundary.starting) {
                                                                                                                                                                                                              if (boundary.starting) {
                                                                                                                                                                                                                boundary.starting.push(...nextBoundary.starting);
                                                                                                                                                                                                              } else {
                                                                                                                                                                                                                boundary.starting = nextBoundary.starting;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 1367..1373

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

                                                                                                                                                                                                    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 (clientY < top) {
                                                                                                                                                                                                          yDelta = top - clientY;
                                                                                                                                                                                                          yDirection = -1;
                                                                                                                                                                                                        } else if (clientY > bottom) {
                                                                                                                                                                                                          yDelta = clientY - bottom;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2193..2199

                                                                                                                                                                                                    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

                                                                                                                                                                                                        if (clientX < left) {
                                                                                                                                                                                                          xDelta = left - clientX;
                                                                                                                                                                                                          xDirection = -1;
                                                                                                                                                                                                        } else if (clientX > right) {
                                                                                                                                                                                                          xDelta = clientX - right;
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2184..2190

                                                                                                                                                                                                    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

                                                                                                                                                                                                            $(DummyScrollbarComponent, {
                                                                                                                                                                                                              ref: 'verticalScrollbar',
                                                                                                                                                                                                              orientation: 'vertical',
                                                                                                                                                                                                              didScroll: this.didScrollDummyScrollbar,
                                                                                                                                                                                                              didMouseDown: this.didMouseDownOnContent,
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 822..832

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 60.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                            $(DummyScrollbarComponent, {
                                                                                                                                                                                                              ref: 'horizontalScrollbar',
                                                                                                                                                                                                              orientation: 'horizontal',
                                                                                                                                                                                                              didScroll: this.didScrollDummyScrollbar,
                                                                                                                                                                                                              didMouseDown: this.didMouseDownOnContent,
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 811..821

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 60.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                          if (boundary.starting && boundary.starting.length > 1) {
                                                                                                                                                                                                            boundary.starting.sort((a, b) => a.compare(b));
                                                                                                                                                                                                          }
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 1395..1397

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

                                                                                                                                                                                                    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 (boundary.ending && boundary.ending.length > 1) {
                                                                                                                                                                                                            boundary.ending.sort((a, b) => b.compare(a));
                                                                                                                                                                                                          }
                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 1390..1392

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

                                                                                                                                                                                                    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

                                                                                                                                                                                                          on: {
                                                                                                                                                                                                            blur: didBlurHiddenInput,
                                                                                                                                                                                                            focus: didFocusHiddenInput,
                                                                                                                                                                                                            paste: didPaste,
                                                                                                                                                                                                            textInput: didTextInput,
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                                    src/main-process/atom-application.js on lines 1228..1239

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 51.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                      static didUpdateStyles() {
                                                                                                                                                                                                        if (this.attachedComponents) {
                                                                                                                                                                                                          this.attachedComponents.forEach(component => {
                                                                                                                                                                                                            component.didUpdateStyles();
                                                                                                                                                                                                          });
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 46..52

                                                                                                                                                                                                    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

                                                                                                                                                                                                      static didUpdateScrollbarStyles() {
                                                                                                                                                                                                        if (this.attachedComponents) {
                                                                                                                                                                                                          this.attachedComponents.forEach(component => {
                                                                                                                                                                                                            component.didUpdateScrollbarStyles();
                                                                                                                                                                                                          });
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 38..44

                                                                                                                                                                                                    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

                                                                                                                                                                                                        if (range.end.row >= endRow) {
                                                                                                                                                                                                          range.end.row = endRow;
                                                                                                                                                                                                          range.end.column = 0;
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 5092..5095

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 49.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (range.start.row < startRow) {
                                                                                                                                                                                                          range.start.row = startRow;
                                                                                                                                                                                                          range.start.column = 0;
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 5096..5099

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 49.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        const {
                                                                                                                                                                                                          tileStartRow,
                                                                                                                                                                                                          screenLines,
                                                                                                                                                                                                          lineDecorations,
                                                                                                                                                                                                          textDecorations,
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 4884..4892

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (this.props.pixelTop != null)
                                                                                                                                                                                                          this.element.style.top = this.props.pixelTop + 'px';
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 5022..5023

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        const {
                                                                                                                                                                                                          className,
                                                                                                                                                                                                          screenRange,
                                                                                                                                                                                                          lineHeight,
                                                                                                                                                                                                          startPixelTop,
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 4259..4267

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (this.props.pixelLeft != null)
                                                                                                                                                                                                          this.element.style.left = this.props.pixelLeft + 'px';
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 5020..5021

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 47.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (this.pendingScrollLeftColumn > 0) {
                                                                                                                                                                                                          changedScrollLeft = this.setScrollLeftColumn(
                                                                                                                                                                                                            this.pendingScrollLeftColumn,
                                                                                                                                                                                                            false
                                                                                                                                                                                                          );
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2281..2284

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

                                                                                                                                                                                                        if (this.pendingScrollTopRow > 0) {
                                                                                                                                                                                                          changedScrollTop = this.setScrollTopRow(this.pendingScrollTopRow, false);
                                                                                                                                                                                                          this.pendingScrollTopRow = null;
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2287..2293

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

                                                                                                                                                                                                      getMaxScrollTop() {
                                                                                                                                                                                                        return Math.round(
                                                                                                                                                                                                          Math.max(
                                                                                                                                                                                                            0,
                                                                                                                                                                                                            this.getScrollHeight() - this.getScrollContainerClientHeight()
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.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 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 2 locations. Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      getMaxScrollLeft() {
                                                                                                                                                                                                        return Math.round(
                                                                                                                                                                                                          Math.max(0, this.getScrollWidth() - this.getScrollContainerClientWidth())
                                                                                                                                                                                                        );
                                                                                                                                                                                                      }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3213..3220

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

                                                                                                                                                                                                      update(props) {
                                                                                                                                                                                                        if (this.shouldUpdate(props)) {
                                                                                                                                                                                                          this.props = props;
                                                                                                                                                                                                          etch.updateSync(this);
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3661..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 2 locations. Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      update(newProps) {
                                                                                                                                                                                                        if (this.shouldUpdate(newProps)) {
                                                                                                                                                                                                          this.props = newProps;
                                                                                                                                                                                                          etch.updateSync(this);
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 3512..3517

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

                                                                                                                                                                                                        if (yDelta != null) {
                                                                                                                                                                                                          const scaledDelta = scaleMouseDragAutoscrollDelta(yDelta) * yDirection;
                                                                                                                                                                                                          scrolled = this.setScrollTop(this.getScrollTop() + scaledDelta);
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2207..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 45.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

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

                                                                                                                                                                                                        if (!verticalOnly && xDelta != null) {
                                                                                                                                                                                                          const scaledDelta = scaleMouseDragAutoscrollDelta(xDelta) * xDirection;
                                                                                                                                                                                                          scrolled = this.setScrollLeft(this.getScrollLeft() + scaledDelta);
                                                                                                                                                                                                        }
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in src/text-editor-component.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                    src/text-editor-component.js on lines 2202..2205

                                                                                                                                                                                                    Duplicated Code

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

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

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

                                                                                                                                                                                                    Tuning

                                                                                                                                                                                                    This issue has a mass of 45.

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

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

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

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

                                                                                                                                                                                                    Refactorings

                                                                                                                                                                                                    Further Reading

                                                                                                                                                                                                    There are no issues that match your filters.

                                                                                                                                                                                                    Category
                                                                                                                                                                                                    Status