Showing 331 of 503 total issues
User
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends NgRestModel implements IdentityInterface, ChangePasswordInterface
{
use SoftDeleteTrait;
public const USER_SETTING_ISDEVELOPER = 'isDeveloper';
File services.js
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
// service resolver
adminServiceResolver = ['ServiceFoldersData', 'ServiceFiltersData', 'ServiceLanguagesData', 'ServicePropertiesData', 'AdminLangService', 'ServiceFoldersDirectoryId', function(ServiceFoldersData, ServiceFiltersData, ServiceLanguagesData, ServicePropertiesData, AdminLangService, ServiceFoldersDirectoryId) {
ServiceFiltersData.load();
ServiceFoldersData.load();
ServiceLanguagesData.load();
BaseFileSystemStorage
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class BaseFileSystemStorage extends Component
{
use CacheableTrait;
/**
Plugin
has 39 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Plugin extends Component implements TypesInterface
{
public const CREATE_CONTEXT_PREFIX = 'create.';
public const UPDATE_CONTEXT_RPEFXI = 'update.';
Function generateRules
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function generateRules($table)
{
$types = [];
$lengths = [];
foreach ($table->columns as $column) {
- 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 link
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element, attrs) {
// In standard-compliant browsers we use a custom mime type and also encode the dnd-type in it.
// However, IE and Edge only support a limited number of mime types. The workarounds are described
// in https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
var MIME_TYPE = 'application/x-dnd';
File Config.php
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\ngrest;
use luya\admin\Module;
Function link
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attr) {
var defaultPosition = 'right';
var lastValue = null;
File User.php
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\models;
use luya\admin\aws\ApiRequestInsightActiveWindow;
Function ngRestConfigDefine
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function ngRestConfigDefine(ConfigBuilder $config, $assignedType, array $fields)
{
$types = $this->ngRestAttributeTypes();
$extraTypes = $this->ngRestExtraAttributeTypes();
- 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 StorageController.php
has 345 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\apis;
use InvalidArgumentException;
Function getOperation
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function getOperation(UrlRule $urlRule, $verbName)
{
if (empty($urlRule->verb)) {
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
File BaseSpecs.php
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\openapi\specs;
use cebe\openapi\spec\Example;
Method getOperation
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getOperation(UrlRule $urlRule, $verbName)
{
if (empty($urlRule->verb)) {
return false;
}
Function actionIndex
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function actionIndex($query)
{
$search = [];
$module = Yii::$app->getModule('admin');
- 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 controller
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$http', '$timeout', 'AdminToastService', function($scope, $http, $timeout, AdminToastService) {
// toggle window
$scope.getFirstAttributeKeyAsDefaultValue = function() {
Method getParameters
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getParameters(): array
{
$params = [];
if ($this->getReflection() instanceof ReflectionMethod) {
foreach ($this->getReflection()->getParameters() as $arg) {
ActiveWindow
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ActiveWindow extends BaseActiveResponse implements ViewContextInterface, ActiveWindowInterface, NgRestButtonConditionInterface, NgRestPermissionLevelInterface
{
/**
* @var string $suffix The suffix to use for all classes
*/
Angular
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Angular
{
/**
* Type Cast values.
*
Item
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Item extends ItemAbstract implements LinkInterface
{
use LinkTrait;
/**