artur-graniszewski/ZEUS-for-PHP

View on GitHub

Showing 95 of 95 total issues

File MimeType.php has 1006 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Zeus\ServerService\Http;

class MimeType
Severity: Major
Found in src/Zeus/ServerService/Http/MimeType.php - About 2 days to fix

    File Message.php has 574 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Zeus\ServerService\Memcache\Message;
    
    use Zend\Cache\Storage\AvailableSpaceCapableInterface;
    Severity: Major
    Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 1 day to fix

      File Scheduler.php has 387 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Zeus\Kernel\ProcessManager;
      
      use Zend\EventManager\EventInterface;
      Severity: Minor
      Found in src/Zeus/Kernel/ProcessManager/Scheduler.php - About 5 hrs to fix

        Message has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        final class Message implements MessageComponentInterface, HeartBeatMessageInterface
        {
            const COMMAND_LINE = 1;
            const DATA_LINE = 2;
        
        Severity: Minor
        Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 5 hrs to fix

          File Message.php has 374 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Zeus\ServerService\Http\Message;
          
          use Zeus\ServerService\Http\Message\Helper\ChunkedEncoding;
          Severity: Minor
          Found in src/Zeus/ServerService/Http/Message/Message.php - About 5 hrs to fix

            Function startPlugins has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function startPlugins(ContainerInterface $container, $service, array $config)
                {
                    foreach ($config as $index => $value) {
                        if (is_int($index)) {
                            if (is_object($value) && $value instanceof ListenerAggregateInterface) {
            Severity: Minor
            Found in src/Zeus/Kernel/ProcessManager/Helper/PluginFactory.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 parseRequestFileData has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function parseRequestFileData(Request $request)
                {
                    $body = $request->getContent();
                    $boundaryLine = $this->getMultipartDataBoundary($request);
            
            
            Severity: Minor
            Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.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 onMessage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function onMessage(ConnectionInterface $connection, $message)
                {
                    if ($connection instanceof FlushableConnectionInterface) {
                        $connection->setWriteBufferSize(0);
                    }
            Severity: Minor
            Found in src/Zeus/ServerService/Async/Message/Message.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

            Scheduler has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            final class Scheduler implements EventsCapableInterface
            {
                use LoggerHelper;
                use EventManager;
                use PluginRegistry;
            Severity: Minor
            Found in src/Zeus/Kernel/ProcessManager/Scheduler.php - About 3 hrs to fix

              Method stats has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function stats()
                  {
                      $stats = [
                          'pid' => getmypid(),
                          'uptime' => time() - $_SERVER['REQUEST_TIME'],
              Severity: Major
              Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 3 hrs to fix

                Function onProcessLoop has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function onProcessLoop(SchedulerEvent $event)
                    {
                        $exception = null;
                
                        try {
                Severity: Minor
                Found in src/Zeus/ServerService/Shared/Networking/SocketEventSubscriber.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 decodeChunkedRequestBody has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function decodeChunkedRequestBody(Request $request, & $message)
                    {
                        $this->buffer .= $message;
                
                        while (true) {
                Severity: Minor
                Found in src/Zeus/ServerService/Http/Message/Helper/ChunkedEncoding.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

                ProcessState has 23 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ProcessState
                {
                    /**
                     * Process is waiting.
                     */
                Severity: Minor
                Found in src/Zeus/Kernel/ProcessManager/Status/ProcessState.php - About 2 hrs to fix

                  Method onMessage has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function onMessage(ConnectionInterface $connection, $message)
                      {
                          if ($connection instanceof FlushableConnectionInterface) {
                              $connection->setWriteBufferSize(0);
                          }
                  Severity: Major
                  Found in src/Zeus/ServerService/Async/Message/Message.php - About 2 hrs to fix

                    Message has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Message implements MessageComponentInterface, HeartBeatMessageInterface
                    {
                        use ChunkedEncoding;
                        use RegularEncoding;
                        use FileUpload;
                    Severity: Minor
                    Found in src/Zeus/ServerService/Http/Message/Message.php - About 2 hrs to fix

                      Config has 21 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Config extends \Zend\Config\Config implements ConfigInterface
                      {
                          /**
                           * Config constructor.
                           * @param mixed[]|ConfigInterface $fromArray
                      Severity: Minor
                      Found in src/Zeus/Kernel/ProcessManager/Config.php - About 2 hrs to fix

                        Manager has 21 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        final class Manager
                        {
                            use EventManager;
                            use PluginRegistry;
                        
                        Severity: Minor
                        Found in src/Zeus/ServerService/Manager.php - About 2 hrs to fix

                          Function join has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function join($callId)
                              {
                                  $callIds = is_array($callId) ? $callId : [$callId];
                          
                                  $results = [];
                          Severity: Minor
                          Found in src/Zeus/ServerService/Async/AsyncPlugin.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 getStatus has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getStatus(ServerServiceInterface $service)
                              {
                                  $this->scheduler = $service->getScheduler();
                          
                                  $console = $this->console;
                          Severity: Minor
                          Found in src/Zeus/Kernel/ProcessManager/Status/SchedulerStatusView.php - About 2 hrs to fix

                            Method parseRequestFileData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function parseRequestFileData(Request $request)
                                {
                                    $body = $request->getContent();
                                    $boundaryLine = $this->getMultipartDataBoundary($request);
                            
                            
                            Severity: Minor
                            Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language