Showing 209 of 326 total issues
File _dataFrArray.php
has 1431 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
return
[
43 =>
File cmsadmin.js
has 1405 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function() {
"use strict";
// directive.js
Function renderPlaceholderRecursive
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
Open
private function renderPlaceholderRecursive($navItemPageId, $placeholderVar, $prevId, $layoutBlockInstance = null)
{
$string = '';
$i = 0;
$equalIndex = 1;
- 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
File Nav.php
has 595 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\models;
use luya\admin\models\Group;
Item
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Item extends BaseObject implements LinkInterface, Arrayable
{
use LinkTrait;
use ArrayableTrait;
InternalBaseBlock
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class InternalBaseBlock extends BaseObject implements BlockInterface, TypesInterface, \ArrayAccess
{
/**
* @var string Defines the injector config type `var`.
*/
Method testEnvOptionsPlaceholderIteration
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testEnvOptionsPlaceholderIteration()
{
$this->app->setComponents([
'db' => [
'class' => 'yii\db\Connection',
File NavController.php
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\admin\apis;
use luya\admin\models\TagRelation;
File NavItemController.php
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\admin\apis;
use luya\cms\admin\Module;
File NavItemPage.php
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\models;
use luya\cms\admin\Module;
File Item.php
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\menu;
use luya\admin\models\User;
Method testRenderToolbar
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testRenderToolbar()
{
//region Fictures
$adminGroupFixture = new ActiveRecordFixture([
File BlockController.php
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms\frontend\commands;
use luya\cms\models\Block;
Nav
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Nav extends ActiveRecord
{
use TaggableTrait;
/**
Function actionUpdatePageItem
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
public function actionUpdatePageItem($navItemId, $navItemType): array|bool
{
$model = NavItem::findOne($navItemId);
if (!$model) {
- 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 actionUpdatePageItem
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function actionUpdatePageItem($navItemId, $navItemType): array|bool
{
$model = NavItem::findOne($navItemId);
if (!$model) {
Menu
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Menu extends Component implements \ArrayAccess, QueryOperatorFieldInterface
{
use CacheableTrait;
/**
File Menu.php
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace luya\cms;
use luya\cms\menu\InjectItemInterface;
Method afterSetup
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function afterSetup()
{
parent::afterSetup();
$this->createAdminUserFixture([
File NavControllerTest.php
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace cmstests\src\admin\apis;
use cmstests\WebModelTestCase;