Showing 10 of 48 total issues
Function getMonth
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMonth:function(value){
var month = '';
switch (value){
case 'Jan':
month ='01' ;
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt){
grunt.initConfig({
mocha_istanbul: {
coverage: {
src: 'test', // a folder works nicely
Function getValues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getValues: function(searching){
//console.log('getValues');
searching = searching.toArray();
var result = [];
for(var i=0;i<searching.length;i++){
- 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 iterationOddEven
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
iterationOddEven:function(index,odd,array){
var result = [],
value,
check ;
for (var i = 0; i < array.length; i++) {
- 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 generateScale
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
generateScale: function(type,style,start,end,interval){
//console.log('generatScale');
var mytype = type === 'numbers' ? 1 : 2,
mystyle = style !== null ? style === 'upper' ? 1 : 2 : null,
myinterval = interval === null ? 1 : interval ;
- 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 generateScale
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
generateScale: function(type,style,start,end,interval){
Function scaleGenerate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
scaleGenerate:function(type,style,start,end,interval){
Function remove
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
remove: function(element){
//console.log('remove');
var result = [];
var type = element instanceof Array;
for (var i = 0; i < this.length; i++) {
- 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 scaleGenerate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
scaleGenerate:function(type,style,start,end,interval){
var result = [];
for (var i = start; i <= end; i = i + interval) {
var value = type === 1 ? i : style === 1? letters_array[i].toUpperCase() : letters_array[i].toLowerCase();
result.push(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
Function formatMoney
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
formatMoney: function(c){
//console.log('formatMoney');
c = isNaN(c = Math.abs(c)) ? 2 : c;
var n = this,
d =".",
- 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"