Showing 54 of 76 total issues
Function setOptionHash
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setOptionHash(elements, hash) {
elements = normalizeElementArray(elements);
var option_array = option_arrays[hash];
if(hash === undefined || hash === null) {
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '.',
Function owlTableService
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function owlTableService ($http, $rootScope, $filter, $modal, owlConstants, owlResource, owlUtils, owlFilter) {
Avoid deeply nested control flow statements. Open
Open
} else if (filter.condition === owlConstants.filtering.CONTAINS) {
var containsRE = termCache(cacheId) ? termCache(cacheId) : termCache(cacheId, new RegExp(term, regexpFlags));
if (!containsRE.test(value)) {
return false;
Avoid deeply nested control flow statements. Open
Open
if(tmp_a === tmp_b) {
tmp_a = a.index;
tmp_b = b.index;
if(tmp_a === tmp_b) {
Avoid deeply nested control flow statements. Open
Open
if (value.length !== 0) {
return false;
}
Avoid deeply nested control flow statements. Open
Open
if(new_indexes[j] !== selected_indexes[j]) {
changed = true;
break;
}
Function filterCell
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
filterCell: function (row, column, termCache, i, filter) {
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return false;
Function tableDidChange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
tableDidChange: function (event, row, column) {
if (typeof this.state.changedData[row.id] === 'undefined') {
this.state.changedData[row.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"