Showing 34 of 34 total issues
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 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 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 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 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
Function updateResponse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function updateResponse(ApplicationInterface $application, RequestInterface $request, ResponseInterface $response, string $viewPath, string $action, ViewItemCollectionInterface $viewItems): void
{
$viewRenderers = $application->getViewRenderers();
if (count($viewRenderers) === 0) {
throw new MissingViewRendererException('No view renderer was added to application.');
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return new RouteMatch($this->getControllerClassName(), $action, $parameters);
Avoid too many return
statements within this method. Open
return true;
Function findActionMethod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function findActionMethod(ReflectionClass $reflectionClass, string $action, bool $isCaseSensitive): ?ReflectionMethod
{
// Methods can not begin with a digit, prepend underscore to make it possible.
if (strlen($action) > 0 && ctype_digit($action[0])) {
$action = '_' . $action;
- 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
Function handleResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleResult(mixed $result, string $actionName): void
{
$application = $this->getApplication();
$request = $this->getRequest();
$response = $this->getResponse();
- 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
Function splitPath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function splitPath(string $path): array
{
if ($path === '') {
return [];
}
- 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"