Field
has 26 functions (exceeds 10 allowed). Consider refactoring. Open
class Field implements FieldInterface
{
/**
* @var int
*/
Function getPropertyConfig
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED): array
{
$fieldMapping = ['type' => $this->getType()];
switch ($this->getType()) {
- 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 checkAnalyzer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkAnalyzer($property, $expectedAnalyzer): bool
{
$isAnalyzerCorrect = true;
if ($property['type'] === self::FIELD_TYPE_TEXT || $property['type'] === self::FIELD_TYPE_KEYWORD) {
- 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 getFieldAnalyzers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getFieldAnalyzers(): array
{
$analyzers = [];
// By default, texts are indexed with "keyword" analyzer which is a 'noop' analyzer.
- 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"