Showing 29 of 34 total issues
AbstractRequest
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractRequest implements RequestInterface
{
/**
* Constructs the request.
*
AbstractApplication
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractApplication implements ApplicationInterface
{
use CustomItemsTrait;
/**
Function actionMethodParameterMatchesParameter
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private static function actionMethodParameterMatchesParameter(ReflectionParameter $reflectionParameter, string $parameter, mixed &$adjustedParameter = null): bool
{
$adjustedParameter = $parameter;
$reflectionParameterType = $reflectionParameter->getType();
- Read upRead up
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 AbstractApplication.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is a part of the bluemvc-core package.
*
Method actionMethodParameterMatchesParameter
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function actionMethodParameterMatchesParameter(ReflectionParameter $reflectionParameter, string $parameter, mixed &$adjustedParameter = null): bool
{
$adjustedParameter = $parameter;
$reflectionParameterType = $reflectionParameter->getType();
Method matches
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function matches(RequestInterface $request): ?RouteMatchInterface
{
$path = $request->getUrl()->getPath();
$directoryParts = $path->getDirectoryParts();
$filename = $path->getFilename() ?? '';
Function actionMethodMatchesParameters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function actionMethodMatchesParameters(ReflectionMethod $reflectionMethod, array $parameters, array &$adjustedParameters = null): bool
{
$parametersCount = count($parameters);
if ($reflectionMethod->getNumberOfParameters() < $parametersCount) {
- Read upRead up
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 __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
UrlInterface $url,
MethodInterface $method,
HeaderCollectionInterface $headers,
ParameterCollectionInterface $queryParameters,
ParameterCollectionInterface $formParameters,
Function matches
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function matches(RequestInterface $request): ?RouteMatchInterface
{
$path = $request->getUrl()->getPath();
$directoryParts = $path->getDirectoryParts();
$filename = $path->getFilename() ?? '';
- Read upRead up
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 setCookieValue
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setCookieValue(string $name, string $value, ?DateTimeInterface $expiry = null, ?UrlPathInterface $path = null, ?HostInterface $domain = null, bool $isSecure = false, bool $isHttpOnly = false): void
Method setCookieValue
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setCookieValue(string $name, string $value, ?DateTimeInterface $expiry = null, ?UrlPathInterface $path = null, ?HostInterface $domain = null, bool $isSecure = false, bool $isHttpOnly = false): void;
Method updateResponse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateResponse(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response, string $viewPath, string $action, ViewItemCollectionInterface $viewItems): void;
Function doRun
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function doRun(RequestInterface $request, ResponseInterface $response): void
{
$throwable = null;
foreach ($this->plugins as $plugin) {
- Read upRead up
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 updateResponse
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function updateResponse(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response, string $viewPath, string $action, ViewItemCollectionInterface $viewItems): void
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $value, ?DateTimeInterface $expiry = null, ?UrlPathInterface $path = null, ?HostInterface $domain = null, bool $isSecure = false, bool $isHttpOnly = false)
Method processRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function processRequest(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response, string $action, array $parameters = []): void
Method tryInvokeActionMethod
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function tryInvokeActionMethod(string $action, array $parameters, bool $isCaseSensitive, callable $resultHandler, ?bool &$hasFoundActionMethod = null): bool
Method renderView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
abstract public function renderView(ApplicationInterface $application, RequestInterface $request, FilePathInterface $viewFile, mixed $model = null, ?ViewItemCollectionInterface $viewItems = null): string;
Method renderView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function renderView(ApplicationInterface $application, RequestInterface $request, FilePathInterface $viewFile, mixed $model = null, ?ViewItemCollectionInterface $viewItems = null): string;
Method processRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function processRequest(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response, string $action, array $parameters = []): void;