lovata/oc-toolbox-plugin

View on GitHub

Showing 239 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

              The class AbstractImportModel has an overall complexity of 77 which is very high. The configured complexity threshold is 50.
              Open

              abstract class AbstractImportModel
              {
              use TraitInitActiveLang;
               
              const EVENT_BEFORE_IMPORT = 'model.beforeImport';

              The class ElementItem has 17 public methods. Consider refactoring ElementItem to keep number of public methods under 10.
              Open

              abstract class ElementItem extends MainItem
              {
              use ExtendableTrait;
               
              const MODEL_CLASS = Model::class;
              Severity: Minor
              Found in classes/item/ElementItem.php by phpmd

              The class ElementCollection has an overall complexity of 112 which is very high. The configured complexity threshold is 50.
              Open

              abstract class ElementCollection extends Extendable implements CallsAnyMethod, \IteratorAggregate, \Countable
              {
              const COUNT_PER_PAGE = 10;
              const ITEM_CLASS = \Lovata\Toolbox\Classes\Item\ElementItem::class;
               
               

              The class CommonProperty has an overall complexity of 57 which is very high. The configured complexity threshold is 50.
              Open

              class CommonProperty extends ImportModel
              {
              const NAME = 'property';
               
              use Validation;
              Severity: Minor
              Found in models/CommonProperty.php by phpmd

              The class CommonCreateFile has an overall complexity of 79 which is very high. The configured complexity threshold is 50.
              Open

              class CommonCreateFile extends Command
              {
              use LogoTrait;
               
              const PREFIX_LOWER = 'lower_';
              Severity: Minor
              Found in classes/console/CommonCreateFile.php by phpmd

              The class AbstractImportModelFromXML has an overall complexity of 61 which is very high. The configured complexity threshold is 50.
              Open

              abstract class AbstractImportModelFromXML extends AbstractImportModel
              {
              const EXTEND_FIELD_LIST = '';
              const EXTEND_IMPORT_DATA = '';
              const PARSE_NODE_CLASS = ParseXMLNode::class;

              The class ElementCollection has 31 public methods. Consider refactoring ElementCollection to keep number of public methods under 10.
              Open

              abstract class ElementCollection extends Extendable implements CallsAnyMethod, \IteratorAggregate, \Countable
              {
              const COUNT_PER_PAGE = 10;
              const ITEM_CLASS = \Lovata\Toolbox\Classes\Item\ElementItem::class;
               
               

              The class ElementItem has an overall complexity of 90 which is very high. The configured complexity threshold is 50.
              Open

              abstract class ElementItem extends MainItem
              {
              use ExtendableTrait;
               
              const MODEL_CLASS = Model::class;
              Severity: Minor
              Found in classes/item/ElementItem.php by phpmd

              The class ElementCollection has 34 non-getter- and setter-methods. Consider refactoring ElementCollection to keep number of methods under 25.
              Open

              abstract class ElementCollection extends Extendable implements CallsAnyMethod, \IteratorAggregate, \Countable
              {
              const COUNT_PER_PAGE = 10;
              const ITEM_CLASS = \Lovata\Toolbox\Classes\Item\ElementItem::class;
               
               

              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
                  Severity
                  Category
                  Status
                  Source
                  Language