js/src/common/UI.js
Function initSortable
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
Open
initSortable: function ($cntxt) {
var $context = $cntxt || jQuery('body');
var currentModule, areaOver, prevAreaOver;
var validModule = 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 initSortable
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initSortable: function ($cntxt) {
var $context = $cntxt || jQuery('body');
var currentModule, areaOver, prevAreaOver;
var validModule = false;
File UI.js
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
*
* These is a collection of helper functions to handle
* the user interface / user interaction such as
* - Sorting
Function metaBoxReorder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
metaBoxReorder: function (e, o, settings, action) {
if (settings.data) {
var a = settings.data;
if (a && a.split) {
- 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 update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: function (ev, ui) {
if (!isValidModule()) {
return false;
}
Function init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function () {
var that = this;
var $body = $('body');
// init general ui components
this.initTabs();