thunderer/Logeek

View on GitHub

Showing 5 of 5 total issues

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

final class Board
{
    private $width;
    private $height;
    private $fieldTypes = [];
Severity: Minor
Found in src/Board.php - About 4 hrs to fix

    Method compileTree has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function compileTree(Board $board, array $tree): array
        {
            $code = [];
            while(true) {
                if(!$tree) {
    Severity: Minor
    Found in src/Compiler.php - About 1 hr to fix

      Function compileTree has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          private function compileTree(Board $board, array $tree): array
          {
              $code = [];
              while(true) {
                  if(!$tree) {
      Severity: Minor
      Found in src/Compiler.php - 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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function execute(Board $board, string $alias, array $operation)
          {
              $iteration = 0;
              while(true) {
                  $left = (string)$board->getVariable($operation['left']);
      Severity: Minor
      Found in src/Action/WhileLoopAction.php - 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 renderBoard has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function renderBoard(): string
          {
              $return = '';
              $return .= "\n";
              for($i = 0; $i < $this->height; $i++) {
      Severity: Minor
      Found in src/Board.php - 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

      Severity
      Category
      Status
      Source
      Language