Showing 65 of 114 total issues
File jquery-ui.js
has 2049 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*! jQuery UI - v1.11.4 - 2015-05-31
* http://jqueryui.com
* Includes: core.js, widget.js, position.js, autocomplete.js, menu.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
Function getAssignedMenu
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public static function getAssignedMenu($userId, $root = null, $callback = null, $refresh = false)
{
$config = Configs::instance();
/* @var $manager \yii\rbac\BaseManager */
- 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 _create
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
// Some browsers only repeat keydown events, not keypress events,
// so we use the suppressKeyPress flag to determine if we've already
// handled the keydown event. #7269
// Unfortunately the code for & in keypress is the same as the up arrow,
Function position
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
Function isActive
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function isActive($action)
{
$uniqueId = $action->getUniqueId();
if ($uniqueId === Yii::$app->getErrorHandler()->errorAction) {
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
Function getMenus
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getMenus()
{
if ($this->_normalizeMenus === null) {
$mid = '/' . $this->getUniqueId() . '/';
// resolve core menus
- 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 widget
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
Function _create
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
_create: function() {
this.activeMenu = this.element;
// Flag used to prevent firing of the click handler
// as the event bubbles up through nested menus
Function _keydown
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
_keydown: function( event ) {
var match, prev, character, skip,
preventDefault = true;
switch ( event.keyCode ) {
Method getAssignedMenu
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getAssignedMenu($userId, $root = null, $callback = null, $refresh = false)
{
$config = Configs::instance();
/* @var $manager \yii\rbac\BaseManager */
Function checkRoute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function checkRoute($route, $params = [], $user = null)
{
$config = Configs::instance();
$r = static::normalizeRoute($route, $config->advanced);
if ($config->onlyRegisteredRoute && !isset(static::getRegisteredRoutes()[$r])) {
- 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 getDefaultRoutes
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected static function getDefaultRoutes()
{
if (self::$_defaultRoutes === null) {
$manager = Configs::authManager();
$roles = $manager->defaultRoles;
- 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 AuthItem.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace mdm\admin\models;
use mdm\admin\components\Configs;
Function keydown
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
suppressKeyPressRepeat = true;
Function getRoutesByUser
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function getRoutesByUser($userId)
{
if (!isset(self::$_userRoutes[$userId])) {
$cache = Configs::cache();
if ($cache && ($routes = $cache->get([__METHOD__, $userId])) !== 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
Function bridge
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
Function getControllerFiles
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getControllerFiles($module, $namespace, $prefix, &$result)
{
$path = Yii::getAlias('@' . str_replace('\\', '/', $namespace), false);
$token = "Get controllers from '$path'";
Yii::beginProfile($token, __METHOD__);
- 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 getRoutes
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getRoutes()
{
$manager = Configs::authManager();
// Get advanced configuration
$advanced = Configs::instance()->advanced;
- 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 getUsers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getUsers()
{
$module = Yii::$app->controller->module;
if (!$module || !$module instanceof Module) {
return [];
- 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 refresh
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
refresh: function() {
var menus, items,
that = this,
icon = this.options.icons.submenu,
submenus = this.element.find( this.options.menus );