trufflesuite/truffle

View on GitHub
packages/debugger/lib/data/sagas/index.js

Summary

Maintainability
F
1 wk
Test Coverage

File index.js has 1029 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import debugModule from "debug";
const debug = debugModule("debugger:data:sagas");

import { put, takeEvery, select } from "redux-saga/effects";

Severity: Major
Found in packages/debugger/lib/data/sagas/index.js - About 2 days to fix

    Function variablesAndMappingsSaga has 487 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function* variablesAndMappingsSaga() {
      // stack is only ready for interpretation after the last step of each
      // source range
      //
      // the data module always looks at the result of a particular opcode
    Severity: Major
    Found in packages/debugger/lib/data/sagas/index.js - About 2 days to fix

      Function variablesAndMappingsSaga has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring.
      Open

      function* variablesAndMappingsSaga() {
        // stack is only ready for interpretation after the last step of each
        // source range
        //
        // the data module always looks at the result of a particular opcode
      Severity: Minor
      Found in packages/debugger/lib/data/sagas/index.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 decodeMappingKeyCore has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

      function* decodeMappingKeyCore(indexDefinition, keyDefinition) {
        const scopes = yield select(data.current.scopes.inlined);
        const compilationId = yield select(data.current.compilationId);
        const internalFor = yield select(data.current.internalSourceFor); //should be null, but...
        const currentAssignments = yield select(data.proc.assignments);
      Severity: Minor
      Found in packages/debugger/lib/data/sagas/index.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 decodeMappingKeyCore has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function* decodeMappingKeyCore(indexDefinition, keyDefinition) {
        const scopes = yield select(data.current.scopes.inlined);
        const compilationId = yield select(data.current.compilationId);
        const internalFor = yield select(data.current.internalSourceFor); //should be null, but...
        const currentAssignments = yield select(data.proc.assignments);
      Severity: Major
      Found in packages/debugger/lib/data/sagas/index.js - About 3 hrs to fix

        Function decodeCall has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function* decodeCall(decodeCurrent = false) {
          const isCall = yield select(data.current.isCall);
          const isCreate = yield select(data.current.isCreate);
          if (!isCall && !isCreate && !decodeCurrent) {
            return null;
        Severity: Major
        Found in packages/debugger/lib/data/sagas/index.js - About 2 hrs to fix

          Function decode has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function* decode(definition, ref, compilationId) {
            const userDefinedTypes = yield select(data.views.userDefinedTypes);
            const state = yield select(data.current.state);
            const mappingKeys = yield select(data.views.mappingKeys);
            const allocations = yield select(data.info.allocations);
          Severity: Major
          Found in packages/debugger/lib/data/sagas/index.js - About 2 hrs to fix

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

            export function* decodeReturnValue() {
              const userDefinedTypes = yield select(data.views.userDefinedTypes);
              const state = yield select(data.next.state); //next state has the return data
              const allocations = yield select(data.info.allocations);
              const contexts = yield select(data.views.contexts);
            Severity: Minor
            Found in packages/debugger/lib/data/sagas/index.js - About 2 hrs to fix

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

              export function* recordAllocations() {
                const contracts = yield select(data.views.contractAllocationInfo);
                const referenceDeclarations = yield select(data.views.referenceDeclarations);
                const userDefinedTypesByCompilation = yield select(
                  data.views.userDefinedTypesByCompilation
              Severity: Minor
              Found in packages/debugger/lib/data/sagas/index.js - About 1 hr to fix

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

                export function* decodeLog() {
                  const userDefinedTypes = yield select(data.views.userDefinedTypes);
                  const state = yield select(data.current.state); //note: this includes the data to be decoded!
                  const allocations = yield select(data.info.allocations);
                  const contexts = yield select(data.views.contexts);
                Severity: Minor
                Found in packages/debugger/lib/data/sagas/index.js - About 1 hr to fix

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

                  function literalAssignments(
                    compilationId,
                    internalFor,
                    node,
                    stack,
                  Severity: Minor
                  Found in packages/debugger/lib/data/sagas/index.js - About 1 hr to fix

                    Function fetchBasePath has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      compilationId,
                      internalFor,
                      baseNode,
                      currentAssignments,
                      allocations,
                    Severity: Major
                    Found in packages/debugger/lib/data/sagas/index.js - About 1 hr to fix

                      Function assignParameters has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        compilationId,
                        internalFor,
                        parameters,
                        top,
                        functionDepth,
                      Severity: Major
                      Found in packages/debugger/lib/data/sagas/index.js - About 50 mins to fix

                        Function literalAssignments has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          compilationId,
                          internalFor,
                          node,
                          stack,
                          currentDepth,
                        Severity: Major
                        Found in packages/debugger/lib/data/sagas/index.js - About 50 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  if (Codec.Ast.Utils.isSimpleConstant(indexConstantDefinition)) {
                                    debug("about to decode simple constant");
                                    return yield* decode(
                                      keyDefinition,
                                      {
                          Severity: Major
                          Found in packages/debugger/lib/data/sagas/index.js - About 45 mins to fix

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

                            export function* decodeCall(decodeCurrent = false) {
                              const isCall = yield select(data.current.isCall);
                              const isCreate = yield select(data.current.isCreate);
                              if (!isCall && !isCreate && !decodeCurrent) {
                                return null;
                            Severity: Minor
                            Found in packages/debugger/lib/data/sagas/index.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 scope has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            export function* scope(nodeId, pointer, parentId, sourceIndex, sourceId) {
                            Severity: Minor
                            Found in packages/debugger/lib/data/sagas/index.js - About 35 mins to fix

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

                                node,
                                pointer,
                                scopePointer,
                                sourceIndex,
                                sourceId
                              Severity: Minor
                              Found in packages/debugger/lib/data/sagas/index.js - About 35 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return null;
                                Severity: Major
                                Found in packages/debugger/lib/data/sagas/index.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return null; //can't decode; see below for more explanation
                                  Severity: Major
                                  Found in packages/debugger/lib/data/sagas/index.js - About 30 mins to fix

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

                                      while (!result.done) {
                                        debug("request received");
                                        let request = result.value;
                                        let response;
                                        switch (request.type) {
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 4 hrs to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 1187..1203
                                    packages/debugger/lib/data/sagas/index.js on lines 1241..1257

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

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

                                      while (!result.done) {
                                        debug("request received");
                                        let request = result.value;
                                        let response;
                                        switch (request.type) {
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 4 hrs to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 1120..1136
                                    packages/debugger/lib/data/sagas/index.js on lines 1241..1257

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

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

                                      while (!result.done) {
                                        debug("request received");
                                        let request = result.value;
                                        let response;
                                        switch (request.type) {
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 4 hrs to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 1120..1136
                                    packages/debugger/lib/data/sagas/index.js on lines 1187..1203

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

                                    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

                                            (Codec.Ast.Utils.typeClass(baseExpression) === "array" &&
                                              (Codec.Ast.Utils.isReference(node)
                                                ? Codec.Ast.Utils.referenceType(baseExpression) !== "storage"
                                                : !Codec.Ast.Utils.isMapping(node)))
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 2 hrs to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 661..664

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

                                    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

                                            Codec.Ast.Utils.typeClass(baseExpression) !== "struct" ||
                                            (Codec.Ast.Utils.isReference(node)
                                              ? Codec.Ast.Utils.referenceType(baseExpression) !== "storage"
                                              : !Codec.Ast.Utils.isMapping(node))
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 2 hrs to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 525..528

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

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                            const assignment = makeAssignment(
                                              {
                                                compilationId,
                                                internalFor,
                                                astRef: sourceAndPointer,
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 1 hr to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 446..459
                                    packages/debugger/lib/data/sagas/index.js on lines 474..487

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

                                          const assignment = makeAssignment(
                                            {
                                              compilationId,
                                              internalFor,
                                              astRef: sourceAndPointer,
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 1 hr to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 284..297
                                    packages/debugger/lib/data/sagas/index.js on lines 446..459

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

                                            const assignment = makeAssignment(
                                              {
                                                compilationId,
                                                internalFor,
                                                astRef: variableSourceAndPointer,
                                    Severity: Major
                                    Found in packages/debugger/lib/data/sagas/index.js and 2 other locations - About 1 hr to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 284..297
                                    packages/debugger/lib/data/sagas/index.js on lines 474..487

                                    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

                                          const fallbackDefinition = node.nodes.find(
                                            subNode =>
                                              subNode.nodeType === "FunctionDefinition" &&
                                              Codec.Ast.Utils.functionKind(subNode) === "fallback"
                                          );
                                    Severity: Minor
                                    Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 55 mins to fix
                                    packages/debugger/lib/data/selectors/index.js on lines 1002..1006

                                    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

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

                                            yield put(
                                              actions.mapPathAndAssign(
                                                address,
                                                slot,
                                                assignments,
                                    Severity: Minor
                                    Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 50 mins to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 712..720

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

                                    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

                                          yield put(
                                            actions.mapPathAndAssign(
                                              address,
                                              slot,
                                              assignments,
                                    Severity: Minor
                                    Found in packages/debugger/lib/data/sagas/index.js and 1 other location - About 50 mins to fix
                                    packages/debugger/lib/data/sagas/index.js on lines 617..625

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

                                    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