Showing 331 of 503 total issues
Method actionIndex
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionIndex()
{
try {
Image::getImagine();
} catch (\Exception $e) {
Method generateRules
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateRules($table)
{
$types = [];
$lengths = [];
foreach ($table->columns as $column) {
File CrudController.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace luya\admin\commands;
use luya\admin\base\BaseCrudController;
Function save
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
// get the filter model based on the current filter.
$filterModel = $this->findModel();
// update the name of the filter if changed
- 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 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attr) {
var inlineModal = element.find('.inlinemodal');
var inlineModalArrow = element.find('.inlinemodal-arrow');
var button = element.find('.scheduler-btn');
Api
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Api extends RestActiveController
{
/**
* @var string Defines the related model for the NgRest Controller. The full qualiefied model name
* is required.
Function template
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
template: function () {
return '<div class="scheduler" ng-class="{\'inlinemodal--open\' : isVisible}">'+
'<button ng-click="toggleWindow()" type="button" class="scheduler-btn btn btn-link">' +
'<i class="material-icons">schedule</i><span ng-hide="onlyIcon">{{valueToLabel(value)}}</span>' +
'</button>' +
Function getExtraFields
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getExtraFields()
{
if ($this->_extraFields === null) {
$extraFields = [];
foreach ($this->getConfig() as $pointer => $fields) {
- 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 actionTwofaToken
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function actionTwofaToken()
{
if (($lockout = $this->sessionBruteForceLock(Yii::$app->session->get('secureId')))) {
return $this->sendArray(false, [Module::t('login_async_submission_limit_reached', ['time' => Yii::$app->formatter->asRelativeTime($lockout)])]);
}
- 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 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$filter', function ($scope, $filter) {
$scope.isNumeric = function (num) {
return !isNaN(num)
}
Function filter
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function filter()
{
$containerData = $this->getDataProvider();
$whereExpression = $this->_where;
- 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 getPlugins
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getPlugins()
{
if ($this->_plugins === null) {
$plugins = [];
foreach ($this->getConfig() as $pointer => $fields) {
- 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 crud.php
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use luya\admin\helpers\Angular;
use luya\admin\Module;
use luya\admin\ngrest\render\RenderCrud;
use luya\helpers\ArrayHelper;
Function controller
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', '$timeout', '$rootScope', function ($scope, $timeout, $rootScope) {
$scope.isOpen = 0;
$scope.isDefault = 1;
Function paginateYears
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
$scope.paginateYears = function paginateYears(startingYear) {
var i
, theNewYears = []
, daysToPrepend = 10
, daysToAppend = 10;
CrudController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class CrudController extends BaseCrudController
{
/**
* @var boolean Whether the core modules should be hidden from selection list or not.
*/
Function actionAsync
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function actionAsync()
{
if (($lockout = $this->sessionBruteForceLock(0))) {
return $this->sendArray(false, [Module::t('login_async_submission_limit_reached', ['time' => Yii::$app->formatter->asRelativeTime($lockout)])]);
}
- 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 actionCreate
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionCreate()
{
// 1. ask for module
if ($this->moduleName === null) {
Console::clearScreenBeforeCursor();
Function controller
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
controller: ['$scope', function ($scope) {
if ($scope.model === undefined) {
$scope.model = [{ 0: '' }];
}
StorageController
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class StorageController extends RestController
{
use CacheableTrait;
/**