trufflesuite/truffle

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

Summary

Maintainability
C
1 day
Test Coverage

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

function* yulWalk(
  sourceId,
  sourceIndex,
  node,
  pointer,
Severity: Minor
Found in packages/debugger/lib/ast/sagas/index.js - About 1 hr to fix

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

    function findYulScopePointer(node, pointer, base, basePointer) {
      //walk upward until we find a YulBlock or YulFunctionDefinition,
      //with a special case for YulForLoop
      debug("pointer: %s", pointer);
      debug("basePointer: %s", basePointer);
    Severity: Minor
    Found in packages/debugger/lib/ast/sagas/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 walk has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function* walk(sourceId, sourceIndex, node, pointer = "", parentId = null) {
      debug("walking %s %o %o", sourceId, pointer, node);
    
      yield* handleEnter(sourceId, sourceIndex, node, pointer, parentId);
    
    
    Severity: Minor
    Found in packages/debugger/lib/ast/sagas/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 handleEnter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function* handleEnter(sourceId, sourceIndex, node, pointer, parentId) {
      debug("entering %s %s", sourceId, pointer);
    
      if (!(node instanceof Object)) {
        return;
    Severity: Minor
    Found in packages/debugger/lib/ast/sagas/index.js - About 1 hr to fix

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

        sourceId,
        sourceIndex,
        node,
        pointer,
        base,
      Severity: Major
      Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

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

          sourceId,
          sourceIndex,
          node,
          pointer,
          base,
        Severity: Major
        Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

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

            sourceId,
            sourceIndex,
            node,
            pointer,
            base,
          Severity: Major
          Found in packages/debugger/lib/ast/sagas/index.js - About 50 mins to fix

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

            function* yulWalk(
              sourceId,
              sourceIndex,
              node,
              pointer,
            Severity: Minor
            Found in packages/debugger/lib/ast/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 walk has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function* walk(sourceId, sourceIndex, node, pointer = "", parentId = null) {
            Severity: Minor
            Found in packages/debugger/lib/ast/sagas/index.js - About 35 mins to fix

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

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

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

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

                  Avoid too many return statements within this function.
                  Open

                      return findYulScopePointer(parent, parentPointer, base, basePointer);
                  Severity: Major
                  Found in packages/debugger/lib/ast/sagas/index.js - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status