artur-graniszewski/ZEUS-for-PHP

View on GitHub

Showing 95 of 95 total issues

Function checkBodyHeaders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkBodyHeaders(Request $request, $boundaryLine, $pos)
    {
        // initialize data block
        if (!isset($this->currentFormDataInfo['tmp_name'])) {
            // file not opened yet, check the boundary
Severity: Minor
Found in src/Zeus/ServerService/Http/Message/Helper/FileUpload.php - About 55 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 enableCompressionIfSupported has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function enableCompressionIfSupported(& $buffer)
    {
        $this->compressionHandler = null;

        if (!function_exists('deflate_init') || !$this->isBodyAllowedInResponse($this->request)) {
Severity: Minor
Found in src/Zeus/ServerService/Http/Message/Message.php - About 55 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 dispatch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function dispatch(Request $request, Response $response)
    {
        $path = $request->getUri()->getPath();

        $code = Response::STATUS_CODE_200;
Severity: Minor
Found in src/Zeus/ServerService/Http/Dispatcher/StaticFileDispatcher.php - About 55 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 parseRequestPostData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseRequestPostData(Request $request)
    {
        $body = $request->getContent();

        if (!$body || $request->getHeaderOverview('Content-Type', true) !== 'application/x-www-form-urlencoded') {
Severity: Minor
Found in src/Zeus/ServerService/Http/Message/Helper/PostData.php - About 55 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 doJoin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function doJoin(ConnectionInterface $socket)
    {
        $result = $socket->read();
        if ($result === false) {
            throw new \RuntimeException("Async call failed: server connection lost", 1);
Severity: Minor
Found in src/Zeus/ServerService/Async/AsyncPlugin.php - About 55 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 math has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function math($command, $key, $amount)
    {
        $key = sha1($key);
        $this->markCommandUsage('set');
        $success = false;
Severity: Minor
Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 55 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 handleMessages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function handleMessages()
    {
        $this->schedulerStatus->updateStatus();

        /** @var Message[] $messages */
Severity: Minor
Found in src/Zeus/Kernel/ProcessManager/Scheduler.php - About 55 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 onMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function onMessage(ConnectionInterface $connection, $message)
    {
        $this->ttl = 0;
        $this->buffer .= $message;
Severity: Minor
Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 45 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 detectLogger has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function detectLogger()
    {
        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->backTraceLevel ? $this->backTraceLevel + 1: 100);
        if (!$this->backTraceLevel) {
            foreach ($trace as $level => $step) {
Severity: Minor
Found in src/Zeus/ServerService/Shared/Logger/ExtraLogProcessor.php - About 45 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 getMessageSizeLimit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMessageSizeLimit()
    {
        if (!static::$maxPipeCapacity) {
            $fileName = $this->getFilename(2);
            posix_mkfifo($fileName, 0600);
Severity: Minor
Found in src/Zeus/Kernel/IpcServer/Adapter/FifoAdapter.php - About 45 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

Method modify has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected function modify($command, $key, $flags, $expTime, $bytes, $requestedCas)
Severity: Minor
Found in src/Zeus/ServerService/Memcache/Message/Message.php - About 45 mins to fix

    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function __construct($config, Process $processService, LoggerInterface $logger, IpcAdapterInterface $ipcAdapter, DisciplineInterface $discipline)
    Severity: Minor
    Found in src/Zeus/Kernel/ProcessManager/Scheduler.php - About 35 mins to fix

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

          public function listen($timeout)
          {
              $newSocket = @stream_socket_accept($this->socket, $timeout);
              if ($newSocket) {
                  stream_set_blocking($newSocket, false);
      Severity: Minor
      Found in src/Zeus/Kernel/Networking/SocketServer.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 connect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function connect()
          {
              if ($this->connected) {
                  throw new \LogicException("Connection already established");
              }
      Severity: Minor
      Found in src/Zeus/Kernel/IpcServer/Adapter/SharedMemoryAdapter.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 fromStringOfHeaders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function fromStringOfHeaders($buffer, $allowCustomMethods)
          {
              if ("\r\n\r\n" !== substr($buffer, -4)) {
                  throw new \InvalidArgumentException(
                      'An EOM was not found at the end of request buffer'
      Severity: Minor
      Found in src/Zeus/ServerService/Http/Message/Request.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 getBannerFromModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getBannerFromModule(ContainerInterface $container, $serviceName)
          {
              /** @var ModuleManagerInterface $moduleManager */
              $moduleManager = $container->get('ModuleManager');
              $banner = null;
      Severity: Minor
      Found in src/Zeus/ServerService/Shared/Logger/LoggerFactory.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 receiveAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function receiveAll()
          {
              $this->checkChannelAvailability($this->channelNumber);
      
              $readSocket = [$this->ipc[$this->channelNumber]];
      Severity: Minor
      Found in src/Zeus/Kernel/IpcServer/Adapter/SocketAdapter.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 store has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function store($command, $key, $flags, $expTime)
          {
              $key = sha1($key);
              $this->markCommandUsage('set');
              $result = 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

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

          public function decodeRegularRequestBody(Request $request, & $message)
          {
              $expectedBodyLength = $request->getHeaderOverview('Content-Length', false);
      
              if (false === $expectedBodyLength) {
      Severity: Minor
      Found in src/Zeus/ServerService/Http/Message/Helper/RegularEncoding.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

      Severity
      Category
      Status
      Source
      Language