adamSiwiec/fly

View on GitHub

Showing 7 of 7 total issues

Function fly has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    module.exports.fly = function(type, repo) {
        const github = new GitHubApi({
            // Optional args

            protocol: 'https',
Severity: Minor
Found in fly.js - About 1 hr to fix

    Don't use process.exit(); throw an error instead.
    Open

                    process.exit();
    Severity: Minor
    Found in fly.js by eslint

    Disallow process.exit() (no-process-exit)

    The process.exit() method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:

    if (somethingBadHappened) {
        console.error("Something bad happened!");
        process.exit(1);
    }

    This code could appear in any module and will stop the entire application when somethingBadHappened is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:

    if (somethingBadHappened) {
        throw new Error("Something bad happened!");
    }

    By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.

    Rule Details

    This rule aims to prevent the use of process.exit() in Node.js JavaScript. As such, it warns whenever process.exit() is found in code.

    Examples of incorrect code for this rule:

    /*eslint no-process-exit: "error"*/
    
    process.exit(1);
    process.exit(0);

    Examples of correct code for this rule:

    /*eslint no-process-exit: "error"*/
    
    Process.exit();
    var exit = process.exit;

    When Not To Use It

    There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code. Source: http://eslint.org/docs/rules/

    Don't use process.exit(); throw an error instead.
    Open

        process.exit();
    Severity: Minor
    Found in fly-cli.js by eslint

    Disallow process.exit() (no-process-exit)

    The process.exit() method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:

    if (somethingBadHappened) {
        console.error("Something bad happened!");
        process.exit(1);
    }

    This code could appear in any module and will stop the entire application when somethingBadHappened is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:

    if (somethingBadHappened) {
        throw new Error("Something bad happened!");
    }

    By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.

    Rule Details

    This rule aims to prevent the use of process.exit() in Node.js JavaScript. As such, it warns whenever process.exit() is found in code.

    Examples of incorrect code for this rule:

    /*eslint no-process-exit: "error"*/
    
    process.exit(1);
    process.exit(0);

    Examples of correct code for this rule:

    /*eslint no-process-exit: "error"*/
    
    Process.exit();
    var exit = process.exit;

    When Not To Use It

    There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code. Source: http://eslint.org/docs/rules/

    Don't use process.exit(); throw an error instead.
    Open

        process.exit();
    Severity: Minor
    Found in fly-cli.js by eslint

    Disallow process.exit() (no-process-exit)

    The process.exit() method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:

    if (somethingBadHappened) {
        console.error("Something bad happened!");
        process.exit(1);
    }

    This code could appear in any module and will stop the entire application when somethingBadHappened is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:

    if (somethingBadHappened) {
        throw new Error("Something bad happened!");
    }

    By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.

    Rule Details

    This rule aims to prevent the use of process.exit() in Node.js JavaScript. As such, it warns whenever process.exit() is found in code.

    Examples of incorrect code for this rule:

    /*eslint no-process-exit: "error"*/
    
    process.exit(1);
    process.exit(0);

    Examples of correct code for this rule:

    /*eslint no-process-exit: "error"*/
    
    Process.exit();
    var exit = process.exit;

    When Not To Use It

    There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code. Source: http://eslint.org/docs/rules/

    Don't use process.exit(); throw an error instead.
    Open

                    process.exit();
    Severity: Minor
    Found in fly.js by eslint

    Disallow process.exit() (no-process-exit)

    The process.exit() method in Node.js is used to immediately stop the Node.js process and exit. This is a dangerous operation because it can occur in any method at any point in time, potentially stopping a Node.js application completely when an error occurs. For example:

    if (somethingBadHappened) {
        console.error("Something bad happened!");
        process.exit(1);
    }

    This code could appear in any module and will stop the entire application when somethingBadHappened is truthy. This doesn't give the application any chance to respond to the error. It's usually better to throw an error and allow the application to handle it appropriately:

    if (somethingBadHappened) {
        throw new Error("Something bad happened!");
    }

    By throwing an error in this way, other parts of the application have an opportunity to handle the error rather than stopping the application altogether. If the error bubbles all the way up to the process without being handled, then the process will exit and a non-zero exit code will returned, so the end result is the same.

    Rule Details

    This rule aims to prevent the use of process.exit() in Node.js JavaScript. As such, it warns whenever process.exit() is found in code.

    Examples of incorrect code for this rule:

    /*eslint no-process-exit: "error"*/
    
    process.exit(1);
    process.exit(0);

    Examples of correct code for this rule:

    /*eslint no-process-exit: "error"*/
    
    Process.exit();
    var exit = process.exit;

    When Not To Use It

    There may be a part of a Node.js application that is responsible for determining the correct exit code to return upon exiting. In that case, you should turn this rule off to allow proper handling of the exit code. Source: http://eslint.org/docs/rules/

    'person' is already defined.
    Open

                var person = type;
    Severity: Minor
    Found in fly.js by eslint

    disallow variable redeclaration (no-redeclare)

    In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

    Rule Details

    This rule is aimed at eliminating variables that have multiple declarations in the same scope.

    Examples of incorrect code for this rule:

    /*eslint no-redeclare: "error"*/
    
    var a = 3;
    var a = 10;

    Examples of correct code for this rule:

    /*eslint no-redeclare: "error"*/
    
    var a = 3;
    // ...
    a = 10;

    Options

    This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

    builtinGlobals

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

    /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
    
    var Object = 0;

    Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

    /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
    /*eslint-env browser*/
    
    var top = 0;

    The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

    'requestUrl' is already defined.
    Open

                var requestUrl = 'repos';
    Severity: Minor
    Found in fly.js by eslint

    disallow variable redeclaration (no-redeclare)

    In JavaScript, it's possible to redeclare the same variable name using var. This can lead to confusion as to where the variable is actually declared and initialized.

    Rule Details

    This rule is aimed at eliminating variables that have multiple declarations in the same scope.

    Examples of incorrect code for this rule:

    /*eslint no-redeclare: "error"*/
    
    var a = 3;
    var a = 10;

    Examples of correct code for this rule:

    /*eslint no-redeclare: "error"*/
    
    var a = 3;
    // ...
    a = 10;

    Options

    This rule takes one optional argument, an object with a boolean property "builtinGlobals". It defaults to false. If set to true, this rule also checks redeclaration of built-in globals, such as Object, Array, Number...

    builtinGlobals

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

    /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
    
    var Object = 0;

    Examples of incorrect code for the { "builtinGlobals": true } option and the browser environment:

    /*eslint no-redeclare: ["error", { "builtinGlobals": true }]*/
    /*eslint-env browser*/
    
    var top = 0;

    The browser environment has many built-in global variables (for example, top). Some of built-in global variables cannot be redeclared. Source: http://eslint.org/docs/rules/

    Severity
    Category
    Status
    Source
    Language