biurad/flange

View on GitHub

Showing 185 of 185 total issues

Method execute has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input, $output);

        if (!$this->migrator->isConfigured()) {
Severity: Major
Found in src/Commands/CycleORM/DatabaseMigrateCommand.php - About 2 hrs to fix

    Method execute has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output): int
        {
            $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
    
            if (!$this->debug) {
    Severity: Major
    Found in src/Commands/ServerCommand.php - About 2 hrs to fix

      Function register has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function register(Container $container, array $configs = []): void
          {
              if (!$configs['enabled']) {
                  return;
              }
      Severity: Minor
      Found in src/Extensions/Symfony/HttpClientExtension.php - About 2 hrs 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 register has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function register(Container $container, array $configs = []): void
          {
              if (!$configs['enabled']) {
                  return;
              }
      Severity: Minor
      Found in src/Extensions/Symfony/ValidatorExtension.php - About 2 hrs 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 register has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function register(Container $container, array $configs = []): void
          {
              if (!$configs['enabled']) {
                  return;
              }
      Severity: Minor
      Found in src/Extensions/Symfony/NotifierExtension.php - About 2 hrs 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 configureOptions has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function configureOptions(OptionsResolver $resolver): void
          {
              $choiceLoader = function (Options $options) {
                  // Unless the choices are given explicitly, load them on demand
                  if (null === $options['choices']) {
      Severity: Major
      Found in src/Database/Doctrine/Form/Type/DoctrineType.php - About 2 hrs to fix

        Method getConfigTreeBuilder has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getConfigTreeBuilder(): TreeBuilder
            {
                $treeBuilder = new TreeBuilder(__CLASS__);
        
                $treeBuilder->getRootNode()
        Severity: Major
        Found in src/Extensions/TemplateExtension.php - About 2 hrs to fix

          Method addProvidersSection has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function addProvidersSection(ArrayNodeDefinition $rootNode): void
              {
                  $providerNodeBuilder = $rootNode
                      ->fixXmlConfig('provider')
                      ->children()
          Severity: Major
          Found in src/Extensions/Security/SecurityExtension.php - About 2 hrs to fix

            Method getConfigTreeBuilder has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getConfigTreeBuilder(): TreeBuilder
                {
                    $treeBuilder = new TreeBuilder(__CLASS__);
            
                    $treeBuilder->getRootNode()
            Severity: Major
            Found in src/Extensions/Symfony/LockExtension.php - About 2 hrs to fix

              Method boot has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function boot(Container $container): void
                  {
                      if (!$container->typed(Application::class)) {
                          return;
                      }
              Severity: Minor
              Found in src/Extensions/Symfony/ConsoleExtension.php - About 2 hrs to fix

                Method register has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function register(Container $container, array $configs = []): void
                    {
                        if (!$configs['enabled']) {
                            return;
                        }
                Severity: Minor
                Found in src/Extensions/Symfony/ValidatorExtension.php - About 1 hr to fix

                  Method register has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function register(Container $container, array $configs = []): void
                      {
                          if (!$configs['enabled']) {
                              return;
                          }
                  Severity: Minor
                  Found in src/Extensions/Symfony/HttpClientExtension.php - About 1 hr to fix

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

                        public function getConfigTreeBuilder(): TreeBuilder
                        {
                            $treeBuilder = new TreeBuilder(__CLASS__);
                    
                            $treeBuilder->getRootNode()
                    Severity: Minor
                    Found in src/Extensions/RoutingExtension.php - About 1 hr to fix

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

                          public function register(Container $container, array $configs = []): void
                          {
                              if (!\class_exists(AnnotationLoader::class)) {
                                  throw new \LogicException('Annotations/Attributes support cannot be enabled as the Annotation component is not installed. Try running "composer require biurad/annotations".');
                              }
                      Severity: Minor
                      Found in src/Extensions/AnnotationExtension.php - About 1 hr to fix

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

                            public function getConfigTreeBuilder(): TreeBuilder
                            {
                                $treeBuilder = new TreeBuilder(__CLASS__);
                        
                                $treeBuilder->getRootNode()
                        Severity: Minor
                        Found in src/Extensions/Symfony/MailerExtension.php - About 1 hr to fix

                          Method execute has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function execute(InputInterface $input, OutputInterface $output): int
                              {
                                  $databases = $input->getArgument('db') ?? \array_keys($this->config->getDatabases());
                          
                                  if (!\is_array($databases)) {
                          Severity: Minor
                          Found in src/Commands/CycleORM/DatabaseListCommand.php - About 1 hr to fix

                            Method runBlockingServer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function runBlockingServer(SymfonyStyle $io, InputInterface $input, OutputInterface $output): int
                                {
                                    $callback = null;
                                    $disableOutput = false;
                            
                            
                            Severity: Minor
                            Found in src/Commands/ServerCommand.php - About 1 hr to fix

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

                                  public function addConfiguration(NodeDefinition $node): void
                                  {
                                      $node
                                          ->beforeNormalization()
                                              ->ifTrue(fn ($v) => null === $v || \is_string($v))
                              Severity: Major
                              Found in src/Extensions/Security/Provider/FormLoginFactory.php and 1 other location - About 1 hr to fix
                              src/Extensions/Security/Provider/RemoteUserFactory.php on lines 30..43

                              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 117.

                              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

                                  public function addConfiguration(NodeDefinition $node): void
                                  {
                                      $node
                                          ->beforeNormalization()
                                              ->ifTrue(fn ($v) => null === $v || \is_string($v))
                              Severity: Major
                              Found in src/Extensions/Security/Provider/RemoteUserFactory.php and 1 other location - About 1 hr to fix
                              src/Extensions/Security/Provider/FormLoginFactory.php on lines 30..43

                              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 117.

                              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 getEntitiesByIds has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getEntitiesByIds(string $identifier, array $values): array
                                  {
                                      if (null !== $this->queryBuilder->getMaxResults() || 0 < (int) $this->queryBuilder->getFirstResult()) {
                                          // an offset or a limit would apply on results including the where clause with submitted id values
                                          // that could make invalid choices valid
                              Severity: Minor
                              Found in src/Database/Doctrine/Form/ChoiceList/ORMQueryBuilderLoader.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language