renyard/validity

View on GitHub
Gruntfile.js

Summary

Maintainability
B
5 hrs
Test Coverage

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

module.exports = function (grunt) {
    "use strict";

    var merge = require("merge"),
        config = {},
Severity: Major
Found in Gruntfile.js - About 5 hrs to fix

    'process' is not defined.
    Open

                        client_id: process.env.CLIENT_ID,
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'module' is not defined.
    Open

    module.exports = function (grunt) {
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'process' is not defined.
    Open

                        client_secret: process.env.CLIENT_SECRET,
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'process' is not defined.
    Open

                        refresh_token: process.env.REFRESH_TOKEN,
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'process' is not defined.
    Open

                gaid: process.env.GAID || "",
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'require' is not defined.
    Open

        var merge = require("merge"),
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    'require' is not defined.
    Open

        require("load-grunt-tasks")(grunt);
    Severity: Minor
    Found in Gruntfile.js by eslint

    Disallow Undeclared Variables (no-undef)

    This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

    Rule Details

    Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

    Examples of incorrect code for this rule:

    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    Examples of correct code for this rule with global declaration:

    /*global someFunction b:true*/
    /*eslint no-undef: "error"*/
    
    var a = someFunction();
    b = 10;

    The b:true syntax in /*global */ indicates that assignment to b is correct.

    Examples of incorrect code for this rule with global declaration:

    /*global b*/
    /*eslint no-undef: "error"*/
    
    b = 10;

    By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

    Options

    • typeof set to true will warn for variables used inside typeof check (Default false).

    typeof

    Examples of correct code for the default { "typeof": false } option:

    /*eslint no-undef: "error"*/
    
    if (typeof UndefinedIdentifier === "undefined") {
        // do something ...
    }

    You can use this option if you want to prevent typeof check on a variable which has not been declared.

    Examples of incorrect code for the { "typeof": true } option:

    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Examples of correct code for the { "typeof": true } option with global declaration:

    /*global a*/
    /*eslint no-undef: ["error", { "typeof": true }] */
    
    if(typeof a === "string"){}

    Environments

    For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

    browser

    Examples of correct code for this rule with browser environment:

    /*eslint no-undef: "error"*/
    /*eslint-env browser*/
    
    setTimeout(function() {
        alert("Hello");
    });

    node

    Examples of correct code for this rule with node environment:

    /*eslint no-undef: "error"*/
    /*eslint-env node*/
    
    var fs = require("fs");
    module.exports = function() {
        console.log(fs);
    };

    When Not To Use It

    If explicit declaration of global variables is not to your taste.

    Compatibility

    This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

    Closing curly brace appears on the same line as the subsequent block.
    Open

        } catch (e) {}
    Severity: Minor
    Found in Gruntfile.js by eslint

    Require Brace Style (brace-style)

    Brace style is closely related to indent style in programming and describes the placement of braces relative to their control statement and body. There are probably a dozen, if not more, brace styles in the world.

    The one true brace style is one of the most common brace styles in JavaScript, in which the opening brace of a block is placed on the same line as its corresponding statement or declaration. For example:

    if (foo) {
      bar();
    } else {
      baz();
    }

    One common variant of one true brace style is called Stroustrup, in which the else statements in an if-else construct, as well as catch and finally, must be on its own line after the preceding closing brace. For example:

    if (foo) {
      bar();
    }
    else {
      baz();
    }

    Another style is called Allman, in which all the braces are expected to be on their own lines without any extra indentation. For example:

    if (foo)
    {
      bar();
    }
    else
    {
      baz();
    }

    While no style is considered better than the other, most developers agree that having a consistent style throughout a project is important for its long-term maintainability.

    Rule Details

    This rule enforces consistent brace style for blocks.

    Options

    This rule has a string option:

    • "1tbs" (default) enforces one true brace style
    • "stroustrup" enforces Stroustrup style
    • "allman" enforces Allman style

    This rule has an object option for an exception:

    • "allowSingleLine": true (default false) allows the opening and closing braces for a block to be on the same line

    1tbs

    Examples of incorrect code for this rule with the default "1tbs" option:

    /*eslint brace-style: "error"*/
    
    function foo()
    {
      return true;
    }
    
    if (foo)
    {
      bar();
    }
    
    try
    {
      somethingRisky();
    } catch(e)
    {
      handleError();
    }
    
    if (foo) {
      bar();
    }
    else {
      baz();
    }

    Examples of correct code for this rule with the default "1tbs" option:

    /*eslint brace-style: "error"*/
    
    function foo() {
      return true;
    }
    
    if (foo) {
      bar();
    }
    
    if (foo) {
      bar();
    } else {
      baz();
    }
    
    try {
      somethingRisky();
    } catch(e) {
      handleError();
    }
    
    // when there are no braces, there are no problems
    if (foo) bar();
    else if (baz) boom();

    Examples of correct code for this rule with the "1tbs", { "allowSingleLine": true } options:

    /*eslint brace-style: ["error", "1tbs", { "allowSingleLine": true }]*/
    
    function nop() { return; }
    
    if (foo) { bar(); }
    
    if (foo) { bar(); } else { baz(); }
    
    try { somethingRisky(); } catch(e) { handleError(); }

    stroustrup

    Examples of incorrect code for this rule with the "stroustrup" option:

    /*eslint brace-style: ["error", "stroustrup"]*/
    
    function foo()
    {
      return true;
    }
    
    if (foo)
    {
      bar();
    }
    
    try
    {
      somethingRisky();
    } catch(e)
    {
      handleError();
    }
    
    if (foo) {
      bar();
    } else {
      baz();
    }

    Examples of correct code for this rule with the "stroustrup" option:

    /*eslint brace-style: ["error", "stroustrup"]*/
    
    function foo() {
      return true;
    }
    
    if (foo) {
      bar();
    }
    
    if (foo) {
      bar();
    }
    else {
      baz();
    }
    
    try {
      somethingRisky();
    }
    catch(e) {
      handleError();
    }
    
    // when there are no braces, there are no problems
    if (foo) bar();
    else if (baz) boom();

    Examples of correct code for this rule with the "stroustrup", { "allowSingleLine": true } options:

    /*eslint brace-style: ["error", "stroustrup", { "allowSingleLine": true }]*/
    
    function nop() { return; }
    
    if (foo) { bar(); }
    
    if (foo) { bar(); }
    else { baz(); }
    
    try { somethingRisky(); }
    catch(e) { handleError(); }

    allman

    Examples of incorrect code for this rule with the "allman" option:

    /*eslint brace-style: ["error", "allman"]*/
    
    function foo() {
      return true;
    }
    
    if (foo)
    {
      bar(); }
    
    try
    {
      somethingRisky();
    } catch(e)
    {
      handleError();
    }
    
    if (foo) {
      bar();
    } else {
      baz();
    }

    Examples of correct code for this rule with the "allman" option:

    /*eslint brace-style: ["error", "allman"]*/
    
    function foo()
    {
      return true;
    }
    
    if (foo)
    {
      bar();
    }
    
    if (foo)
    {
      bar();
    }
    else
    {
      baz();
    }
    
    try
    {
      somethingRisky();
    }
    catch(e)
    {
      handleError();
    }
    
    // when there are no braces, there are no problems
    if (foo) bar();
    else if (baz) boom();

    Examples of correct code for this rule with the "allman", { "allowSingleLine": true } options:

    /*eslint brace-style: ["error", "allman", { "allowSingleLine": true }]*/
    
    function nop() { return; }
    
    if (foo) { bar(); }
    
    if (foo) { bar(); }
    else { baz(); }
    
    try { somethingRisky(); }
    catch(e) { handleError(); }

    When Not To Use It

    If you don't want to enforce a particular brace style, don't enable this rule.

    Further Reading

    There are no issues that match your filters.

    Category
    Status