biurad/flange

View on GitHub

Showing 181 of 185 total issues

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

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

        public static function build(callable $application, array $options = []): Application
        {
            $a = $options['cacheDir'] ?? \dirname((new \ReflectionClass(\Composer\Autoload\ClassLoader::class))->getFileName(), 2);
            $b = 'App_'.\substr(\md5($a), 0, 10).'.php';
    
    
    Severity: Minor
    Found in src/AppBuilder.php - About 1 hr to fix

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

          public static function getConfigNode(): ArrayNodeDefinition
          {
              $rootNode = new ArrayNodeDefinition('cors');
      
              $rootNode
      Severity: Minor
      Found in src/Extensions/Config/HttpCorsSection.php - About 1 hr to fix

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

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

          Method execute has 29 lines of code (exceeds 25 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

            Method configure has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function configure(): void
                {
                    $this
                        ->setDefinition([
                            new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'),
            Severity: Minor
            Found in src/Commands/ServerCommand.php - About 1 hr to fix

              Method describeForeignKeys has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function describeForeignKeys(DatabaseInterface $database, array $foreignKeys, InputInterface $input): void
                  {
                      $this->sprintf(
                          "\n<fg=cyan>Foreign Keys of </fg=cyan><comment>%s.%s</comment>:\n",
                          $database->getName(),
              Severity: Minor
              Found in src/Commands/CycleORM/DatabaseTableCommand.php - About 1 hr to fix

                Function register has a Cognitive Complexity of 10 (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/RateLimiterExtension.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 10 (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/AssetExtension.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 resolveSchema has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function resolveSchema($schema, ?string $cache): TypeSchema
                    {
                        if ($schema instanceof TypeSchema) {
                            return $schema;
                        }
                Severity: Minor
                Found in src/GraphQL/Schema.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 getConfigTreeBuilder has 27 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/SerializerExtension.php - About 1 hr to fix

                  Method getGenerators has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function getGenerators(Container $container, string $entityPath): array
                      {
                          $generators = [new Statement(Generator\ResetTables::class)]; // re-declared table schemas (remove columns)
                  
                          if (\class_exists(\Cycle\Annotated\Configurator::class)) {
                  Severity: Minor
                  Found in src/Extensions/CycleORM/ORMExtension.php - About 1 hr to fix

                    Method describeColumns has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function describeColumns(AbstractTable $schema): void
                        {
                            $columnsTable = $this->table->setHeaders(
                                [
                                    'Column:',
                    Severity: Minor
                    Found in src/Commands/CycleORM/DatabaseTableCommand.php - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                  null === ($class = $container->definition($id)->getEntity())
                                  || !($r = new \ReflectionClass($class))
                                  || !$r->hasMethod($method)
                                  || 1 > ($m = $r->getMethod($method))->getNumberOfParameters()
                      Severity: Major
                      Found in src/Extensions/EventDispatcherExtension.php - About 1 hr to fix

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

                            public function register(Container $container, array $configs = []): void
                            {
                                if (!\class_exists(Filesystem::class)) {
                                    throw new \LogicException('Flysystem support cannot be enabled as the Flysystem library is not installed. Try running "composer require league/flysystem".');
                                }
                        Severity: Minor
                        Found in src/Extensions/Flysystem/FlysystemExtension.php - About 55 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 registerRetryableHttpClient has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function registerRetryableHttpClient(array $options, string $name, Container $container): void
                            {
                                if (!\class_exists(RetryableHttpClient::class)) {
                                    throw new \LogicException('Support for retrying failed requests requires symfony/http-client 5.2 or higher, try upgrading.');
                                }
                        Severity: Minor
                        Found in src/Extensions/Symfony/HttpClientExtension.php - About 55 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 register has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function register(Container $container, array $configs = []): void
                            {
                                // The default configs ...
                                $container->parameters['default_locale'] = $configs['locale'] ?? 'en';
                                self::setPath($container, $this->rootDir, $configs['var_path'] ?? null, $configs['cache_path'] ?? null);
                        Severity: Minor
                        Found in src/Extensions/ConfigExtension.php - About 55 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 boot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function boot(Container $container): void
                            {
                                if (!$container->has('serializer')) {
                                    return;
                                }
                        Severity: Minor
                        Found in src/Extensions/Symfony/SerializerExtension.php - About 55 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 createRequestMatcher has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function createRequestMatcher(Container $container, string $path = null, string $host = null, int $port = null, array $methods = [], array $ips = null, array $attributes = []): Statement
                            {
                                if ($methods) {
                                    $methods = \array_map('strtoupper', $methods);
                                }
                        Severity: Minor
                        Found in src/Extensions/Security/SecurityExtension.php - About 55 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 handleThrowable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected function handleThrowable(\Throwable $e, ServerRequestInterface $request): ResponseInterface
                            {
                                if ($request instanceof Request) {
                                    $this->get('request_stack')->push($request->getRequest());
                                }
                        Severity: Minor
                        Found in src/Application.php - About 55 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