appserver-io/webserver

View on GitHub

Showing 68 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...
        /**
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/EnvironmentVariableModule.php - About 7 hrs to fix

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
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/LocationModule.php - About 6 hrs to fix

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...
        /**
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/AccessModule.php - About 6 hrs to fix

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;
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/VirtualHostModule.php - About 4 hrs to fix

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();
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/CoreModule.php - About 4 hrs to fix

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();

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
 *

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();

Severity: Minor
Found in src/AppserverIo/WebServer/Modules/ProxyModule.php - About 3 hrs to fix

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();

Severity: Major
Found in src/AppserverIo/WebServer/Modules/ProxyModule.php - About 3 hrs to fix

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) {
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/AnalyticsModule.php - About 3 hrs to fix

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();

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
Severity: Major
Found in src/AppserverIo/WebServer/Modules/EnvironmentVariableModule.php - About 3 hrs to fix

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
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/Rewrite/Entities/Rule.php - About 2 hrs to fix

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";
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/FcgiModule.php - About 2 hrs to fix

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();
Severity: Major
Found in src/AppserverIo/WebServer/Modules/CoreModule.php - About 2 hrs to fix

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...
        /**
Severity: Major
Found in src/AppserverIo/WebServer/Modules/EnvironmentVariableModule.php - About 2 hrs to fix

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;
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/RewriteModule.php - About 2 hrs to fix

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

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) {
Severity: Minor
Found in src/AppserverIo/WebServer/Modules/Rewrite/Entities/Rule.php - About 2 hrs to fix

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
Severity: Major
Found in src/AppserverIo/WebServer/Modules/AutoIndexModule.php - About 2 hrs to fix
Severity
Category
Status
Source
Language