jaroslavtyc/drd-plus-therugist-spells

View on GitHub
DrdPlus/Theurgist/Spells/ToFlatArrayTrait.php

Summary

Maintainability
A
35 mins
Test Coverage

Showing 2 of 2 total issues

Function toFlatArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

protected function toFlatArray(array $items): array
{
$flat = [];
foreach ($items as $item) {
if (\is_array($item)) {
Severity: Minor
Found in DrdPlus/Theurgist/Spells/ToFlatArrayTrait.php - About 35 mins to fix

The method toFlatArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
$flat[] = $item;
}

There are no issues that match your filters.

Category
Status