src/AppserverIo/WebServer/ConnectionHandlers/HttpConnectionHandler.php
Function handle
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
public function handle(SocketInterface $connection, WorkerInterface $worker)
{
// register shutdown handler once to avoid strange memory consumption problems
$this->registerShutdown();
- Read upRead up
- Create a ticketCreate a ticket
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
File HttpConnectionHandler.php
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* \AppserverIo\WebServer\ConnectionHandlers\HttpConnectionHandler
*
- Create a ticketCreate a ticket
Method handle
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handle(SocketInterface $connection, WorkerInterface $worker)
{
// register shutdown handler once to avoid strange memory consumption problems
$this->registerShutdown();
- Create a ticketCreate a ticket
HttpConnectionHandler
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class HttpConnectionHandler implements ConnectionHandlerInterface
{
/**
* Defines the read length for http connections
- Create a ticketCreate a ticket
Method shutdown
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function shutdown()
{
// get refs to local vars
$requestContext = $this->getRequestContext();
$connection = $this->getConnection();
- Create a ticketCreate a ticket
Method logAccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function logAccess()
{
// get object refs to local var
$request = $this->getParser()->getRequest();
$response = $this->getParser()->getResponse();
- Create a ticketCreate a ticket
Function shutdown
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
public function shutdown()
{
// get refs to local vars
$requestContext = $this->getRequestContext();
$connection = $this->getConnection();
- Read upRead up
- Create a ticketCreate a ticket
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"