Showing 81 of 82 total issues

Method createGrammarRules has 382 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function createGrammarRules(): array
    {
        return [
            new Concatenation(0, ['TypeSystemLanguage'], 'Document'),
            new Concatenation(1, ['ExecutableLanguage'], null),
Severity: Major
Found in src/GraphQL/BaseParser.php - About 1 day to fix

    File BaseParser.php has 588 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * This file is part of Phplrt package.
     *
     * For the full copyright and license information, please view the LICENSE
    Severity: Major
    Found in src/GraphQL/BaseParser.php - About 1 day to fix

      Method createGrammarRules has 241 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function createGrammarRules(): array
          {
              return [
                  new Repetition(0, 0, -1, 'Directive', null),
                  new Repetition(1, 0, -1, 'Definition', null),
      Severity: Major
      Found in src/SDL/Parser/BaseParser.php - About 1 day to fix

        Method createGrammarRules has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function createGrammarRules(): array
            {
                return [
                    new Concatenation(0, ['Value'], null),
                    (new Concatenation('Json', [0], 'Json'))->setDefaultId('Json'),
        Severity: Major
        Found in src/Json/Json5/BaseParser.php - About 3 hrs to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              private function buildArguments(HasArguments $arguments): array
              {
                  $result = [];
          
                  foreach ($arguments->getArguments() as $argument) {
          Severity: Major
          Found in src/Foundation/Webonyx/Builder/FieldBuilder.php and 1 other location - About 2 hrs to fix
          src/Foundation/Webonyx/Builder/InputBuilder.php on lines 40..64

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 124.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              private function buildInputFields(InputDefinition $input): array
              {
                  $result = [];
          
                  foreach ($input->getArguments() as $field) {
          Severity: Major
          Found in src/Foundation/Webonyx/Builder/InputBuilder.php and 1 other location - About 2 hrs to fix
          src/Foundation/Webonyx/Builder/FieldBuilder.php on lines 135..159

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 124.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * This file is part of Railt package.
           *
           * For the full copyright and license information, please view the LICENSE
          src/SDL/Reflection/Validation/Inheritance/InputValidator.php on lines 1..47
          src/SDL/Reflection/Validation/Inheritance/ObjectValidator.php on lines 1..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * This file is part of Railt package.
           *
           * For the full copyright and license information, please view the LICENSE
          src/SDL/Reflection/Validation/Inheritance/EnumValidator.php on lines 1..47
          src/SDL/Reflection/Validation/Inheritance/ObjectValidator.php on lines 1..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

          <?php
          /**
           * This file is part of Railt package.
           *
           * For the full copyright and license information, please view the LICENSE
          src/SDL/Reflection/Validation/Inheritance/EnumValidator.php on lines 1..47
          src/SDL/Reflection/Validation/Inheritance/InputValidator.php on lines 1..47

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 120.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <?php
          /**
           * This file is part of Railt package.
           *
           * For the full copyright and license information, please view the LICENSE
          Severity: Major
          Found in src/GraphQL/AST/Definition/InterfaceNode.php and 1 other location - About 1 hr to fix
          src/GraphQL/AST/Definition/ObjectNode.php on lines 1..57

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 119.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          <?php
          /**
           * This file is part of Railt package.
           *
           * For the full copyright and license information, please view the LICENSE
          Severity: Major
          Found in src/GraphQL/AST/Definition/ObjectNode.php and 1 other location - About 1 hr to fix
          src/GraphQL/AST/Definition/InterfaceNode.php on lines 1..57

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 119.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Method createDateTime has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function createDateTime(ScalarDefinition $reflection): ScalarType
              {
                  $serializeDateTime = function ($value): string {
                      switch (true) {
                          case \is_string($value):
          Severity: Minor
          Found in src/Foundation/Webonyx/Builder/ScalarBuilder.php - About 1 hr to fix

            Function collect has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

                private function collect(Reader $reader, IOInterface $io): \Traversable
                {
                    $sections = $this->loadConfigs($reader);
            
                    foreach ($sections as $name => $configs) {
            Severity: Minor
            Found in src/Discovery/Generator.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

            Method render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function render(TokenInterface $token, Readable $sources): string
                {
                    switch ($token->getName()) {
                        case 'T_CHAR_UTF':
                            return $this->renderUtfChar($token->getValue(1));
            Severity: Minor
            Found in src/Json/Json5/Ast/StringNode.php - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  private function validateArgumentExistence(FieldDefinition $interface, FieldDefinition $object): void
                  {
                      foreach ($interface->getArguments() as $argument) {
                          $this->getCallStack()->push($argument);
              
              
              src/SDL/Reflection/Validation/Definitions/ObjectValidator.php on lines 78..93

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  private function validateFieldsExistence(ObjectDefinition $object, InterfaceDefinition $interface): void
                  {
                      foreach ($interface->getFields() as $field) {
                          $this->getCallStack()->push($field);
              
              
              src/SDL/Reflection/Validation/Definitions/ObjectValidator.php on lines 134..148

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 107.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function compile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function compile(): void
                  {
                      if ($this->completed === false) {
                          $this->completed = true;
              
              
              Severity: Minor
              Found in src/SDL/Reflection/Builder/Process/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 filter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function filter(array $data, array $current = []): array
                  {
                      $result = [];
              
                      foreach ($data as $key => $value) {
              Severity: Minor
              Found in src/Discovery/Composer/ArrayWalker.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

              Method all has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function all(): iterable
                  {
                      yield '' => $this->getDirectory();
              
                      //
              Severity: Minor
              Found in src/Discovery/Parser/Variables/PackageVariables.php - About 1 hr to fix

                Function isAllowedFor has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function isAllowedFor(?Definition $type): bool
                    {
                        if ($type === null) {
                            return false;
                        }
                Severity: Minor
                Found in src/SDL/Base/Definitions/BaseDirective.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

                Severity
                Category
                Status
                Source
                Language