enclose-io/compiler

View on GitHub
lts/lib/internal/repl/utils.js

Summary

Maintainability
F
3 wks
Test Coverage

Function setupReverseSearch has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
Open

function setupReverseSearch(repl) {
  // Simple terminals can't use reverse search.
  if (process.env.TERM === 'dumb') {
    return { reverseSearch() { return false; } };
  }
Severity: Minor
Found in lts/lib/internal/repl/utils.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 setupPreview has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

function setupPreview(repl, contextSymbol, bufferSymbol, active) {
  // Simple terminals can't handle previews.
  if (process.env.TERM === 'dumb' || !active) {
    return { showPreview() {}, clearPreview() {} };
  }
Severity: Minor
Found in lts/lib/internal/repl/utils.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 setupPreview has 227 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function setupPreview(repl, contextSymbol, bufferSymbol, active) {
  // Simple terminals can't handle previews.
  if (process.env.TERM === 'dumb' || !active) {
    return { showPreview() {}, clearPreview() {} };
  }
Severity: Major
Found in lts/lib/internal/repl/utils.js - About 1 day to fix

    File utils.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    const {
      MathMin,
      Set,
    Severity: Minor
    Found in lts/lib/internal/repl/utils.js - About 7 hrs to fix

      Function setupReverseSearch has 165 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function setupReverseSearch(repl) {
        // Simple terminals can't use reverse search.
        if (process.env.TERM === 'dumb') {
          return { reverseSearch() { return false; } };
        }
      Severity: Major
      Found in lts/lib/internal/repl/utils.js - About 6 hrs to fix

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

          const showPreview = () => {
            // Prevent duplicated previews after a refresh.
            if (inputPreview !== null || !repl.isCompletionEnabled) {
              return;
            }
        Severity: Major
        Found in lts/lib/internal/repl/utils.js - About 2 hrs to fix

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

            function getInputPreview(input, callback) {
              // For similar reasons as `defaultEval`, wrap expressions starting with a
              // curly brace with parenthesis.
              if (input.startsWith('{') && !input.endsWith(';') && !wrapped) {
                input = `(${input})`;
          Severity: Minor
          Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

            Function search has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function search() {
                // Just print an empty line in case the user removed the search parameter.
                if (input === '') {
                  print(repl.line, `${labels[dir]}_`);
                  return;
            Severity: Minor
            Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

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

              function isRecoverableError(e, code) {
                // For similar reasons as `defaultEval`, wrap expressions starting with a
                // curly brace with parenthesis.  Note: only the open parenthesis is added
                // here as the point is to test for potentially valid but incomplete
                // expressions.
              Severity: Minor
              Found in lts/lib/internal/repl/utils.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 inputPreviewCallback has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  const inputPreviewCallback = (error, inspected) => {
                    if (inspected === null) {
                      return;
                    }
              
              
              Severity: Minor
              Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

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

                  function showCompletionPreview(line, insertPreview) {
                    previewCompletionCounter++;
                
                    const count = previewCompletionCounter;
                
                
                Severity: Minor
                Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

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

                  function isRecoverableError(e, code) {
                    // For similar reasons as `defaultEval`, wrap expressions starting with a
                    // curly brace with parenthesis.  Note: only the open parenthesis is added
                    // here as the point is to test for potentially valid but incomplete
                    // expressions.
                  Severity: Minor
                  Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

                    Function clearPreview has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const clearPreview = () => {
                        if (inputPreview !== null) {
                          const { displayPos, cursorPos } = getPreviewPos();
                          const rows = displayPos.rows - cursorPos.rows + 1;
                          moveCursor(repl.output, 0, rows);
                    Severity: Minor
                    Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

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

                        function reverseSearch(string, key) {
                          if (!isInReverseSearch) {
                            if (key.ctrl && checkAndSetDirectionKey(key.name)) {
                              historyIndex = repl.historyIndex;
                              promptPos = repl._getDisplayPos(`${repl._prompt}`);
                      Severity: Minor
                      Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

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

                          function print(outputLine, inputLine, cursor = repl.cursor) {
                            // TODO(BridgeAR): Resizing the terminal window hides the overlay. To fix
                            // that, readline must be aware of this information. It's probably best to
                            // add a couple of properties to readline that allow to do the following:
                            // 1. Add arbitrary data to the end of the current line while not counting
                        Severity: Minor
                        Found in lts/lib/internal/repl/utils.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              } else if (key.ctrl ||
                                         key.meta ||
                                         key.name === 'return' ||
                                         key.name === 'enter' ||
                                         typeof string !== 'string' ||
                          Severity: Major
                          Found in lts/lib/internal/repl/utils.js - About 40 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return;
                            Severity: Major
                            Found in lts/lib/internal/repl/utils.js - About 30 mins to fix

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

                              function setupReverseSearch(repl) {
                                // Simple terminals can't use reverse search.
                                if (process.env.TERM === 'dumb') {
                                  return { reverseSearch() { return false; } };
                                }
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 1 wk to fix
                              current/lib/internal/repl/utils.js on lines 492..722

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

                              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 inputPreviewCallback = (error, inspected) => {
                                    if (inspected === null) {
                                      return;
                                    }
                              
                              
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 2 days to fix
                              current/lib/internal/repl/utils.js on lines 370..433

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                              function isRecoverableError(e, code) {
                                // For similar reasons as `defaultEval`, wrap expressions starting with a
                                // curly brace with parenthesis.  Note: only the open parenthesis is added
                                // here as the point is to test for potentially valid but incomplete
                                // expressions.
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 1 day to fix
                              current/lib/internal/repl/utils.js on lines 59..129

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

                              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

                                      } else if (preview.exceptionDetails &&
                                                 (result.className === 'EvalError' ||
                                                   result.className === 'SyntaxError' ||
                                                   result.className === 'ReferenceError')) {
                                        callback(null, null);
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 6 hrs to fix
                              current/lib/internal/repl/utils.js on lines 307..341

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

                              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 (inputPreview !== null) {
                                    const { displayPos, cursorPos } = getPreviewPos();
                                    const rows = displayPos.rows - cursorPos.rows + 1;
                                    moveCursor(repl.output, 0, rows);
                                    clearLine(repl.output);
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 3 hrs to fix
                              current/lib/internal/repl/utils.js on lines 164..172

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

                              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

                                repl._moveCursor = (dx) => {
                                  const currentCursor = repl.cursor;
                                  originalMoveCursor(dx);
                                  if (currentCursor + dx > repl.line.length &&
                                      typeof repl.completer === 'function' &&
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 3 hrs to fix
                              current/lib/internal/repl/utils.js on lines 469..478

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 98.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                function getPreviewPos() {
                                  const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`);
                                  const cursorPos = repl.line.length !== repl.cursor ?
                                    repl.getCursorPos() :
                                    displayPos;
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 2 hrs to fix
                              current/lib/internal/repl/utils.js on lines 149..155

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 94.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                    if (move) {
                                      pos = getPreviewPos();
                                      cursorTo(repl.output, pos.displayPos.cols);
                                      rows = pos.displayPos.rows - pos.cursorPos.rows;
                                      moveCursor(repl.output, 0, rows);
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 2 hrs to fix
                              current/lib/internal/repl/utils.js on lines 177..182

                              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 (newPos.rows === 0 || (pos && pos.displayPos.rows === newPos.rows)) {
                                      clearLine(repl.output, 1);
                                    } else {
                                      clearScreenDown(repl.output);
                                    }
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 1 hr to fix
                              current/lib/internal/repl/utils.js on lines 187..191

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

                              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 (repl.line.length !== repl.cursor) {
                                      cursorTo(repl.output, displayPos.cols);
                                      moveCursor(repl.output, 0, displayPos.rows - cursorPos.rows);
                                    }
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 1 hr to fix
                              current/lib/internal/repl/utils.js on lines 263..266

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

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

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

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

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

                              Refactorings

                              Further Reading

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

                                  if (input.startsWith('{') && !input.endsWith(';') && !wrapped) {
                                    input = `(${input})`;
                                    wrapped = true;
                                  }
                              Severity: Major
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 1 hr to fix
                              current/lib/internal/repl/utils.js on lines 286..289

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 61.

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

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

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

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

                              Refactorings

                              Further Reading

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

                                if (process.env.TERM === 'dumb' || !active) {
                                  return { showPreview() {}, clearPreview() {} };
                                }
                              Severity: Minor
                              Found in lts/lib/internal/repl/utils.js and 1 other location - About 35 mins to fix
                              current/lib/internal/repl/utils.js on lines 133..135

                              Duplicated Code

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

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

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

                              Tuning

                              This issue has a mass of 47.

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

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

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

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

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status