src/module-elasticsuite-catalog-optimizer/Model/Optimizer.php
Optimizer
has 26 functions (exceeds 10 allowed). Consider refactoring. Open
Open
class Optimizer extends \Magento\Framework\Model\AbstractModel implements OptimizerInterface, IdentityInterface
{
/**
* @var string
*/
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Smile\ElasticsuiteCatalogRule\Model\RuleFactory $ruleFactory,
\Magento\Framework\Stdlib\DateTime\Filter\Date $dateFilter,
\Magento\Framework\Serialize\SerializerInterface $serializer,
Function validateData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function validateData(\Magento\Framework\DataObject $dataObject)
{
$result = [];
$fromDate = $toDate = null;
- 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 parseDateFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
private function parseDateFields()
{
if ('' === $this->getFromDate()) {
$this->unsFromDate();
}
- 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
Doc-block of $resourceCollection
in __construct
is phpdoc param type \Magento\Framework\Data\Collection\AbstractDb
which is not a permitted replacement of the nullable param type ?\Magento\Framework\Data\Collection\AbstractDb
declared in the signature ('?T' should be documented as 'T|null' or '?T') Open
Open
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection Resource collection.
- Exclude checks
Doc-block of $resource
in __construct
is phpdoc param type \Magento\Framework\Model\ResourceModel\AbstractResource
which is not a permitted replacement of the nullable param type ?\Magento\Framework\Model\ResourceModel\AbstractResource
declared in the signature ('?T' should be documented as 'T|null' or '?T') Open
Open
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource Resource.
- Exclude checks