biurad/flange

View on GitHub

Showing 185 of 185 total issues

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

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

                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

                  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

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

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

                      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

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

                          Severity
                          Category
                          Status
                          Source
                          Language