biurad/flange

View on GitHub

Showing 181 of 185 total issues

Avoid too many return statements within this method.
Open

        return $treeBuilder;
Severity: Major
Found in src/Extensions/Symfony/HttpClientExtension.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return null;
    Severity: Major
    Found in src/Database/Doctrine/Form/Type/DoctrineType.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                                                  return $transitions;
      Severity: Major
      Found in src/Extensions/Symfony/WorkflowExtension.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                                                    return [];
        Severity: Major
        Found in src/Extensions/Symfony/HttpClientExtension.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $this->getCachedIdReader($this->registry, $options['class']);
          Severity: Major
          Found in src/Database/Doctrine/Form/Type/DoctrineType.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                                    return false;
            Severity: Major
            Found in src/Extensions/Symfony/WorkflowExtension.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return 1;
              Severity: Major
              Found in src/Commands/ServerCommand.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->createHasher($config);
                Severity: Major
                Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return [
                                  'class' => SodiumPasswordHasher::class,
                                  'arguments' => [
                                      $config['time_cost'],
                                      (($config['memory_cost'] ?? 0) << 10) ?: null,
                  Severity: Major
                  Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return $this->createHasher($config);
                    Severity: Major
                    Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return [
                                      'class' => NativePasswordHasher::class,
                                      'arguments' => [
                                          $config['time_cost'],
                                          (($config['memory_cost'] ?? 0) << 10) ?: null,
                      Severity: Major
                      Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return false;
                        Severity: Major
                        Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $config;
                          Severity: Major
                          Found in src/Extensions/Security/SecurityExtension.php - About 30 mins to fix

                            Function getMetadata has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function getMetadata(string $class): ?array
                                {
                                    // normalize class name
                                    $class = self::getRealClass(ltrim($class, '\\'));
                            
                            
                            Severity: Minor
                            Found in src/Database/Doctrine/Form/DoctrineOrmTypeGuesser.php - About 25 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 getServiceProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function getServiceProvider(Container $container, string $name, string $value = null)
                                {
                                    if (\preg_match('#^[a-z]++:#', $dsn = $value ?? $name)) {
                                        if (null === $value) {
                                            $name = '.cache_connection.'.\md5($dsn);
                            Severity: Minor
                            Found in src/Extensions/Symfony/CacheExtension.php - About 25 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 guessMaxLength has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function guessMaxLength(string $class, string $property): ?ValueGuess
                                {
                                    $ret = $this->getMetadata($class);
                                    if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) {
                                        $mapping = $ret[0]->getFieldMapping($property);
                            Severity: Minor
                            Found in src/Database/Doctrine/Form/DoctrineOrmTypeGuesser.php - About 25 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 getGenerators has a Cognitive Complexity of 6 (exceeds 5 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 25 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 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function boot(Container $container): void
                                {
                                    if ($container->has('events.dispatcher')) {
                                        if ($container->shared('events.dispatcher')) {
                                            $container->removeShared('events.dispatcher');
                            Severity: Minor
                            Found in src/Extensions/EventDispatcherExtension.php - About 25 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 findServerAddress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function findServerAddress(?string $address): string
                                {
                                    if (null === $address) {
                                        $this->hostname = '127.0.0.1';
                                        $this->port = $this->findBestPort();
                            Severity: Minor
                            Found in src/Commands/ServerCommand.php - About 25 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 6 (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/FormExtension.php - About 25 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