biurad/flange

View on GitHub

Showing 181 of 185 total issues

Method register has 42 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/FormExtension.php - About 1 hr to fix

    Method getConfigTreeBuilder has 42 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/AnnotationExtension.php - About 1 hr to fix

      Method getLocation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getLocation(string $path, string $baseDir = 'src')
          {
              if (\str_contains($path, '..')) {
                  throw new \RuntimeException(\sprintf('File name "%s" contains invalid characters (..).', $path));
              }
      Severity: Minor
      Found in src/Traits/HelperTrait.php - About 1 hr to fix

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

            public function register(Container $container, array $configs = []): void
            {
                if (!\class_exists('Doctrine\DBAL\DriverManager')) {
                    throw new \LogicException('The Doctrine DBAL support cannot be enabled as the Doctrine DBAL is not installed. Try running "composer require doctrine/dbal".');
                }
        Severity: Minor
        Found in src/Extensions/Doctrine/DatabaseExtension.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 execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                $this->migrator->configure();
                $io = new SymfonyStyle($input, $output);
        
        
        Severity: Minor
        Found in src/Commands/CycleORM/DatabaseOrmCommand.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 boot has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function boot(Container $container): void
            {
                if (!$container->has('validator')) {
                    return;
                }
        Severity: Minor
        Found in src/Extensions/Symfony/ValidatorExtension.php - About 1 hr to fix

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

              protected function execute(InputInterface $input, OutputInterface $output): int
              {
                  $workflowName = $input->getArgument('name');
          
                  $workflow = null;
          Severity: Minor
          Found in src/Commands/Symfony/WorkflowDumpCommand.php - About 1 hr to fix

            Method registerValidatorMapping has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function registerValidatorMapping(Container $container, array &$files): void
                {
                    $fileRecorder = function ($extension, $path) use (&$files): void {
                        $files['yaml' === $extension ? 'yml' : $extension][] = $path;
                    };
            Severity: Minor
            Found in src/Extensions/Symfony/ValidatorExtension.php - About 1 hr to fix

              Method addConfiguration has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function addConfiguration(NodeDefinition $node): void
                  {
                      $builder = $node
                          ->fixXmlConfig('user_provider')
                          ->beforeNormalization()->ifString()->then(fn ($v) => ['secret' => $v])->end()
              Severity: Minor
              Found in src/Extensions/Security/Provider/RememberMeFactory.php - About 1 hr to fix

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

                    protected function doLoadChoicesForValues(array $values, ?callable $value): array
                    {
                        if ($this->idReader && null === $value) {
                            throw new LogicException('Not defining the IdReader explicitly as a value callback when the query can be optimized is not supported.');
                        }
                Severity: Minor
                Found in src/Database/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.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 register has a Cognitive Complexity of 12 (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/LockExtension.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 register has 35 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/TemplateExtension.php - About 1 hr to fix

                  Method register has 33 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/PropertyInfoExtension.php - About 1 hr to fix

                    Method guessType has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function guessType(string $class, string $property): ?TypeGuess
                        {
                            if (!$ret = $this->getMetadata($class)) {
                                return new TypeGuess(TextType::class, [], Guess::LOW_CONFIDENCE);
                            }
                    Severity: Minor
                    Found in src/Database/Doctrine/Form/DoctrineOrmTypeGuesser.php - About 1 hr to fix

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

                          public function register(Container $container, array $configs = []): void
                          {
                              if (!\interface_exists(DatabaseProviderInterface::class)) {
                                  throw new \LogicException('Cycle Database support cannot be enabled as the Database component is not installed. Try running "composer require cycle/database".');
                              }
                      Severity: Minor
                      Found in src/Extensions/CycleORM/DatabaseExtension.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 registerMappingFilesFromConfig has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function registerMappingFilesFromConfig(Container $container, array $mappedPaths, callable $fileRecorder): void
                          {
                              foreach ($mappedPaths as $path) {
                                  if (\is_dir($path = $container->parameter($path))) {
                                      $this->registerMappingFilesFromDir($path, $fileRecorder);
                      Severity: Minor
                      Found in src/Extensions/Symfony/Traits/FilesMappingTrait.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 execute has a Cognitive Complexity of 11 (exceeds 5 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

                      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 processFormTypeExtensions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function processFormTypeExtensions(Container $container): array
                          {
                              $typeExtensions = $typeExtensionsClasses = [];
                      
                              foreach ($container->tagged('form.type_extension') as $serviceId => $tag) {
                      Severity: Minor
                      Found in src/Extensions/Symfony/FormExtension.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 boot has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function boot(Container $container): void
                          {
                              if (!$container->has('translator')) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/Extensions/Symfony/TranslationExtension.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 boot has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function boot(Container $container): void
                          {
                              if (!$container->has('translator')) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/Extensions/Symfony/TranslationExtension.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language