artur-graniszewski/ZEUS-for-PHP

View on GitHub

Showing 95 of 95 total issues

Function sendResponse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendResponse($buffer)
    {
        $connection = $this->connection;

        if (!$this->headersSent) {
Severity: Minor
Found in src/Zeus/ServerService/Http/Message/Message.php - About 35 mins 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 modify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function modify($command, $key, $flags, $expTime, $bytes, $requestedCas)
    {
        $cas = null;
        $key = sha1($key);
        $exists = false;
Severity: Minor
Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 35 mins 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

Avoid too many return statements within this method.
Open

                return $this;
Severity: Major
Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return;
    Severity: Major
    Found in src/Zeus/ServerService/Async/Message/Message.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return false;
      Severity: Major
      Found in src/Zeus/ServerService/Http/Message/Message.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $this;
        Severity: Major
        Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return;
          Severity: Major
          Found in src/Zeus/ServerService/Async/Message/Message.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return;
            Severity: Major
            Found in src/Zeus/ServerService/Http/Dispatcher/StaticFileDispatcher.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in src/Zeus/ServerService/Http/Message/Message.php - About 30 mins to fix

                Function receive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function receive(& $success = false)
                    {
                        $message = '';
                        $success = false;
                        $this->checkChannelAvailability($this->channelNumber);
                Severity: Minor
                Found in src/Zeus/Kernel/IpcServer/Adapter/SocketAdapter.php - About 25 mins 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 read has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function read($ending = false)
                    {
                        if (!$this->isReadable()) {
                            throw new \LogicException("Stream is not readable");
                        }
                Severity: Minor
                Found in src/Zeus/Kernel/Networking/FileStream.php - About 25 mins 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 deleteTemporaryFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function deleteTemporaryFiles()
                    {
                        foreach ($this->requestFilesInfo as $formData) {
                            foreach ($formData as $file) {
                                if (file_exists($file['tmp_name'])) {
                Severity: Minor
                Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.php - About 25 mins 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 receiveAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function receiveAll()
                    {
                        $channelNumber = $this->channelNumber;
                
                        $this->checkChannelAvailability($channelNumber);
                Severity: Minor
                Found in src/Zeus/Kernel/IpcServer/Adapter/FifoAdapter.php - About 25 mins 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 sendHeaders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function sendHeaders(& $buffer)
                    {
                        $connection = $this->connection;
                        $this->request->setMetadata('remoteAddress', $connection->getRemoteAddress());
                        $response = $this->response;
                Severity: Minor
                Found in src/Zeus/ServerService/Http/Message/Message.php - About 25 mins 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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function run(\Closure $callable)
                    {
                        if (!class_exists('Opis\Closure\SerializableClosure')) {
                            throw new \LogicException("Async call failed: serialization module is missing");
                        }
                Severity: Minor
                Found in src/Zeus/ServerService/Async/AsyncPlugin.php - About 25 mins 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

                Severity
                Category
                Status
                Source
                Language