Showing 66 of 68 total issues
Function process
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// In php an interface is, by definition, a fixed contract. It is immutable.
// So we have to declair the right ones afterwards...
/**
- 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
Function process
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
/**
* @var $request \AppserverIo\Psr\HttpMessage\RequestInterface
- 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
Function process
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// In php an interface is, by definition, a fixed contract. It is immutable.
// So we have to declair the right ones afterwards...
/**
- 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
Function process
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// if false hook is comming do nothing
if (ModuleHooks::REQUEST_POST !== $hook) {
return;
- 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
Function populateRequestContext
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function populateRequestContext(RequestContextInterface $requestContext)
{
// get local refs
$serverContext = $this->getServerContext();
- 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
Function handle
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. 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
<?php
/**
* \AppserverIo\WebServer\ConnectionHandlers\HttpConnectionHandler
*
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// get server context to local ref
$serverContext = $this->getServerContext();
- 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
Method process
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// get server context to local ref
$serverContext = $this->getServerContext();
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
try {
// if false hook is coming do nothing
if (ModuleHooks::RESPONSE_POST !== $hook) {
- 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
Method handle
has 87 lines of code (exceeds 25 allowed). Consider refactoring. 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
Method init
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(ServerContextInterface $serverContext)
{
// We have to throw a ModuleException on failure, so surround the body with a try...catch block
try {
// Save the server context for later re-use
- Create a ticketCreate a ticket
Function apply
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function apply(RequestContextInterface $requestContext, ResponseInterface $response, array $serverBackreferences)
{
// First of all we have to resolve the target string with the backreferences of the matching condition
// Separate the keys from the values so we can use them in str_replace
// And also mix in the server's backreferences for good measure
- 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
Function formatResponse
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function formatResponse($stdout)
{
// split the header from the body. Split on \n\n.
$splitter = "\r\n\r\n";
- 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
Method populateRequestContext
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function populateRequestContext(RequestContextInterface $requestContext)
{
// get local refs
$serverContext = $this->getServerContext();
- Create a ticketCreate a ticket
Method process
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// In php an interface is, by definition, a fixed contract. It is immutable.
// So we have to declair the right ones afterwards...
/**
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
// if false hook is coming do nothing
if (ModuleHooks::REQUEST_POST !== $hook) {
return;
- 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
HttpConnectionHandler
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class HttpConnectionHandler implements ConnectionHandlerInterface
{
/**
* Defines the read length for http connections
- Create a ticketCreate a ticket
Function matches
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function matches()
{
// We will iterate over all conditions (and the or-combined condition groups) and if there is a non-matching
// condition or condition group we will fail
foreach ($this->sortedConditions as $sortedCondition) {
- 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
Method process
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
/**
* @var $request \AppserverIo\Psr\HttpMessage\RequestInterface
- Create a ticketCreate a ticket