Function makeRowSelection
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
makeRowSelection: function(tableInstance, $row, largeSelection){
// check if we already reached the max selection
var maxSelection = this.getOption("maxSelection", tableInstance);
if(maxSelection === 0){
- 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 selectRow
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
selectRow : function(tableInstance, $row, selectionType){
var maxSelection = this.getOption("maxSelection", tableInstance);
var plugin = this;
- 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 tableKeys
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
"tableKeys" : function(plugin){
return {
internalSelection: {},
Function selectRow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectRow : function(tableInstance, $row, selectionType){
var maxSelection = this.getOption("maxSelection", tableInstance);
var plugin = this;
Function makeRowSelection
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
makeRowSelection: function(tableInstance, $row, largeSelection){
// check if we already reached the max selection
var maxSelection = this.getOption("maxSelection", tableInstance);
if(maxSelection === 0){
Avoid deeply nested control flow statements. Open
}else if( selectionType === 1 ){
this.rowSetSelection(tableInstance, $row, true);
}else{
this.rowSetSelection(tableInstance, $row, false);
}
Avoid deeply nested control flow statements. Open
if($row.hasClass(plugin.getOption("selectionClass"))){
this.rowSetSelection(tableInstance, $row, false);
}else{
this.rowSetSelection(tableInstance, $row, true);
}
Function clearTableSelection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
clearTableSelection: function(tableInstance, includeHidden){
var self = this;
if(includeHidden){
- 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 function. Open
return true;
Avoid too many return
statements within this function. Open
return true;
Function rowSetSelection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
rowSetSelection : function(tableInstance, $row, selected){
if(selected){
$row.addClass(this.getOption("selectionClass"));
if(this.getOption("keepSelection", tableInstance)){
this.__internalSelectionAdd(tableInstance, $row);
- 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"