marcosomma/my-prototypes

View on GitHub

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' ;
Severity: Minor
Found in src/helper.js - About 1 hr to fix

    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
    Severity: Minor
    Found in Gruntfile.js - About 1 hr to fix

      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++){
      Severity: Minor
      Found in src/object.js - About 45 mins to fix

      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++) {
      Severity: Minor
      Found in src/helper.js - About 45 mins to fix

      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 ;
      Severity: Minor
      Found in src/array.js - About 45 mins to fix

      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){
      Severity: Minor
      Found in src/array.js - About 35 mins to fix

        Function scaleGenerate has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            scaleGenerate:function(type,style,start,end,interval){
        Severity: Minor
        Found in src/helper.js - About 35 mins to fix

          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++) {
          Severity: Minor
          Found in src/array.js - About 25 mins to fix

          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);
          Severity: Minor
          Found in src/helper.js - About 25 mins to fix

          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 =".",
          Severity: Minor
          Found in src/numbers.js - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language