drinkingvideogames/mixer

View on GitHub
src/components/user/profile.jsx

Summary

Maintainability
C
7 hrs
Test Coverage

Showing 6 of 6 total issues

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

render () {
const verifySnackbar = (
!this.props.user.get('verified') ? (
<Snackbar
open
Severity: Minor
Found in src/components/user/profile.jsx - About 1 hr to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    componentDidUpdate () {
    if (!this.props.user || !this.props.user.has('email')) return this.props.router.push('/')
    }
    Severity: Major
    Found in src/components/user/profile.jsx and 1 other location - About 1 hr to fix
    src/components/user/profile.jsx on lines 11..13

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    componentDidMount () {
    if (!this.props.user || !this.props.user.has('email')) return this.props.router.push('/')
    }
    Severity: Major
    Found in src/components/user/profile.jsx and 1 other location - About 1 hr to fix
    src/components/user/profile.jsx on lines 15..17

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const usersGamesTable = this.props.user.get('roles').includes('admin') ? (
    <div className='row'>
    <UsersGamesTable />
    </div>
    ) : ''
    Severity: Major
    Found in src/components/user/profile.jsx and 1 other location - About 1 hr to fix
    src/components/user/profile.jsx on lines 34..38

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const usersTable = this.props.user.get('roles').includes('superadmin') ? (
    <div className='row'>
    <UsersTable />
    </div>
    ) : ''
    Severity: Major
    Found in src/components/user/profile.jsx and 1 other location - About 1 hr to fix
    src/components/user/profile.jsx on lines 40..44

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const mapDispatchToProps = (dispatch) => {
    return {
    userLogout: () => { dispatch({ type: 'USER_LOGOUT', payload: {} }) }
    }
    }
    Severity: Minor
    Found in src/components/user/profile.jsx and 1 other location - About 35 mins to fix
    src/components/user/users-table.jsx on lines 52..56

    There are no issues that match your filters.

    Category
    Status