Showing 57 of 59 total issues

Function gatherLines has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring.
Open

    private function gatherLines(Context $ctx): string {

        $gathering = false;
        $lines = '';
        $stackInfo = self::getStackInfo($ctx);
Severity: Minor
Found in src/Repl.php - About 35 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

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/NumberValue.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

                        return Interned::string($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 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 $tempDir;
              Severity: Major
              Found in src/EnvInfo.php - About 30 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 $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/StringValue.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 [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 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 ListValue($inner);
                            Severity: Major
                            Found in src/Values/AbstractValue.php - About 30 mins to fix

                              Function parseArguments has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
                              Open

                                  private function parseArguments(array $defaults, array $args): array {
                              
                                      $cfg = $defaults;
                              
                                      while ($a = array_shift($args)) {
                              Severity: Minor
                              Found in src/Cli/Entrypoint.php - 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 evaluate has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
                              Open

                                  public static function evaluate(
                                      string $op,
                                      AbstractValue $left,
                                      AbstractValue $right
                                  ): AbstractValue {
                              Severity: Minor
                              Found in src/Helpers/ArithmeticLTR.php - 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