TinyMan/node-jeanne

View on GitHub
lib/mumble/extensions/phone.js

Summary

Maintainability
A
1 hr
Test Coverage

Function init has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    init: async stumble => {
        return new Error('Not implemented')
        try {
            const phone = new sylvia()
            stumble.space.set('phone', phone)
Severity: Minor
Found in lib/mumble/extensions/phone.js - About 1 hr to fix

    Unreachable code.
    Open

            try {
    Severity: Minor
    Found in lib/mumble/extensions/phone.js by eslint

    disallow unreachable code after return, throw, continue, and break statements (no-unreachable)

    Because the return, throw, break, and continue statements unconditionally exit a block of code, any statements after them cannot be executed. Unreachable statements are usually a mistake.

    function fn() {
        x = 1;
        return x;
        x = 3; // this will never execute
    }

    Rule Details

    This rule disallows unreachable code after return, throw, continue, and break statements.

    Examples of incorrect code for this rule:

    /*eslint no-unreachable: "error"*/
    
    function foo() {
        return true;
        console.log("done");
    }
    
    function bar() {
        throw new Error("Oops!");
        console.log("done");
    }
    
    while(value) {
        break;
        console.log("done");
    }
    
    throw new Error("Oops!");
    console.log("done");
    
    function baz() {
        if (Math.random() < 0.5) {
            return;
        } else {
            throw new Error();
        }
        console.log("done");
    }
    
    for (;;) {}
    console.log("done");

    Examples of correct code for this rule, because of JavaScript function and variable hoisting:

    /*eslint no-unreachable: "error"*/
    
    function foo() {
        return bar();
        function bar() {
            return 1;
        }
    }
    
    function bar() {
        return x;
        var x;
    }
    
    switch (foo) {
        case 1:
            break;
            var x;
    }

    Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status