Showing 66 of 68 total issues
Method shutdown
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function shutdown()
{
// get refs to local vars
$requestContext = $this->getRequestContext();
$connection = $this->getConnection();
- Create a ticketCreate a ticket
Method process
has 29 lines of code (exceeds 25 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) {
- Create a ticketCreate a ticket
Method lookup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lookup($requestUri)
{
// set targetUrl to null by default
$targetUrl = null;
// set base to local ref
- Create a ticketCreate a ticket
Method logAccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function logAccess()
{
// get object refs to local var
$request = $this->getParser()->getRequest();
$response = $this->getParser()->getResponse();
- Create a ticketCreate a ticket
Method process
has 28 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 shutdown
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. 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"
Further reading
Method matches
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function matches()
{
// Switching between different actions we have to take.
// Using an if cascade as it seems to be faster than switch...case
$result = false;
- Create a ticketCreate a ticket
Method process
has 26 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 declare the right ones afterwards...
/**
- Create a ticketCreate a ticket
Method process
has 26 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 declare the right ones afterwards...
- Create a ticketCreate a ticket
Function process
has a Cognitive Complexity of 9 (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 declare 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 9 (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 declare 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 initCerts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function initCerts()
{
// get stream context to enhance it
$streamContext = $this->getServerContext()->getStreamContext();
// get logger
- 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
Avoid deeply nested control flow statements. Open
if (substr($paramValue, 0, 1) !== "/") {
$paramValue = getcwd() . DIRECTORY_SEPARATOR . $paramValue;
}
- Create a ticketCreate a ticket
Function prepareOperandAdditions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareOperandAdditions()
{
foreach ($this->htaccessAdditions as $addition) {
// The string has to start with an addition (any negating ! was cut of before)
if (strpos($this->action, $addition) === 0) {
- 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 getFastCgiClient
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getFastCgiClient(RequestContextInterface $requestContext, LoopInterface $loop)
{
// initialize default host/port/DNS server
$host = FcgiModule::DEFAULT_FAST_CGI_IP;
- 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 getBackreferences
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getBackreferences()
{
// Iterate over all conditions and collect their backreferences
$backreferences = array();
foreach ($this->sortedConditions as $key => $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
Function process
has a Cognitive Complexity of 7 (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 prepareEnvironment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareEnvironment(RequestInterface $request, RequestContextInterface $requestContext)
{
// prepare the Fast-CGI environment variables
$environment = array(
- 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 resolveConditions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function resolveConditions(array $backreferences)
{
// Iterate over all conditions and resolve them too
foreach ($this->sortedConditions as $key => $sortedCondition) {
// If we got an array we have to iterate over it separately, but be aware they are or-combined
- 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"