Showing 65 of 114 total issues
Function _createWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
Method addNew
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addNew($routes)
{
$manager = Configs::authManager();
foreach ($routes as $route) {
try {
Function top
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
top: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
outerHeight = data.within.height,
collisionPosTop = position.top - data.collisionPosition.marginTop,
Method save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save()
{
if ($this->validate()) {
$manager = Configs::authManager();
if ($this->_item === null) {
Method getControllerFiles
has 27 lines of code (exceeds 25 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__);
Function getDimensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDimensions( elem ) {
var raw = elem[0];
if ( raw.nodeType === 9 ) {
return {
width: elem.width(),
Function left
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
left: function( position, data ) {
var within = data.within,
withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
outerWidth = within.width,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
Function filterRecursive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function filterRecursive($items, $user)
{
$result = [];
foreach ($items as $i => $item) {
$url = ArrayHelper::getValue($item, 'url', '#');
- 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 getItems
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getItems()
{
$manager = Configs::authManager();
$advanced = Configs::instance()->advanced;
$available = [];
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if ($this->validate()) {
$manager = Configs::authManager();
$class = $this->className;
- 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
Consider simplifying this complex logical expression. Open
if ($this->validate()) {
$search = mb_strtolower(trim((string)$this->name));
$desc = mb_strtolower(trim((string)$this->description));
$ruleName = $this->ruleName;
Consider simplifying this complex logical expression. Open
if (term == '' || menu.name.toLowerCase().indexOf(term) >= 0 ||
(menu.parent_name && menu.parent_name.toLowerCase().indexOf(term) >= 0) ||
(menu.route && menu.route.toLowerCase().indexOf(term) >= 0)) {
result.push(menu);
limit--;
Function getSavedRoutes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getSavedRoutes()
{
if (self::$_routes === null) {
self::$_routes = [];
foreach (Configs::authManager()->getPermissions() as $name => $value) {
- 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
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return isset($routes['/*']);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Function getRegisteredRoutes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getRegisteredRoutes()
{
if (self::$_routes === null) {
self::$_routes = [];
$manager = Configs::authManager();
- 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 getActionRoutes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getActionRoutes($controller, &$result)
{
$token = "Get actions of controller '" . $controller->uniqueId . "'";
Yii::beginProfile($token, __METHOD__);
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"