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';
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;
File HttpServerConfiguration.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace K911\Swoole\Server;
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) {
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,
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';
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']);
- Read upRead up
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 {
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) {
- Read upRead up
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)) {
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');
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;
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,
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
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
Method generateOverriddenDoInExtension
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Filesystem $fs,
string $containerDir,
string $fileToLoad,
string $class,
string $namespace
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
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';
- Read upRead up
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, []);
- Read upRead up
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"