Showing 42 of 56 total issues

Method autocomplete has 42 lines of code (exceeds 40 allowed). Consider refactoring.
Open

    private static function autocomplete(
        string $buffer,
        Context $ctx
    ): array {

Severity: Minor
Found in src/Repl.php - About 1 hr to fix

    Method mapping_to_couples has 41 lines of code (exceeds 40 allowed). Consider refactoring.
    Open

        public static function mapping_to_couples(AbstractValue $value) {
    
            $internalValue = $value->getCoreValue();
            if ($internalValue instanceof MapContainer) {
    
    
    Severity: Minor
    Found in src/Helpers/Func.php - About 1 hr to fix

      Function reduce has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
      Open

          public static function reduce(array &$node): void {
      
              // Make sure this is always list, even with one item.
              if (isset($node['args'])) {
                  $node['args'] = Func::ensure_indexed($node['args']);
      Severity: Minor
      Found in src/Handlers/Kinds/ArgumentList.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

      Function handle has a Cognitive Complexity of 12 (exceeds 8 allowed). Consider refactoring.
      Open

          protected static function handle(array $node, Context $context) {
      
              // Execute the left-hand node and get its return value.
              $subject = HandlerFactory::runNode($node['left'], $context);
      
      
      Severity: Minor
      Found in src/Handlers/Kinds/ForStatement.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

      Function resolve has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring.
      Open

          private static function resolve(
              string $dotpath,
              string $originPackage
          ): array {
      
      
      Severity: Minor
      Found in src/Modules/Dotpath.php - 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 handle has a Cognitive Complexity of 11 (exceeds 8 allowed). Consider refactoring.
      Open

          protected static function handle(
              array $node,
              Context $context
          ) {
      
      
      Severity: Minor
      Found in src/Handlers/Kinds/WhileStatement.php - 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

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              protected string $name,
              protected ?TypeValue $parent = \null,
              protected array $attrs = [],
              protected bool $isFinal = \true,
              protected bool $isMutable = \false,
      Severity: Minor
      Found in src/Values/TypeValue.php - About 35 mins to fix

        Method build has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                array $entryNode,
                string $definitionName,
                ModuleValue $definitionModule,
                ?array $defParams = \null,
                ?Scope $defScope = \null
        Severity: Minor
        Found in src/Structures/FnContainer.php - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

                          return self::evaluateRelation($op, $left, $right);
          Severity: Major
          Found in src/Helpers/ComparisonLTR.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return new DictValue(Func::array_to_couples($inner));
            Severity: Major
            Found in src/Values/AbstractValue.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $tmp === -1 || $tmp === 0;
              Severity: Major
              Found in src/Values/NumberValue.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return \null;
                Severity: Major
                Found in src/EnvInfo.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                      return new FuncValue(FnContainer::buildFromClosure($value));
                  Severity: Major
                  Found in src/Values/AbstractValue.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return new FuncValue(FnContainer::buildFromClosure($value));
                    Severity: Major
                    Found in src/Values/AbstractValue.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return \null;
                      Severity: Major
                      Found in src/Values/StringValue.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $tempDir;
                        Severity: Major
                        Found in src/EnvInfo.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return [false, 0];
                          Severity: Major
                          Found in src/Repl.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return new ListValue($inner);
                            Severity: Major
                            Found in src/Values/AbstractValue.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return $l <= $r;
                              Severity: Major
                              Found in src/Values/StringValue.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return \null;
                                Severity: Major
                                Found in src/Values/NumberValue.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language