Showing 71 of 236 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;
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;
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;
ElementItem
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ElementItem extends MainItem
{
use ExtendableTrait;
const MODEL_CLASS = Model::class;
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;
File ElementItem.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php namespace Lovata\Toolbox\Classes\Item;
use Model;
use October\Rain\Extension\ExtendableTrait;
Function importImageList
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function importImageList()
{
if (!$this->bNeedUpdateImageList) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
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];
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);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parse
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function parse()
{
if (empty($this->arImportSettings)) {
return;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
CommonCreateFile
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CommonCreateFile extends Command
{
use LogoTrait;
const PREFIX_LOWER = 'lower_';
CommonProperty
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CommonProperty extends ImportModel
{
const NAME = 'property';
use Validation;
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;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getWidgetData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getWidgetData()
{
$arResult = [];
switch ($this->type) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getWidgetData
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWidgetData()
{
$arResult = [];
switch ($this->type) {
Method callCommandList
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function callCommandList()
{
$sMessage = Lang::get('lovata.toolbox::lang.message.create', ['name' => self::CODE_MODEL]);
if ($this->confirm($sMessage, true)) {
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;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getElementListFromDB
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getElementListFromDB($arElementIDList, $arResult)
{
if (empty($arElementIDList)) {
return $arResult;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parse()
{
if (empty($this->arImportSettings)) {
return;
}
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);