Showing 209 of 326 total issues
ConcretImplementationBlock
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ConcretImplementationBlock implements BlockInterface
{
public function onRegister()
{
}
Method testGetProperties
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testGetProperties()
{
PermissionScope::run($this->app, function (PermissionScope $scope) {
$this->createAdminLangFixture();
$this->createCmsNavItemRedirectFixture();
Method testTeardownWithHidden
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testTeardownWithHidden()
{
$this->createAdminGroupFixture(1);
$this->createAdminUserFixture();
$this->createAdminLangFixture([
Method testDescendentsMultiple
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testDescendentsMultiple()
{
$this->createAdminGroupFixture(1);
$this->createAdminUserFixture();
Method createPageFromDraft
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createPageFromDraft($parentNavId, $navContainerId, $langId, $title, $alias, $description, $fromDraftNavId, $isDraft = false): bool|array
{
if (!$isDraft && empty($isDraft) && !is_numeric($isDraft)) {
$isDraft = 0;
}
Method actionGeneric
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionGeneric()
{
if (Config::has(self::MIGRATION_CODE_100)) {
return $this->outputError("Command already executed. System is up-to-date.");
}
NavController
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class NavController extends \luya\admin\base\RestController
{
private function postArg($name, $defautValue = null)
{
return Yii::$app->request->post($name, $defautValue);
Function controller
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller : ['$scope', '$http', '$filter', 'ServiceMenuData', 'ServiceLanguagesData', 'AdminToastService', 'ServiceCurrentWebsite', function($scope, $http, $filter, ServiceMenuData, ServiceLanguagesData, AdminToastService, ServiceCurrentWebsite) {
$scope.error = [];
$scope.success = false;
Function registerToAppView
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function registerToAppView(array $blockAssets, array $assetBundles)
{
$appView = Yii::$app->view;
foreach ($blockAssets as $attribute => $blockAsset) {
- 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 actionGeneric
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function actionGeneric()
{
if (Config::has(self::MIGRATION_CODE_100)) {
return $this->outputError("Command already executed. System is up-to-date.");
}
- 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
NavItemPage
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class NavItemPage extends NavItemType implements NavItemTypeInterface, ViewContextInterface
{
use CacheableTrait;
/**
Function comparePlaceholders
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function comparePlaceholders($array1, $array2)
{
if (!array_key_exists('placeholders', $array1) || !array_key_exists('placeholders', $array2)) {
return false;
}
- 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 getBlockItem
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getBlockItem(NavItemPageBlockItem $blockItem, NavItemPage $navItemPage, array $envOptions = [])
{
// if the block relation could be found, return false.
if (!$blockItem->block) {
return false;
Method actionDataBlocks
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionDataBlocks()
{
$favs = Yii::$app->adminuser->identity->setting->get("blockfav", []);
$groups = [];
foreach (BlockGroup::find()->with(['blocks'])->all() as $blockGroup) {
Method testVariationWhichIsSetAndNotDefault
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testVariationWhichIsSetAndNotDefault()
{
$this->app->getModule('cmsadmin')->blockVariations = [
TestingBlock::variations()
->add('idf', 'My Test')
Function copyPageItem
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function copyPageItem(NavItem $targetNavItem)
{
if ($this->nav_item_type !== self::TYPE_PAGE) {
return false;
}
- 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
Block
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Block extends NgRestModel
{
private int $cachedDeletedId = 0;
/**
PhpBlockView
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PhpBlockView extends View
{
/**
* @var boolean Is disabled by default as its already registered by global view and layout files are not used in block views.
* @see https://github.com/luyadev/luya/issues/1807
NavItemController
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class NavItemController extends \luya\admin\base\RestController
{
/**
* @inheritdoc
*/
Query
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Query extends BaseObject implements QueryOperatorFieldInterface
{
/**
* @var array An array with all available where operators.
*/