src/Model/Validator/FilterValidator.php
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(
GeneratorConfiguration $generatorConfiguration,
FilterInterface $filter,
PropertyInterface $property,
array $filterOptions = [],
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
GeneratorConfiguration $generatorConfiguration,
FilterInterface $filter,
PropertyInterface $property,
array $filterOptions = [],
?TransformingFilterInterface $transformingFilter = null,
Function validateFilterCompatibilityWithBaseType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private function validateFilterCompatibilityWithBaseType(FilterInterface $filter, PropertyInterface $property)
{
if (empty($filter->getAcceptedTypes()) || !$property->getType()) {
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"
Further reading
syntax error, unexpected ')', expecting variable (T_VARIABLE)
Open
Open
) {
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case 'boolean': return 'bool';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case 'integer': return 'int';
- Exclude checks
The CASE body must start on the line following the statement Open
Open
case 'number': return 'float';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case 'boolean': return 'bool';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case 'integer': return 'int';
- Exclude checks
Terminating statement must be on a line by itself Open
Open
case 'number': return 'float';
- Exclude checks
The DEFAULT body must start on the line following the statement Open
Open
default: return $jsonSchemaType;
- Exclude checks
Terminating statement must be on a line by itself Open
Open
default: return $jsonSchemaType;
- Exclude checks
Expected 0 spaces after opening bracket; newline found Open
Open
if (
- Exclude checks
Opening brace should be on a new line Open
Open
public function addTransformedCheck(TransformingFilterInterface $filter, PropertyInterface $property): self {
- Exclude checks
Closing brace must be on a line by itself Open
Open
case 'integer': return 'int';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case 'number': return 'float';
- Exclude checks
Closing brace must be on a line by itself Open
Open
case 'boolean': return 'bool';
- Exclude checks
Closing brace must be on a line by itself Open
Open
default: return $jsonSchemaType;
- Exclude checks