Showing 68 of 82 total issues

Function getDirectives has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDirectives(string $name = null): iterable
    {
        foreach ($this->directives as $definitions) {
            foreach ((array)$definitions as $found => $invocation) {
                if ($name === null || $name === $found) {
Severity: Minor
Found in src/SDL/Base/Invocations/Directive/BaseDirectivesContainer.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

Function fromEnvironment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function fromEnvironment(array $variables, array $values, \Closure $otherwise = null)
    {
        foreach ([$_ENV, $_SERVER] as $context) {
            foreach ($variables as $variable) {
                if (isset($context[$variable])) {
Severity: Minor
Found in src/Foundation/Application/Environment.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

Function runProxies has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function runProxies(array $children): iterable
    {
        $proxies = $this->traitConstructors(static::class, 'each');

        foreach ($children as $child) {
Severity: Minor
Found in src/GraphQL/AST/Node.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

Function complete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function complete(Document $document): Document
    {
        $this->load($document);

        $build = function (Definition $definition): void {
Severity: Minor
Found in src/SDL/Compiler.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 self::ERROR_MESSAGE_RECURSION;
Severity: Major
Found in src/Json/Exception/Message.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return "\u{0000}";
    Severity: Major
    Found in src/Json/Json5/Ast/StringNode.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return self::ERROR_MESSAGE_UNSUPPORTED_TYPE;
      Severity: Major
      Found in src/Json/Exception/Message.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return "\u{000B}";
        Severity: Major
        Found in src/Json/Json5/Ast/StringNode.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return self::ERROR_MESSAGE_UNKNOWN;
          Severity: Major
          Found in src/Json/Exception/Message.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return \sprintf($pattern, \strtolower(\gettype($signature)), $signature);
            Severity: Major
            Found in src/Container/SignatureResolver.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return '\\';
              Severity: Major
              Found in src/Json/Json5/Ast/StringNode.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return \ucfirst(\strtolower(\gettype($value)));
                Severity: Major
                Found in src/SDL/Support.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return new CustomScalarType([
                              'name'         => $reflection->getName(),
                              'description'  => $reflection->getDescription(),
                              'serialize'    => function ($value) use ($serializeDateTime): string {
                                  return $serializeDateTime($value);
                  Severity: Major
                  Found in src/Foundation/Webonyx/Builder/ScalarBuilder.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return $this->dumper->dump($value);
                    Severity: Major
                    Found in src/Dumper/Resolver/CallableResolver.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return $this->parseInt($value->getValue());
                      Severity: Major
                      Found in src/GraphQL/AST/Value/NumberValue.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return self::ERROR_MESSAGE_INVALID_PROPERTY_NAME;
                        Severity: Major
                        Found in src/Json/Exception/Message.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return $this->valueToScalar(Json::encode($value->jsonSerialize()));
                          Severity: Major
                          Found in src/SDL/Support.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return "\u{000D}";
                            Severity: Major
                            Found in src/Json/Json5/Ast/StringNode.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return Json::decode($value->toJson(), \JSON_OBJECT_AS_ARRAY);
                              Severity: Major
                              Found in src/SDL/Support.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                                return '"';
                                Severity: Major
                                Found in src/Json/Json5/Ast/StringNode.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language