Showing 26 of 26 total issues
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
SitemapItemInterfaceFactory $itemFactory,
ConfigReader $configReader,
CustomEntityRepositoryInterface $customEntityRepository,
SearchCriteriaBuilder $searchCriteriaBuilder,
UrlInterface $urlBuilder
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Template\Context $context,
Registry $registry,
ImageFactory $imageFactory,
?CustomEntity $customEntity,
array $data = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Context $context,
Builder $attributeBuilder,
ForwardFactory $resultForwardFactory,
DataViewModel $dataViewModel,
?FormData $formDataSerializer
Function get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function get($entityId, ?int $storeId = null, bool $forceReload = false): ?CustomEntityInterface
{
$cacheKey = $storeId ?? 'all';
if (!isset($this->instances[$entityId][$cacheKey]) || $forceReload === 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 getStoreIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getStoreIds(): ?array
{
if (!$this->hasStoreIds()) {
$storeIds = [];
$websiteIds = $this->getWebsiteIds();
- 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 customEntityAttribute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function customEntityAttribute(
CustomEntityInterface $customEntity,
string $attributeHtml,
string $attributeName
): ?string {
- 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"