OpenC3/cosmos

View on GitHub
openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js

Summary

Maintainability
F
6 days
Test Coverage

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

export default function AceDiff(options = {}) {
  // Ensure instance is a constructor with `new`
  if (!(this instanceof AceDiff)) {
    return new AceDiff(options)
  }

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

    function computeDiff(acediff, diffType, offsetLeft, offsetRight, diffText) {
      let lineInfo = {}
    
      if (diffType === C.DIFF_INSERT) {
        // pretty confident this returns the right stuff for the left editor: start & end line & char

      Function simplifyDiffs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function simplifyDiffs(acediff, diffs) {
        const groupedDiffs = []
      
        function compare(val) {
          return acediff.options.diffGranularity === C.DIFF_GRANULARITY_SPECIFIC

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

        function addEventHandlers(acediff) {
          acediff.editors.left.ace.getSession().on(
            'changeScrollTop',
            throttle(() => {
              updateGap(acediff)

          Function copy has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function copy(acediff, e, dir) {
            const diffIndex = parseInt(e.target.getAttribute('data-diff-index'), 10)
            const diff = acediff.diffs[diffIndex]
            let sourceEditor
            let targetEditor

            Function diff has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              diff() {
                const dmp = new diff_match_patch()
                const val1 = this.editors.left.ace.getSession().getValue()
                const val2 = this.editors.right.ace.getSession().getValue()
                // Main diff method that calculates the diffs

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

              function getSingleDiffInfo(editor, offset, diffString) {
                const info = {
                  startLine: 0,
                  startChar: 0,
                  endLine: 0,

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

                function decorate(acediff) {
                  clearGutter(acediff)
                  clearArrows(acediff)
                
                  acediff.diffs.forEach((info, diffIndex) => {

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

                  function addConnector(
                    acediff,
                    leftStartLine,
                    leftEndLine,
                    rightStartLine,

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

                    function addCopyArrows(acediff, info, diffIndex) {
                      if (
                        info.leftEndLine > info.leftStartLine &&
                        acediff.options.left.copyLinkEnabled
                      ) {

                      Function addConnector has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        acediff,
                        leftStartLine,
                        leftEndLine,
                        rightStartLine,
                        rightEndLine,
                      Severity: Minor
                      Found in openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js - About 35 mins to fix

                        Function showDiff has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function showDiff(acediff, editor, startLine, endLine, className) {
                        Severity: Minor
                        Found in openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js - About 35 mins to fix

                          Function computeDiff has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function computeDiff(acediff, diffType, offsetLeft, offsetRight, diffText) {
                          Severity: Minor
                          Found in openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js - About 35 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return new Error(errMessage)
                            Severity: Major
                            Found in openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js - About 30 mins to fix

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

                                if (
                                  info.rightEndLine > info.rightStartLine &&
                                  acediff.options.right.copyLinkEnabled
                                ) {
                                  const arrow = createArrow({
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 503..515

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 123.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                if (
                                  info.leftEndLine > info.leftStartLine &&
                                  acediff.options.left.copyLinkEnabled
                                ) {
                                  const arrow = createArrow({
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 517..529

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 123.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                if (acediff.options.left.copyLinkEnabled) {
                                  query(
                                    `#${acediff.options.classes.gutterID}`,
                                    'click',
                                    `.${acediff.options.classes.newCodeConnectorLink}`,
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 322..331

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 90.

                              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 (acediff.options.right.copyLinkEnabled) {
                                  query(
                                    `#${acediff.options.classes.gutterID}`,
                                    'click',
                                    `.${acediff.options.classes.deletedCodeConnectorLink}`,
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 312..321

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

                              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 {
                                  sourceEditor = acediff.editors.right
                                  targetEditor = acediff.editors.left
                                  startLine = diff.rightStartLine
                                  endLine = diff.rightEndLine
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 358..365

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 77.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                if (dir === C.LTR) {
                                  sourceEditor = acediff.editors.left
                                  targetEditor = acediff.editors.right
                                  startLine = diff.leftStartLine
                                  endLine = diff.leftEndLine
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 365..372

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 77.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (
                                    // dense, but this accommodates two scenarios:
                                    // 1. where a completely fresh new line is being inserted in left editor, we want the line on right to stay a 1px line
                                    // 2. where a new character is inserted at the start of a newline on the left but the line contains other stuff,
                                    //    we DO want to make it a full line
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 627..640

                              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 (
                                    // dense, but this accommodates two scenarios:
                                    // 1. where a completely fresh new line is being inserted in left editor, we want the line on right to stay a 1px line
                                    // 2. where a new character is inserted at the start of a newline on the left but the line contains other stuff,
                                    //    we DO want to make it a full line
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 587..600

                              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

                                acediff.editors.right.markers.forEach((marker) => {
                                  acediff.editors.right.ace.getSession().removeMarker(marker)
                                }, acediff)
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 447..449

                              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

                                acediff.editors.left.markers.forEach((marker) => {
                                  acediff.editors.left.ace.getSession().removeMarker(marker)
                                }, acediff)
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 450..452

                              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 (!endLineSet && endCharNum <= runningTotal) {
                                    info.endLine = lineIndex
                                    info.endChar = endCharNum - runningTotal + lineLength
                                    endLineSet = true
                                  }
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 670..674

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (!startLineSet && offset < runningTotal) {
                                    info.startLine = lineIndex
                                    info.startChar = offset - runningTotal + lineLength
                                    startLineSet = true
                                  }
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 676..680

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 54.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                    } else if (chunkType === C.DIFF_INSERT) {
                                      diffs.push(
                                        computeDiff(this, C.DIFF_INSERT, offset.left, offset.right, text),
                                      )
                                      offset.left += text.length
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 246..256

                              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

                                    } else if (chunkType === C.DIFF_DELETE) {
                                      diffs.push(
                                        computeDiff(this, C.DIFF_DELETE, offset.left, offset.right, text),
                                      )
                                      offset.right += text.length
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 251..256

                              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

                                acediff.editors.left.ace.getSession().on(
                                  'changeScrollTop',
                                  throttle(() => {
                                    updateGap(acediff)
                                  }, 16),
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 301..306

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 48.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                acediff.editors.right.ace.getSession().on(
                                  'changeScrollTop',
                                  throttle(() => {
                                    updateGap(acediff)
                                  }, 16),
                              openc3-cosmos-init/plugins/packages/openc3-cosmos-ace-diff/src/index.js on lines 295..300

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 48.

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

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

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

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

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status