phodal/lettuce

View on GitHub

Showing 9 of 25 total issues

Function exports has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {

    grunt.initConfig({

        pkg: grunt.file.readJSON('package.json'),
Severity: Major
Found in Gruntfile.js - About 4 hrs to fix

    Function Class has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
    Open

    Lettuce.prototype.Class = (function (prototype, ownProperty) {
    
        var lettuceClass = function Klass(_superclass, definition) {
    
            function Class() {
    Severity: Minor
    Found in src/class.js - About 2 hrs 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 Class has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Lettuce.prototype.Class = (function (prototype, ownProperty) {
    
        var lettuceClass = function Klass(_superclass, definition) {
    
            function Class() {
    Severity: Minor
    Found in src/class.js - About 1 hr to fix

      Function Klass has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var lettuceClass = function Klass(_superclass, definition) {
      
              function Class() {
                  var self = this instanceof Class ? this : new Basic();
                  self.init.apply(self, arguments);
      Severity: Minor
      Found in src/class.js - About 1 hr to fix

        Function func has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            func: function (s, p1, p2, p3, p4, p5) {
        Severity: Minor
        Found in src/template.js - About 45 mins to fix

          Function defaults has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          Lettuce.defaults = function(obj) {
              if (!Lettuce.isObject(obj)) {
                  return obj;
              }
          
          
          Severity: Minor
          Found in src/helpers.js - About 35 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 extend has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          Lettuce.extend = function (obj) {
              if (!Lettuce.isObject(obj)) {
                  return obj;
              }
              var source, prop;
          Severity: Minor
          Found in src/helpers.js - About 35 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 func has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              func: function (s, p1, p2, p3, p4, p5) {
                  var specialCharMAP = {
                      "\n": "\\n",
                      "\r": "\\r",
                      "\t": "\\t",
          Severity: Minor
          Found in src/template.js - About 35 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

          Avoid too many return statements within this function.
          Open

                      return "_s+='";
          Severity: Major
          Found in src/template.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language