Showing 18 of 197 total issues

Function getMimeType has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMimeType($file)
    {
        static $mimes = null;
        $info = pathinfo($file);
        if (isset($info['extension'])) {
Severity: Minor
Found in src/Process/Http/FileToResponse.php - About 1 hr 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 __invoke has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function __invoke(ServerRequestInterface $request, ResponseInterface $response, UnitTrackerInterface $unitTracker)
    {
        $filePath = $unitTracker->next();
        $fileName = basename($filePath);

Severity: Minor
Found in src/Process/Http/FileToResponse.php - About 1 hr to fix

    Method __invoke has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __invoke(ServerRequestInterface $request, UnitTrackerInterface $unitTracker)
        {
            // Decode body
            $method = $request->getMethod();
            if ($method === 'POST') {
    Severity: Minor
    Found in src/Process/Http/RequestBodyParser.php - About 1 hr to fix

      Function __invoke has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          function __invoke(ServerRequestInterface $request, ResponseInterface $response, UnitTrackerInterface $unitTracker)
          {
              $filePath = $unitTracker->next();
              $fileName = basename($filePath);
      
      
      Severity: Minor
      Found in src/Process/Http/FileToResponse.php - About 1 hr 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 __invoke has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __invoke(ServerRequestInterface $request, UnitTrackerInterface $unitTracker)
          {
              // Decode body
              $method = $request->getMethod();
              if ($method === 'POST') {
      Severity: Minor
      Found in src/Process/Http/RequestBodyParser.php - About 1 hr 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 getContentType has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getContentType(ServerRequestInterface $request): string
          {
              $contentTypes = $request->getHeader("Content-Type") ?? [];
      
              $parsedContentType = 'application/json';
      Severity: Minor
      Found in src/Process/HttpBodyToEntities.php - About 1 hr to fix

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

            public function __construct($message = '', ?int $code = null, ?Throwable $previous = null, ?int $status = 500, ?array $params = [], ?array $solutions = [])
        Severity: Minor
        Found in src/Exception.php - About 45 mins to fix

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

              public function __construct($message = '', ?int $code = null, ?Throwable $previous = null, ?int $status = 404, ?array $params = [], ?array $solutions = [])
          Severity: Minor
          Found in src/Exception/ResourceNotFoundException.php - About 45 mins to fix

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

                    ServerRequestInterface $request, 
                    ResponseInterface $response, 
                    StreamFactoryInterface $streamFactory, 
                    LoggerInterface $logger,
                    ObjectMapper $objectMapperJson,
            Severity: Minor
            Found in src/Process/Http/ResponseBodyEncoder.php - About 45 mins to fix

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

                  public function __construct($message = '', ?int $code = null, ?Throwable $previous = null, ?int $status = 500, ?array $params = [], ?array $solutions = [])
              Severity: Minor
              Found in src/Exception/UnhandledException.php - About 45 mins to fix

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

                    protected function generateException($message = '', ?int $code = null, ?Throwable $previous = null, ?array $params = [], ?array $solutions = []): Throwable
                Severity: Minor
                Found in src/Process/Entity/ReadEntity.php - About 35 mins to fix

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

                      protected function generateException($message = '', ?int $code = null, ?Throwable $previous = null, ?array $params = [], ?array $solutions = []): Throwable
                  Severity: Minor
                  Found in src/Process/Entity/UpdateEntity.php - About 35 mins to fix

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

                        public function __invoke(RequestInterface $request, UnitTrackerInterface $unitTracker)
                        {
                            $uri = $request->getUri();
                            $requestPath = $uri->getPath();
                            $method = $request->getMethod();
                    Severity: Minor
                    Found in src/Process/Http/IfPathAndMethodIs.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 getIpAddress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getIpAddress(RequestInterface $request): string
                        {
                            if (! ($request instanceof ServerRequestInterface)) {
                                return "-";
                            }
                    Severity: Minor
                    Found in src/Process/Http/AccessLog.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 $server['HTTP_FORWARDED'];
                    Severity: Major
                    Found in src/Process/Http/AccessLog.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $server['REMOTE_ADDR'];
                      Severity: Major
                      Found in src/Process/Http/AccessLog.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $server['HTTP_FORWARDED_FOR'];
                        Severity: Major
                        Found in src/Process/Http/AccessLog.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return $server['HTTP_X_CLUSTER_CLIENT_IP'];
                          Severity: Major
                          Found in src/Process/Http/AccessLog.php - About 30 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language