Function getBehaviors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getBehaviors(): array
{
if ($this->behaviors === null) {
// find behaviors in composer.lock file
$lock = $this->findComposerLock();
- 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 loadBehaviorsFromLockFile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function loadBehaviorsFromLockFile(SplFileInfo $composerLock): array
{
$behaviors = [];
$json = json_decode($composerLock->getContents(), true);
- 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 loadBehavior
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function loadBehavior(array $package): ?array
{
if (isset($package['type']) && $package['type'] == self::BEHAVIOR_PACKAGE_TYPE) {
// find propel behavior information
if (isset($package['extra'])) {
- 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 getBehavior
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getBehavior(string $name): string
{
if (strpos($name, '\\') !== false) {
$class = $name;
} else {
- 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"