Showing 6 of 80 total issues
HttpServerConfiguration
has 32 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 HttpServerConfiguration.php
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace K911\Swoole\Server;
Method validateSetting
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateSetting(string $key, $value): void
{
Assertion::keyExists(self::SWOOLE_HTTP_SERVER_CONFIGURATION, $key, 'There is no configuration mapping for setting "%s".');
switch ($key) {
Function validateSetting
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function validateSetting(string $key, $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
Function onKernelResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
public function onKernelResponse(ResponseEvent $event): void
{
if (!$event->isMasterRequest() || !$this->isSessionRelated($event)) {
return;
}
- 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 parsePhpIniContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parsePhpIniContent(iterable $iniFiles): string
{
$content = '';
$regex = '/^\s*(zend_extension\s*=.*xdebug.*)$/mi';
- 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"