lovata/oc-toolbox-plugin

View on GitHub

Showing 71 of 248 total issues

File ElementCollection.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php namespace Lovata\Toolbox\Classes\Collection;
 
use ArrayIterator;
use October\Contracts\Twig\CallsAnyMethod;
use October\Rain\Extension\Extendable;
Severity: Minor
Found in classes/collection/ElementCollection.php - About 6 hrs to fix

    ElementCollection has 40 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class ElementCollection extends Extendable implements CallsAnyMethod, \IteratorAggregate, \Countable
    {
    const COUNT_PER_PAGE = 10;
    const ITEM_CLASS = \Lovata\Toolbox\Classes\Item\ElementItem::class;
     
     
    Severity: Minor
    Found in classes/collection/ElementCollection.php - About 5 hrs to fix

      Function importImageList has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      protected function importImageList()
      {
      if (!$this->bNeedUpdateImageList) {
      return;
      }
      Severity: Minor
      Found in classes/helper/AbstractImportModel.php - About 4 hrs to fix

      File CommonCreateFile.php has 371 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php namespace Lovata\Toolbox\Classes\Console;
       
      use Lang;
      use Illuminate\Console\Command;
      use Symfony\Component\Console\Input\InputArgument;
      Severity: Minor
      Found in classes/console/CommonCreateFile.php - About 4 hrs to fix

        ElementItem has 31 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class ElementItem extends MainItem
        {
        use ExtendableTrait;
         
        const MODEL_CLASS = Model::class;
        Severity: Minor
        Found in classes/item/ElementItem.php - About 3 hrs to fix

          File CommonProperty.php has 316 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php namespace Lovata\Toolbox\Models;
           
          use Lang;
          use Backend\Models\ImportModel;
          use October\Rain\Database\Traits\Validation;
          Severity: Minor
          Found in models/CommonProperty.php - About 3 hrs to fix

            File ElementItem.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php namespace Lovata\Toolbox\Classes\Item;
             
            use Model;
            use October\Rain\Extension\ExtendableTrait;
             
             
            Severity: Minor
            Found in classes/item/ElementItem.php - About 3 hrs to fix

              Method handle has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              public function handle()
              {
              $this->logoToolBox();
               
              $arHeaderList = [self::HEADER_COMMAND_LIST, self::HEADER_DESCRIPTION];
              Severity: Major
              Found in classes/console/ToolBoxHelper.php - About 3 hrs to fix

                Function getUrlParamList has a Cognitive Complexity of 21 (exceeds 5 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 2 hrs to fix

                Function parse has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

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

                File AbstractImportModel.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php namespace Lovata\Toolbox\Classes\Helper;
                 
                use Event;
                use Queue;
                use System\Models\File;
                Severity: Minor
                Found in classes/helper/AbstractImportModel.php - About 2 hrs to fix

                  CommonProperty has 22 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class CommonProperty extends ImportModel
                  {
                  const NAME = 'property';
                   
                  use Validation;
                  Severity: Minor
                  Found in models/CommonProperty.php - About 2 hrs to fix

                    CommonCreateFile has 22 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class CommonCreateFile extends Command
                    {
                    use LogoTrait;
                     
                    const PREFIX_LOWER = 'lower_';
                    Severity: Minor
                    Found in classes/console/CommonCreateFile.php - About 2 hrs to fix

                      Function importPreviewImage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                      protected function importPreviewImage()
                      {
                      if (!$this->bNeedUpdatePreviewImage) {
                      return;
                      }
                      Severity: Minor
                      Found in classes/helper/AbstractImportModel.php - About 2 hrs to fix

                      Function setLangProperties has a Cognitive Complexity of 17 (exceeds 5 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 2 hrs to fix

                      Function getWidgetData has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                      public function getWidgetData()
                      {
                      $arResult = [];
                       
                      switch ($this->type) {
                      Severity: Minor
                      Found in models/CommonProperty.php - About 2 hrs to fix

                      Method getWidgetData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      public function getWidgetData()
                      {
                      $arResult = [];
                       
                      switch ($this->type) {
                      Severity: Major
                      Found in models/CommonProperty.php - About 2 hrs to fix

                        Method importImageList has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        protected function importImageList()
                        {
                        if (!$this->bNeedUpdateImageList) {
                        return;
                        }
                        Severity: Minor
                        Found in classes/helper/AbstractImportModel.php - About 1 hr to fix

                          Function initImageList has a Cognitive Complexity of 13 (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/AbstractImportModelFromXML.php - About 1 hr to fix

                          Method importPreviewImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          protected function importPreviewImage()
                          {
                          if (!$this->bNeedUpdatePreviewImage) {
                          return;
                          }
                          Severity: Minor
                          Found in classes/helper/AbstractImportModel.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language