Showing 11 of 18 total issues
Method __invoke
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(Request $request, Response $response, callable $next)
{
$this->log('start');
if ($this->isDocumentationRoute($request)) {
Function parseQueryString
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function parseQueryString(Request $request)
{
$params = [];
$queryString = $request->getUri()->getQuery();
$setList = explode('&', $queryString);
- 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 __invoke
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(Request $request, Response $response, callable $next)
{
$this->log('start');
if ($this->isDocumentationRoute($request)) {
- 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 getSecurity
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getSecurity(array $operation)
{
$securityRequirement = [];
if (isset($operation['security'])) {
- 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 getParser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getParser(Request $request, array $parameter, $route)
{
switch ($parameter['in']) {
case 'query':
$parser = new Parser\Query($request, $parameter);
- 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 resolveRefs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function resolveRefs(array $chunk)
{
$resolvedChunk = [];
foreach ($chunk as $key => $value) {
if ($key === '$ref') {
- 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 getDelimiter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getDelimiter(array $parameter)
{
$collectionFormat = 'csv';
if (isset($parameter['collectionFormat'])) {
$collectionFormat = $parameter['collectionFormat'];
- 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 getValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getValue()
{
if ($this->parameter['type'] === 'file') {
$files = $this->request->getUploadedFiles();
if (!array_key_exists($this->parameter['name'], $files)) {
- 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 (array) $value;
Avoid too many return
statements within this method. Open
return $this->explodeValue($value, $this->parameter);
Function getParameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getParameters(array $pathItem, array $operation)
{
$uniqueParameters = [];
if (array_key_exists('parameters', $pathItem)) {
foreach ($pathItem['parameters'] as $parameter) {
- 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"