Showing 6 of 8 total issues
Method buildForm
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
// Modify data before it is submitted/validated
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($options): void {
// Retrieve submitted content
Function process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function process(object $class): void
{
// Get class reflection data
$annotationClass = new \ReflectionClass($class);
- 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 filterScalarOrArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function filterScalarOrArray(mixed $propertyValue, array $stringFilters): string|array
{
if (
(!\is_array($propertyValue) && !\is_scalar($propertyValue))
|| \is_bool($propertyValue)
- 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 replaceArrayWithCallback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string|array $pattern,
callable $callback,
array $subject,
int $limit = -1,
int $flags = 0,
Method replaceWithCallback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string|array $pattern,
callable $callback,
string $subject,
int $limit = -1,
int $flags = 0,
Function __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
string|array $names,
string ...$moreNames,
) {
if (\is_string($names)) {
- 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"