phodal/lettuce

View on GitHub

Showing 25 of 25 total issues

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 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

    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 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

    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