lovata/oc-toolbox-plugin

View on GitHub

Showing 239 of 248 total issues

Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed.
Open

protected function parse()
Severity: Critical
Found in classes/helper/ParseXMLNode.php by sonar-php

Either remove or fill this block of code.
Open

} catch (\Exception $obException) {}

Reduce the number of returns of this function 4, down to the maximum allowed 3.
Open

public function getLangAttribute($sName, $sLangCode = null)
Severity: Major
Found in classes/item/MainItem.php by sonar-php

Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
Open

protected function importPreviewImage()

Class "CommonProperty" has 22 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class CommonProperty extends ImportModel
Severity: Major
Found in models/CommonProperty.php by sonar-php

Define a constant instead of duplicating this literal "lovata.toolbox::lang.message.create" 3 times.
Open

$sMessage = Lang::get('lovata.toolbox::lang.message.create', ['name' => self::CODE_CREATION_MIGRATION]);
Severity: Critical
Found in classes/console/CreateModel.php by sonar-php

Remove the unused function parameter "$obModel".
Open

protected function afterDetach($obModel, $arAttachedIDList)

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
Open

public function getUrlParamList($sPageCode, $sComponentName, $sParamName = 'slug', $bFindWildcard = false)
Severity: Critical
Found in classes/helper/PageHelper.php by sonar-php

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
Open

private function setLangProperties()
Severity: Critical
Found in classes/item/ElementItem.php by sonar-php

Define a constant instead of duplicating this literal "lovata.toolbox::lang.message.table_toolbox_create" 17 times.
Open

Lang::get('lovata.toolbox::lang.message.table_toolbox_create', ['description' => 'all pack.']),
Severity: Critical
Found in classes/console/ToolBoxHelper.php by sonar-php

Reduce the number of returns of this function 5, down to the maximum allowed 3.
Open

public function getValueByPath($sFieldPath, $sPrefix = null, $sNamespace = null)
Severity: Major
Found in classes/helper/ImportXMLNode.php by sonar-php

Define a constant instead of duplicating this literal "images" 3 times.
Open

if (!array_key_exists('images', $this->arImportData)) {

Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
Open

protected function importImageList()

Define a constant instead of duplicating this literal "lovata.toolbox::lang.message.create" 9 times.
Open

$sMessage = Lang::get('lovata.toolbox::lang.message.create', ['name' => self::CODE_MODEL]);
Severity: Critical
Found in classes/console/CreateAll.php by sonar-php

Remove the unused function parameter "$obModel".
Open

protected function afterAttach($obModel, $arAttachedIDList, $arInsertData)

Class "ElementCollection" has 40 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

abstract class ElementCollection extends Extendable implements CallsAnyMethod, \IteratorAggregate, \Countable

Define a constant instead of duplicating this literal "-menu-" 5 times.
Open

$sKeyMainMenu = $sLowerPlugin.'-menu-'.'main';

Reduce the number of returns of this function 6, down to the maximum allowed 3.
Open

protected function getResponseModeForm($sRedirectURL = null)

Define a constant instead of duplicating this literal "obElement" 3 times.
Open

'obElement' => $obElement,
Severity: Critical
Found in classes/item/ElementItem.php by sonar-php
Severity
Category
Status
Source
Language