pixelfederation/swoole-bundle

View on GitHub

Showing 24 of 252 total issues

HttpServerConfiguration has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class HttpServerConfiguration
{
    private const SWOOLE_HTTP_SERVER_CONFIG_DAEMONIZE = 'daemonize';
    private const SWOOLE_HTTP_SERVER_CONFIG_SERVE_STATIC = 'serve_static';
    private const SWOOLE_HTTP_SERVER_CONFIG_REACTOR_COUNT = 'reactor_count';
Severity: Minor
Found in src/Server/HttpServerConfiguration.php - About 4 hrs to fix

    File ContainerModifier.php has 320 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    namespace K911\Swoole\Bridge\Symfony\Container;
    Severity: Minor
    Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 3 hrs to fix

      File HttpServerConfiguration.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare(strict_types=1);
      
      namespace K911\Swoole\Server;
      Severity: Minor
      Found in src/Server/HttpServerConfiguration.php - About 3 hrs to fix

        Method validateSetting has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function validateSetting(string $key, mixed $value): void
            {
                Assertion::keyExists(self::SWOOLE_HTTP_SERVER_CONFIGURATION, $key, 'There is no configuration mapping for setting "%s".');
        
                switch ($key) {
        Severity: Major
        Found in src/Server/HttpServerConfiguration.php - About 2 hrs to fix

          Method generateOverriddenDoInExtension has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function generateOverriddenDoInExtension(
                  Filesystem $fs,
                  string $containerDir,
                  string $fileToLoad,
                  string $class,
          Severity: Major
          Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 2 hrs to fix

            Method overrideGeneratedContainer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function overrideGeneratedContainer(ReflectionClass $reflContainer, string $cacheDir, bool $isDebug): void
                {
                    $fs = new Filesystem();
                    $containerFqcn = $reflContainer->getName();
                    $overriddenFqcn = $containerFqcn.'_Overridden';
            Severity: Minor
            Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 1 hr to fix

              Function process has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function process(ContainerBuilder $container, Proxifier $proxifier): void
                  {
                      $resetterDefId = 'swoole_bundle.coroutines_support.cache_adapter_resetter';
                      $resetterDef = new Definition(SimpleResetter::class);
                      $resetterDef->setArguments(['reset']);
              Severity: Minor
              Found in src/Bridge/Symfony/Cache/CacheAdapterProcessor.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 newInstance has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function newInstance(
                      object $instance,
                      array $factoryConfigs,
                      int $globalInstancesLimit
                  ): object {
              Severity: Minor
              Found in src/Bridge/Symfony/Container/Proxy/UnmanagedFactoryInstantiator.php - About 1 hr to fix

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

                    private function validateSetting(string $key, mixed $value): void
                    {
                        Assertion::keyExists(self::SWOOLE_HTTP_SERVER_CONFIGURATION, $key, 'There is no configuration mapping for setting "%s".');
                
                        switch ($key) {
                Severity: Minor
                Found in src/Server/HttpServerConfiguration.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 generate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator): void
                    {
                        CanProxyAssertion::assertClassCanBeProxied($originalClass);
                
                        $interfaces = [

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

                      private static function generateLazyGetter(string $methodName, array $internals): string
                      {
                          $sharedCheck = PHP_EOL;
                  
                          if (!empty($internals)) {
                  Severity: Minor
                  Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 1 hr to fix

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

                        public function process(ContainerBuilder $container, Proxifier $proxifier): void
                        {
                            /** @var array<string,string> $bundles */
                            $bundles = $container->getParameter('kernel.bundles');
                    
                    
                    Severity: Minor
                    Found in src/Bridge/Doctrine/DoctrineProcessor.php - About 1 hr to fix

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

                          private function ensureXdebugDisabled(SymfonyStyle $io): void
                          {
                              $xdebugHandler = new XdebugHandler();
                              if (!$xdebugHandler->shouldRestart()) {
                                  return;
                      Severity: Minor
                      Found in src/Bridge/Symfony/Bundle/Command/AbstractServerStartCommand.php - About 1 hr to fix

                        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                private string $wrappedServiceId,
                                private Container $container,
                                Mutex $mutex,
                                int $instancesLimit = 50,
                                ?Resetter $resetter = null,
                        Severity: Minor
                        Found in src/Bridge/Symfony/Container/ServicePool/DiServicePool.php - About 45 mins to fix

                          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  private HttpServer $server,
                                  private HttpServerConfiguration $serverConfiguration,
                                  private ConfiguratorInterface $serverConfigurator,
                                  protected ParameterBagInterface $parameterBag,
                                  private BootableInterface $bootManager
                          Severity: Minor
                          Found in src/Bridge/Symfony/Bundle/Command/AbstractServerStartCommand.php - About 35 mins to fix

                            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    private AccessInterceptorValueHolderFactory $proxyFactory,
                                    private Instantiator $instantiator,
                                    private ServicePoolContainer $servicePoolContainer,
                                    private MutexFactory $limitLocking,
                                    private MutexFactory $newInstanceLocking
                            Severity: Minor
                            Found in src/Bridge/Symfony/Container/Proxy/UnmanagedFactoryInstantiator.php - About 35 mins to fix

                              Method generateOverriddenDoInExtension has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      Filesystem $fs,
                                      string $containerDir,
                                      string $fileToLoad,
                                      string $class,
                                      string $namespace
                              Severity: Minor
                              Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 35 mins to fix

                                Method overrideCachedEntrypoint has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    private static function overrideCachedEntrypoint(Filesystem $fs, string $cacheDir, string $containerClass, string $overriddenFqcn, bool $isDebug): void
                                Severity: Minor
                                Found in src/Bridge/Symfony/Container/ContainerModifier.php - About 35 mins to fix

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

                                      private static function overrideGeneratedContainer(ReflectionClass $reflContainer, string $cacheDir, bool $isDebug): void
                                      {
                                          $fs = new Filesystem();
                                          $containerFqcn = $reflContainer->getName();
                                          $overriddenFqcn = $containerFqcn.'_Overridden';
                                  Severity: Minor
                                  Found in src/Bridge/Symfony/Container/ContainerModifier.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 prepareConnectionsForProxification has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private function prepareConnectionsForProxification(ContainerBuilder $container, array $connectionSvcIds): void
                                      {
                                          $dbalAliveKeeperDef = $container->findDefinition(DBALPlatformAliveKeeper::class);
                                          $aliveKeepers = $dbalAliveKeeperDef->getArgument(1);
                                          $dbalAliveKeeperDef->setArgument(1, []);
                                  Severity: Minor
                                  Found in src/Bridge/Doctrine/DoctrineProcessor.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language