Showing 68 of 68 total issues
Method apply
has 51 lines of code (exceeds 25 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
- Create a ticketCreate a ticket
Method process
has 47 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
Method process
has 46 lines of code (exceeds 25 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;
- Create a ticketCreate a ticket
Method process
has 45 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
Function lookup
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function lookup($requestUrl)
{
// set targetUrl to null by default
$targetUrl = null;
// set base to local ref
- 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 formatResponse
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatResponse($stdout)
{
// split the header from the body. Split on \n\n.
$splitter = "\r\n\r\n";
- Create a ticketCreate a ticket
Method process
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(RequestInterface $request, ResponseInterface $response, RequestContextInterface $requestContext, $hook)
{
try {
// 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 13 (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 13 (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 13 (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) {
- 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 39 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) {
return;
- Create a ticketCreate a ticket
Method prepareEnvironment
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareEnvironment(RequestInterface $request, RequestContextInterface $requestContext)
{
// prepare the Fast-CGI environment variables
$environment = array(
- Create a ticketCreate a ticket
Method __construct
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($operand, $action, $flags = array())
{
// Fill the default values for our members here
$this->allowedTypes = array(
'regex',
- Create a ticketCreate a ticket
Function lookup
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function lookup($requestUri)
{
// set targetUrl to null by default
$targetUrl = null;
// set base to local ref
- 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 34 lines of code (exceeds 25 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) {
- Create a ticketCreate a ticket
Method lookup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lookup($requestUrl)
{
// set targetUrl to null by default
$targetUrl = null;
// set base to local ref
- Create a ticketCreate a ticket
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($conditionString, $target, $flagString)
{
// Set the raw string properties and append our default operand to the condition string
$this->conditionString = $conditionString;
$conditionString .= $this->getDefaultOperand();
- Create a ticketCreate a ticket
Function matches
has a Cognitive Complexity of 11 (exceeds 5 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;
- 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 __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($conditionString, $target, $flagString)
{
// Set the raw string properties and append our default operand to the condition string
$this->conditionString = $conditionString;
$conditionString .= $this->getDefaultOperand();
- 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 checkInputParameters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function checkInputParameters(array $params)
{
// we only check if we know the requirements
if (isset($this->requiredParameters[$params['t']])) {
foreach ($this->requiredParameters[$params['t']] as $requirement) {
- 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"