Showing 26 of 26 total issues
Function processField
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function processField(\ReflectionProperty $prop, Builder $builder)
{
$type = null;
$count = null;
foreach ($this->reader->getPropertyAnnotations($prop) as $annot) {
- 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 addField
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addField($name, Annotations\FieldInterface $annot, $count, Builder $builder)
{
if ($annot instanceof Annotations\Fake) {
$builder->fake($name, $annot->type, $annot->args);
} elseif ($annot instanceof Annotations\Link) {
- 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 addFieldOfType
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function addFieldOfType($field, $type, $multiple, array $options, Builder $builder)
Avoid too many return
statements within this method. Open
return false;
Function checkState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function checkState($field)
{
if (is_int($field)) {
$this->preparePositional();
}
- 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 fill
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function fill(Builder $builder)
{
if (Util::isUserClass($builder->getClass())) {
$refl = new \ReflectionClass($builder->getClass());
$filter = \ReflectionProperty::IS_PRIVATE |
- 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"