Showing 65 of 114 total issues
Function name
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
returnValue = this;
Method isActive
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function isActive($action)
{
$uniqueId = $action->getUniqueId();
if ($uniqueId === Yii::$app->getErrorHandler()->errorAction) {
return false;
Method getUsers
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUsers()
{
$module = Yii::$app->controller->module;
if (!$module || !$module instanceof Module) {
return [];
Function search
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function search($params)
{
/* @var \yii\rbac\Manager $authManager */
$authManager = Configs::authManager();
$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 save
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if ($this->validate()) {
$manager = Configs::authManager();
if ($this->_item === null) {
- 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 _on
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
Method getRoutes
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRoutes()
{
$manager = Configs::authManager();
// Get advanced configuration
$advanced = Configs::instance()->advanced;
Function addNew
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function addNew($routes)
{
$manager = Configs::authManager();
foreach ($routes as $route) {
try {
- 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 normalizeMenu
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static function normalizeMenu(&$assigned, &$menus, $callback, $parent = null)
{
$result = [];
$order = [];
foreach ($assigned as $id) {
- 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 getMenus
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMenus()
{
if ($this->_normalizeMenus === null) {
$mid = '/' . $this->getUniqueId() . '/';
// resolve core menus
Method checkRoute
has 33 lines of code (exceeds 25 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])) {
Function top
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
Method search
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($params)
{
/* @var \yii\rbac\Manager $authManager */
$authManager = Configs::authManager();
$advanced = Configs::instance()->advanced;
Function addChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function addChildren($items)
{
$manager = Configs::authManager();
$success = 0;
if ($this->_item) {
- 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 removeChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function removeChildren($items)
{
$manager = Configs::authManager();
$success = 0;
if ($this->_item !== null) {
- 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 search
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($params)
{
$query = MenuModel::find()
->from(MenuModel::tableName() . ' t')
->joinWith(['menuParent' => function ($q) {
Function option
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
Function left
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
Function _destroy
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_destroy: function() {
// Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
.find( ".ui-menu" ).addBack()
Function _initSource
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initSource: function() {
var array, url,
that = this;
if ( $.isArray( this.options.source ) ) {
array = this.options.source;