lovata/oc-toolbox-plugin

View on GitHub

Showing 239 of 248 total issues

Function sendMail has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

protected function sendMail($sEmail)
{
if (empty($this->sMailTemplate) || empty($sEmail)) {
return;
}
Severity: Minor
Found in classes/helper/SendMailHelper.php - About 1 hr to fix

Function getElementListFromDB has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

protected function getElementListFromDB($arElementIDList, $arResult)
{
if (empty($arElementIDList)) {
return $arResult;
}
Severity: Minor
Found in classes/collection/ElementCollection.php - About 1 hr to fix

Method parse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

protected function parse()
{
if (empty($this->arImportSettings)) {
return;
}
Severity: Minor
Found in classes/helper/ParseXMLNode.php - About 1 hr to fix

    Method getUrlParamList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function getUrlParamList($sPageCode, $sComponentName, $sParamName = 'slug', $bFindWildcard = false)
    {
    $sCacheKey = implode('_', [$sPageCode, $sComponentName, $sParamName, (int) $bFindWildcard]);
    if ($this->hasCache($sCacheKey)) {
    return $this->getCachedData($sCacheKey);
    Severity: Minor
    Found in classes/helper/PageHelper.php - About 1 hr to fix

      Method update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      public function update()
      {
      if (!$this->bUpdate || !isset($this->sFilePath) || empty($this->sFilePath)) {
      return;
      }
      Severity: Minor
      Found in classes/parser/update/PluginYAMLUpdateFile.php - About 1 hr to fix

        Function update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        public function update($arData)
        {
        $arReplaceList = array_get($this->arData, 'replace');
         
        if (empty($arData) || !is_array($arData) || empty($arReplaceList) || !$this->bUpdate) {
        Severity: Minor
        Found in classes/parser/update/PluginLangUpdateFile.php - About 1 hr to fix

        Function initLangFields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        protected function initLangFields($arFieldList)
        {
        $arActiveLangList = $this->getActiveLangList();
        if (empty($arActiveLangList) || empty($arFieldList)) {
        return $arFieldList;
        Severity: Minor
        Found in classes/helper/AbstractImportModelFromXML.php - About 1 hr to fix

        Method getModeProperty has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        protected function getModeProperty()
        {
        $arResult = [
        self::PROPERTY_MODE => [
        'title' => 'lovata.toolbox::lang.component.property_mode',
        Severity: Minor
        Found in classes/component/ComponentSubmitForm.php - About 1 hr to fix

          Method initImageList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          protected function initImageList()
          {
          if (!array_key_exists('images', $this->arImportData)) {
          $this->bNeedUpdateImageList = false;
          return;
          Severity: Minor
          Found in classes/helper/AbstractImportModelFromXML.php - About 1 hr to fix

            Method setFieldList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            protected function setFieldList($arException = [], $arOnlyThis = [])
            {
            if ($this->checkAdditionList(self::CODE_FIELDS)) {
            return;
            }
            Severity: Minor
            Found in classes/console/CommonCreateFile.php - About 1 hr to fix

              Method sendMail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              protected function sendMail($sEmail)
              {
              if (empty($this->sMailTemplate) || empty($sEmail)) {
              return;
              }
              Severity: Minor
              Found in classes/helper/SendMailHelper.php - About 1 hr to fix

                Function setCachedFieldList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                protected function setCachedFieldList()
                {
                if (!$this->obElement->methodExists('getCachedField')) {
                return;
                }
                Severity: Minor
                Found in classes/item/ElementItem.php - About 1 hr to fix

                Method subscribe has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                public function subscribe()
                {
                $sModelClass = $this->getModelClass();
                 
                $sModelClass::extend(function ($obModel) {
                Severity: Minor
                Found in classes/event/AbstractModelRelationHandler.php - About 1 hr to fix

                  Method setLangProperties has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  private function setLangProperties()
                  {
                  if (empty($this->obElement) || !$this->obElement->isClassExtendedWith('RainLab.Translate.Behaviors.TranslatableModel')) {
                  return;
                  }
                  Severity: Minor
                  Found in classes/item/ElementItem.php - About 1 hr to fix

                    Function initImageList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected function initImageList()
                    {
                    if (!array_key_exists('images', $this->arImportData)) {
                    $this->bNeedUpdateImageList = false;
                    return;
                    Severity: Minor
                    Found in classes/helper/AbstractImportModelFromCSV.php - About 55 mins to fix

                    Function setAuthorAndPlugin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected function setAuthorAndPlugin($bExpansion, $sCode, $sExpansionCode, $sExample)
                    {
                    if (empty($sCode) || empty($sExpansionCode) || empty($sExample) || !is_bool($bExpansion)) {
                    return;
                    }
                    Severity: Minor
                    Found in classes/console/CommonCreateFile.php - About 55 mins to fix

                    Function setEnableList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected function setEnableList($arData)
                    {
                    if (empty($arData)) {
                    return;
                    }
                    Severity: Minor
                    Found in classes/console/CommonCreateFile.php - About 55 mins to fix

                    Function addPriceFiledMethods has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected static function addPriceFiledMethods($obElement)
                    {
                    if (empty($obElement->arPriceField) || !is_array($obElement->arPriceField)) {
                    return;
                    }
                    Severity: Minor
                    Found in traits/helpers/PriceHelperTrait.php - About 55 mins to fix

                    Function callCommandList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected function callCommandList()
                    {
                    $sMessage = Lang::get('lovata.toolbox::lang.message.create', ['name' => self::CODE_MODEL]);
                     
                    if ($this->confirm($sMessage, true)) {
                    Severity: Minor
                    Found in classes/console/CreateAll.php - About 55 mins to fix

                    Function getActiveLangList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    protected function getActiveLangList()
                    {
                    if (self::$arActiveLangList !== null || !PluginManager::instance()->hasPlugin('RainLab.Translate')) {
                    return self::$arActiveLangList;
                    }
                    Severity: Minor
                    Found in traits/helpers/TraitInitActiveLang.php - About 55 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language