MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-

View on GitHub
src/renderer/ui/components/settings/tabs/LastFMTab.js

Summary

Maintainability
A
1 hr
Test Coverage

Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const buttonProps = {
      primary: true,
    };
    let authStatus = TranslationProvider.query('lastfm-login-not-authorized');
Severity: Minor
Found in src/renderer/ui/components/settings/tabs/LastFMTab.js - About 1 hr to fix

    Redundant double negation.
    Open

        const authState = !!nextProps.lastFMKey ? 2 : 0;

    disallow unnecessary boolean casts (no-extra-boolean-cast)

    In contexts such as an if statement's test where the result of the expression will already be coerced to a Boolean, casting to a Boolean via double negation (!!) or a Boolean call is unnecessary. For example, these if statements are equivalent:

    if (!!foo) {
        // ...
    }
    
    if (Boolean(foo)) {
        // ...
    }
    
    if (foo) {
        // ...
    }

    Rule Details

    This rule disallows unnecessary boolean casts.

    Examples of incorrect code for this rule:

    /*eslint no-extra-boolean-cast: "error"*/
    
    var foo = !!!bar;
    
    var foo = !!bar ? baz : bat;
    
    var foo = Boolean(!!bar);
    
    var foo = new Boolean(!!bar);
    
    if (!!foo) {
        // ...
    }
    
    if (Boolean(foo)) {
        // ...
    }
    
    while (!!foo) {
        // ...
    }
    
    do {
        // ...
    } while (Boolean(foo));
    
    for (; !!foo; ) {
        // ...
    }

    Examples of correct code for this rule:

    /*eslint no-extra-boolean-cast: "error"*/
    
    var foo = !!bar;
    var foo = Boolean(bar);
    
    function foo() {
        return !!bar;
    }
    
    var foo = bar ? !!baz : !!bat;

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

    Redundant double negation.
    Open

          authState: !!props.lastFMKey ? 2 : 0,

    disallow unnecessary boolean casts (no-extra-boolean-cast)

    In contexts such as an if statement's test where the result of the expression will already be coerced to a Boolean, casting to a Boolean via double negation (!!) or a Boolean call is unnecessary. For example, these if statements are equivalent:

    if (!!foo) {
        // ...
    }
    
    if (Boolean(foo)) {
        // ...
    }
    
    if (foo) {
        // ...
    }

    Rule Details

    This rule disallows unnecessary boolean casts.

    Examples of incorrect code for this rule:

    /*eslint no-extra-boolean-cast: "error"*/
    
    var foo = !!!bar;
    
    var foo = !!bar ? baz : bat;
    
    var foo = Boolean(!!bar);
    
    var foo = new Boolean(!!bar);
    
    if (!!foo) {
        // ...
    }
    
    if (Boolean(foo)) {
        // ...
    }
    
    while (!!foo) {
        // ...
    }
    
    do {
        // ...
    } while (Boolean(foo));
    
    for (; !!foo; ) {
        // ...
    }

    Examples of correct code for this rule:

    /*eslint no-extra-boolean-cast: "error"*/
    
    var foo = !!bar;
    var foo = Boolean(bar);
    
    function foo() {
        return !!bar;
    }
    
    var foo = bar ? !!baz : !!bat;

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

    JSX not allowed in files with extension '.js'
    Open

          <SettingsTabWrapper>

    For more information visit Source: http://eslint.org/docs/rules/

    'setSetting' PropType is defined but prop is never used
    Open

        setSetting: PropTypes.func.isRequired,

    For more information visit Source: http://eslint.org/docs/rules/

    There are no issues that match your filters.

    Category
    Status