biurad/flange

View on GitHub

Showing 181 of 185 total issues

Method createRequestMatcher has 7 arguments (exceeds 4 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
Severity: Major
Found in src/Extensions/Security/SecurityExtension.php - About 50 mins to fix

    Function createDefinition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        final public function createDefinition(array $options): Definition
        {
            if ($this instanceof RequiredPackagesInterface) {
                $missingPackages = [];
    
    
    Severity: Minor
    Found in src/Extensions/Flysystem/Adapter/AbstractFactory.php - About 45 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 guessRequired has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function guessRequired(string $class, string $property): ?ValueGuess
        {
            $classMetadatas = $this->getMetadata($class);
    
            if (!$classMetadatas) {
    Severity: Minor
    Found in src/Database/Doctrine/Form/DoctrineOrmTypeGuesser.php - About 45 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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function run(Registry $registry): Registry
        {
            $this->output->writeln('<info>Detecting schema changes:</info>'."\n");
            $this->changes = [];
    
    
    Severity: Minor
    Found in src/Database/Cycle/Generator/ShowChanges.php - About 45 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 build has a Cognitive Complexity of 8 (exceeds 5 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 45 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 handle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function handle(ServerRequestInterface $request, bool $catch = true): ResponseInterface
        {
            try {
                $event = $this->getDispatcher()?->dispatch(new Event\RequestEvent($this, $request));
    
    
    Severity: Minor
    Found in src/Application.php - About 45 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

    Consider simplifying this complex logical expression.
    Open

                            if (isset($v['retry_strategy']) && (isset($v['http_codes']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay']) || isset($v['jitter']))) {
                                throw new \InvalidArgumentException('The "retry_strategy" option cannot be used along with the "http_codes", "delay", "multiplier", "max_delay" or "jitter" options.');
                            }
    Severity: Major
    Found in src/Extensions/Config/HttpClientRetrySection.php - About 40 mins to fix

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

          public function register(Container $container, array $configs = []): void
          {
              if (isset($configs['dispatcher_class'])) {
                  $dispatcher = $configs['dispatcher_class'];
      
      
      Severity: Minor
      Found in src/Extensions/EventDispatcherExtension.php - About 35 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 configureOptions has a Cognitive Complexity of 7 (exceeds 5 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: Minor
      Found in src/Database/Doctrine/Form/Type/DoctrineType.php - About 35 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 getPanel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getPanel(): string
          {
              $rc = new \ReflectionClass($this->container);
              $types = [];
              $wiring = $this->getContainerProperty('types', $rc);
      Severity: Minor
      Found in src/Debug/Tracy/ContainerPanel.php - About 35 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 refreshUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function refreshUser(UserInterface $user): UserInterface
          {
              $class = $this->getClass();
      
              if (!$user instanceof $class) {
      Severity: Minor
      Found in src/Database/Doctrine/Provider/EntityUserProvider.php - About 35 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 7 (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/PropertyInfoExtension.php - About 35 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 execute has a Cognitive Complexity of 7 (exceeds 5 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 35 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 start has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function start(string $pidFile)
          {
              $pid = pcntl_fork();
      
              if ($pid < 0) {
      Severity: Minor
      Found in src/Commands/ServerCommand.php - About 35 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 addConfiguration has a Cognitive Complexity of 7 (exceeds 5 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 35 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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function create(Container $container, string $id, array $config): void
          {
              $hasCache = !empty($container->getExtensionConfig(CacheExtension::class, $container->hasExtension(FrameworkExtension::class) ? 'symfony' : null));
      
              if (isset($config['token_provider'])) {
      Severity: Minor
      Found in src/Extensions/Security/Provider/RememberMeFactory.php - About 35 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 createUserDaoProvider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function createUserDaoProvider(string $name, array $provider, Container $container): Reference
          {
              $name = 'security.user.provider.concrete.'.\strtolower($name);
      
              // Doctrine Entity and In-memory DAO provider are managed by factories
      Severity: Minor
      Found in src/Extensions/Security/SecurityExtension.php - About 35 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

      Avoid too many return statements within this method.
      Open

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

        Avoid too many return statements within this method.
        Open

                                                    return \array_map(fn (string $place) => ['name' => $place], $places);
        Severity: Major
        Found in src/Extensions/Symfony/WorkflowExtension.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                                  return \array_values($places);
          Severity: Major
          Found in src/Extensions/Symfony/WorkflowExtension.php - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language