tsg-ut/mnemo

View on GitHub

Showing 70 of 724 total issues

Avoid too many return statements within this function.
Open

                return `rotation of block ${index} is invalid`;
Severity: Major
Found in lib/validator.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return {pass: true, clocks: maxClock, blocks: board.weighedBlockCount};
    Severity: Major
    Found in lib/validator.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return;
      Severity: Major
      Found in api/routes/stages.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return this.props.value.toString();
        Severity: Major
        Found in lib/io-component.jsx - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return `type of block ${index} should be a string`;
          Severity: Major
          Found in lib/validator.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return null;
            Severity: Major
            Found in lib/validator.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return {pass: false, message: 'the board cannot clear the stage'};
              Severity: Major
              Found in lib/validator.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return `rotation of block ${index} should be an integer`;
                Severity: Major
                Found in lib/validator.js - About 30 mins to fix

                  Function ioGenerator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      ioGenerator: (random) => {
                          const iterations = (n) => (
                              10000 % (n - 1) === 0 ? n - 1 : 10000 % (n - 1)
                          );
                  
                  
                  Severity: Minor
                  Found in stages/10000th-digit.js - About 25 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 step has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      step({onPass = nop} = {}) {
                          const onBlockPass = (passEvent) => {
                              if (onPass) {
                                  onPass(passEvent);
                              }
                  Severity: Minor
                  Found in lib/board.js - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language