Showing 331 of 503 total issues
Function controller
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$filter', 'ServiceFiltersData', 'ServiceImagesData', 'AdminToastService', 'ServiceFilesData', function ($scope, $http, $filter, ServiceFiltersData, ServiceImagesData, AdminToastService, ServiceFilesData) {
// ServiceFiltesrData inheritance
//$scope.ngModel = 0;
Function updateItemIndex
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function updateItemIndex(AfterSaveEvent $event, $isNewRecord = false)
{
$attributeName = self::sortableField();
$oldPosition = array_key_exists($attributeName, $event->changedAttributes) ? $event->changedAttributes[$attributeName] : false;
$newPosition = $event->sender[$attributeName];
- 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 LoginController.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\controllers;
use luya\admin\assets\Login;
Method actionDashboard
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionDashboard($nodeId)
{
$data = Yii::$app->adminmenu->getNodeData($nodeId);
$accessList = [];
File scheduler.js
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* LUYA admin scheduler directive.
*
* The scheduler directive will turn any field into an interactive scheduling system.
*
Function actionDashboard
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function actionDashboard($nodeId)
{
$data = Yii::$app->adminmenu->getNodeData($nodeId);
$accessList = [];
- 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 generateModelContent
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function generateModelContent($fileNamepsace, $className, $apiEndpoint, TableSchema $schema, $i18nFields)
{
$alias = Inflector::humanize(Inflector::camel2words($className));
$dbTableName = $schema->fullName;
- 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 startFiles
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function startFiles()
{
$fileCount = 0;
// sync files
foreach ((new Query())->where(['is_deleted' => false])->all() as $file) {
- 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 Plugin.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\ngrest\base;
use luya\admin\base\TypesInterface;
Method actionSync
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionSync()
{
$this->db = Instance::ensure($this->db, Connection::class);
if ($this->url === null) {
StorageImage
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class StorageImage extends NgRestModel
{
/**
* @inheritdoc
*/
StorageFile
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
final class StorageFile extends ActiveRecord
{
use TaggableTrait;
/**
Method actionExport
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionExport()
{
$extension = null;
$mime = null;
$header = Yii::$app->request->getBodyParam('header', 1);
Function controller
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$filter', function ($scope, $filter) {
$scope.searchString;
$scope.sourceData = [];
File Module.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin;
use luya\admin\base\ReloadButton;
Function controller
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$filter', function ($scope, $filter) {
$scope.$watch(function () {
return $scope.model
}, function (n, o) {
Method getButtons
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getButtons()
{
// if already assigned return the resutl
if ($this->_buttons) {
return $this->_buttons;
Method getModules
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModules()
{
if ($this->_modules !== null) {
return $this->_modules;
}
Function getButtons
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getButtons()
{
// if already assigned return the resutl
if ($this->_buttons) {
return $this->_buttons;
- 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 actionCreate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function actionCreate()
{
// 1. ask for module
if ($this->moduleName === null) {
Console::clearScreenBeforeCursor();
- 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"