Function saveAndReplaceThesaurus
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
private function saveAndReplaceThesaurus(): void
{
$behavior = $this->getBehavior();
$rows = [];
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
Function saveThesaurusFinish
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
private function saveThesaurusFinish(array $thesaurusData): bool
{
foreach ($thesaurusData as $thesaurusRows) {
foreach ($thesaurusRows as $row) {
$model = $this->importProvider->createThesaurus();
Thesaurus
has 11 functions (exceeds 10 allowed). Consider refactoring.
class Thesaurus extends AbstractEntity
{
const ENTITY_CODE = 'thesaurus';
const COL_TERMS = 'terms_relations';
const COL_STORES = 'stores';
Function deleteThesaurus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
private function deleteThesaurus(): bool
{
$rows = [];
while ($bunch = $this->_dataSourceModel->getNextBunch()) {
foreach ($bunch as $rowNum => $rowData) {
Function deleteThesaurusFinish
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
private function deleteThesaurusFinish(array $thesaurusIds): bool
{
if ($thesaurusIds) {
try {
foreach ($thesaurusIds as $thesaurusId) {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring.
JsonHelper $jsonHelper,
ImportHelper $importExportData,
Data $importData,
Helper $resourceHelper,
ProcessingErrorAggregatorInterface $errorAggregator,
Avoid too many return
statements within this method.
return false;
Function validateRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function validateRow(array $rowData, $rowNum): bool
{
$name = $rowData[ThesaurusInterface::NAME] ?? '';
$type = $rowData[ThesaurusInterface::TYPE] ?? '';
$terms = $rowData[self::COL_TERMS] ?? '';
Invalid offset "type"
of array type array{}
$type = $columnValues[ThesaurusInterface::TYPE];
Argument 2 (type)
is null
but \Smile\ElasticsuiteThesaurus\Model\Import\Provider::processTermsData()
takes string
defined at /code/src/module-elasticsuite-thesaurus/Model/Import/Provider.php:123
$row[$columnKey] = $this->importProvider->processTermsData($row[$columnKey], $type);
There are no issues that match your filters.