trufflesuite/truffle

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

Summary

Maintainability
F
1 wk
Test Coverage

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

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

import { createSelectorTree, createLeaf } from "reselect-tree";
import jsonpointer from "json-pointer";
Severity: Major
Found in packages/debugger/lib/data/selectors/index.js - About 3 days to fix

    data has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

      current: {
        /**
         * data.current.state
         */
        state: {
    Severity: Minor
    Found in packages/debugger/lib/data/selectors/index.js - About 4 hrs to fix

      Function refs has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

              (
                assignments,
                identifiers,
                definitions,
                scopes,
      Severity: Minor
      Found in packages/debugger/lib/data/selectors/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 _ has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

              (scopes, scope, pointer, sourceId, language) => {
                let variables = {};
                if (scope !== undefined) {
                  let cur =
                    scope.id !== undefined ? scope.id : makePath(sourceId, pointer);
      Severity: Minor
      Found in packages/debugger/lib/data/selectors/index.js - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

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

                    ...Object.entries(scopes).map(([id, scope]) => {
                      let definition = inlined[id].definition;
                      if (definition.nodeType === "ContractDefinition") {
                        //contract definition case: process inheritance
                        debug("contract id %d", id);
      Severity: Major
      Found in packages/debugger/lib/data/selectors/index.js - About 2 hrs to fix

        Function _ has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                (scopes, scope, pointer, sourceId, language) => {
                  let variables = {};
                  if (scope !== undefined) {
                    let cur =
                      scope.id !== undefined ? scope.id : makePath(sourceId, pointer);
        Severity: Minor
        Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                  if (
                    isContextChange ||
                    !node ||
                    node.id === undefined ||
                    !next ||
          Severity: Critical
          Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

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

                  (node, invocation, index, next, nextInvocation, isContextChange) => {
                    //ensure: current instruction is not a context change (because if it is
                    //we cannot rely on the data.next selectors, but also if it is we know
                    //we're not about to call a modifier or base constructor!)
                    //we also want to return false if we can't find things for whatever
            Severity: Minor
            Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

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

                      (definitions, refs, scopes) => {
                        let sections = {
                          builtin: [],
                          global: [],
                          contract: [],
              Severity: Minor
              Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

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

                        (definitions, refs, scopes) => {
                          let sections = {
                            builtin: [],
                            global: [],
                            contract: [],
                Severity: Minor
                Found in packages/debugger/lib/data/selectors/index.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 returnAllocation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                      (
                        { data: calldata },
                        { context, isConstructor, fallbackAbi },
                        { constructorAllocations, functionAllocations },
                        contractHasFallbackOutput //just using truthiness here
                Severity: Minor
                Found in packages/debugger/lib/data/selectors/index.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 state has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                        (allAllocations, compilationId, { isConstructor }) => {
                          debug("compilationId: %s", compilationId);
                          debug("allAllocations: %o", allAllocations);
                          const allocations = compilationId
                            ? allAllocations[compilationId]
                Severity: Minor
                Found in packages/debugger/lib/data/selectors/index.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 debuggerContextToDecoderContext has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function debuggerContextToDecoderContext(context) {
                  let {
                    context: contextHash,
                    contractName,
                    binary,
                Severity: Minor
                Found in packages/debugger/lib/data/selectors/index.js - About 1 hr to fix

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

                        (node, invocation, index, next, nextInvocation, isContextChange) => {
                          //ensure: current instruction is not a context change (because if it is
                          //we cannot rely on the data.next selectors, but also if it is we know
                          //we're not about to call a modifier or base constructor!)
                          //we also want to return false if we can't find things for whatever
                  Severity: Minor
                  Found in packages/debugger/lib/data/selectors/index.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 _ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                        _: createLeaf(["./raw", "./inlined/raw"], (scopes, inlined) =>
                          scopes && inlined
                            ? Object.assign(
                                {},
                                ...Object.entries(scopes).map(([id, scope]) => {
                  Severity: Minor
                  Found in packages/debugger/lib/data/selectors/index.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 findAncestorOfType has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function findAncestorOfType(node, types, scopes, pointer = null, root = null) {
                    //note: you may want to include "SourceUnit" and "YulObject" as fallback types when using
                    //this function for convenience.
                    //you only need to pass pointer and root if you want this function to work
                    //from Yul.  Otherwise you can omit those and you'll get null if you happen
                  Severity: Minor
                  Found in packages/debugger/lib/data/selectors/index.js - About 55 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                  function findAncestorOfType(node, types, scopes, pointer = null, root = null) {
                  Severity: Minor
                  Found in packages/debugger/lib/data/selectors/index.js - About 35 mins to fix

                    Avoid too many return statements within this function.
                    Open

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

                      Avoid too many return statements within this function.
                      Open

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

                        Avoid too many return statements within this function.
                        Open

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

                          Avoid too many return statements within this function.
                          Open

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

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

                                    switch (errorNode.nodeType) {
                                      case "RevertStatement":
                                        //I don't think this case should happen, but I'm including it
                                        //for extra certainty
                                        errorNode = errorNode.errorCall;
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 4 hrs to fix
                            packages/debugger/lib/data/selectors/index.js on lines 1251..1270

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

                            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

                                    switch (eventNode.nodeType) {
                                      case "EmitStatement":
                                        //I don't think this case should happen, but I'm including it
                                        //for extra certainty
                                        eventNode = eventNode.eventCall;
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 4 hrs to fix
                            packages/debugger/lib/data/selectors/index.js on lines 1217..1236

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

                            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

                                  raw: createLeaf(
                                    ["/views/scopes", sourcemapping.current.sourceIds],
                                    (scopes, sourceIds) =>
                                      sourceIds
                                        ? Object.assign({}, ...sourceIds.map(sourceId => scopes[sourceId]))
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 818..827

                            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

                                    raw: createLeaf(
                                      ["/views/scopes/inlined", sourcemapping.current.sourceIds],
                                      (scopes, sourceIds) =>
                                        sourceIds
                                          ? Object.assign(
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 780..786

                            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

                                  stack: createLeaf(
                                    [evm.current.state.stack],
                            
                                    words => (words || []).map(word => Codec.Conversion.toBytes(word))
                                  ),
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 1814..1818

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 59.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                  stack: createLeaf(
                                    [evm.next.state.stack],
                            
                                    words => (words || []).map(word => Codec.Conversion.toBytes(word))
                                  ),
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 544..548

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 59.

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

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

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

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

                            Refactorings

                            Further Reading

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

                                      ...Object.assign(
                                        {},
                                        ...Object.entries(tx).map(([variable, value]) => ({
                                          [variable]: Codec.Conversion.toBytes(value)
                                        }))
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 631..636

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

                            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

                                      ...Object.assign(
                                        {},
                                        ...Object.entries(block).map(([variable, value]) => ({
                                          [variable]: Codec.Conversion.toBytes(value)
                                        }))
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 1 hr to fix
                            packages/debugger/lib/data/selectors/index.js on lines 624..629

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

                            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

                                    [
                                      evm.current.step.isCall,
                                      evm.current.step.isCreate,
                                      evm.current.step.callData,
                                      evm.current.step.createBinary
                            Severity: Minor
                            Found in packages/debugger/lib/data/selectors/index.js and 1 other location - About 55 mins to fix
                            packages/debugger/lib/stacktrace/selectors/index.js on lines 319..324

                            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

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

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

                            export const MSG_DEFINITION = {
                              id: -1,
                              src: "0:0:-1",
                              name: "msg",
                              nodeType: "VariableDeclaration",
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 2 other locations - About 40 mins to fix
                            packages/debugger/lib/data/selectors/index.js on lines 153..162
                            packages/debugger/lib/data/selectors/index.js on lines 164..173

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 49.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            export const BLOCK_DEFINITION = {
                              id: -1,
                              src: "0:0:-1",
                              name: "block",
                              nodeType: "VariableDeclaration",
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 2 other locations - About 40 mins to fix
                            packages/debugger/lib/data/selectors/index.js on lines 142..151
                            packages/debugger/lib/data/selectors/index.js on lines 153..162

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 49.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            export const TX_DEFINITION = {
                              id: -1,
                              src: "0:0:-1",
                              name: "tx",
                              nodeType: "VariableDeclaration",
                            Severity: Major
                            Found in packages/debugger/lib/data/selectors/index.js and 2 other locations - About 40 mins to fix
                            packages/debugger/lib/data/selectors/index.js on lines 142..151
                            packages/debugger/lib/data/selectors/index.js on lines 164..173

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 49.

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

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

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

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

                            Refactorings

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status