Showing 95 of 95 total issues
Function checkBodyHeaders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function checkBodyHeaders(Request $request, $boundaryLine, $pos)
{
// initialize data block
if (!isset($this->currentFormDataInfo['tmp_name'])) {
// file not opened yet, check the boundary
- 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 enableCompressionIfSupported
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function enableCompressionIfSupported(& $buffer)
{
$this->compressionHandler = null;
if (!function_exists('deflate_init') || !$this->isBodyAllowedInResponse($this->request)) {
- 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 dispatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function dispatch(Request $request, Response $response)
{
$path = $request->getUri()->getPath();
$code = Response::STATUS_CODE_200;
- 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 parseRequestPostData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function parseRequestPostData(Request $request)
{
$body = $request->getContent();
if (!$body || $request->getHeaderOverview('Content-Type', true) !== 'application/x-www-form-urlencoded') {
- 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 doJoin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function doJoin(ConnectionInterface $socket)
{
$result = $socket->read();
if ($result === false) {
throw new \RuntimeException("Async call failed: server connection lost", 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"
Further reading
Function math
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function math($command, $key, $amount)
{
$key = sha1($key);
$this->markCommandUsage('set');
$success = false;
- 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 handleMessages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function handleMessages()
{
$this->schedulerStatus->updateStatus();
/** @var Message[] $messages */
- 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 onMessage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function onMessage(ConnectionInterface $connection, $message)
{
$this->ttl = 0;
$this->buffer .= $message;
- 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 detectLogger
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function detectLogger()
{
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->backTraceLevel ? $this->backTraceLevel + 1: 100);
if (!$this->backTraceLevel) {
foreach ($trace as $level => $step) {
- 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 getMessageSizeLimit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getMessageSizeLimit()
{
if (!static::$maxPipeCapacity) {
$fileName = $this->getFilename(2);
posix_mkfifo($fileName, 0600);
- 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 modify
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function modify($command, $key, $flags, $expTime, $bytes, $requestedCas)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($config, Process $processService, LoggerInterface $logger, IpcAdapterInterface $ipcAdapter, DisciplineInterface $discipline)
Function listen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function listen($timeout)
{
$newSocket = @stream_socket_accept($this->socket, $timeout);
if ($newSocket) {
stream_set_blocking($newSocket, false);
- 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 connect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function connect()
{
if ($this->connected) {
throw new \LogicException("Connection already established");
}
- 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 fromStringOfHeaders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function fromStringOfHeaders($buffer, $allowCustomMethods)
{
if ("\r\n\r\n" !== substr($buffer, -4)) {
throw new \InvalidArgumentException(
'An EOM was not found at the end of request buffer'
- 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 getBannerFromModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getBannerFromModule(ContainerInterface $container, $serviceName)
{
/** @var ModuleManagerInterface $moduleManager */
$moduleManager = $container->get('ModuleManager');
$banner = null;
- 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 receiveAll
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function receiveAll()
{
$this->checkChannelAvailability($this->channelNumber);
$readSocket = [$this->ipc[$this->channelNumber]];
- 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 store
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function store($command, $key, $flags, $expTime)
{
$key = sha1($key);
$this->markCommandUsage('set');
$result = false;
- 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 decodeRegularRequestBody
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function decodeRegularRequestBody(Request $request, & $message)
{
$expectedBodyLength = $request->getHeaderOverview('Content-Length', false);
if (false === $expectedBodyLength) {
- 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 modify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function modify($command, $key, $flags, $expTime, $bytes, $requestedCas)
{
$cas = null;
$key = sha1($key);
$exists = false;
- 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"