drinkingvideogames/mixer

View on GitHub

Showing 57 of 57 total issues

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

const before = {
create:
[ commonHooks.requireAuth(),
commonHooks.embellishUser(),
commonHooks.setCurrentDateHook('createdAt'),
Severity: Major
Found in api/services/asset/hooks.js and 1 other location - About 1 hr to fix
api/services/game/hooks.js on lines 17..26

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

before: {
create:
[ commonHooks.requireAuth(),
commonHooks.embellishUser(),
commonHooks.setCurrentDateHook('createdAt'),
Severity: Major
Found in api/services/game/hooks.js and 1 other location - About 1 hr to fix
api/services/asset/hooks.js on lines 3..12

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

    {this.props.user.has('email') ? '' : <li onClick={this.openRegisterModal.bind(this)}><a>Register</a></li>}
    Severity: Major
    Found in src/components/header.jsx and 1 other location - About 1 hr to fix
    src/components/header.jsx on lines 139..139

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

    {this.props.user.has('email') ? '' : <li onClick={this.openLoginModal.bind(this)}><a>Login</a></li>}
    Severity: Major
    Found in src/components/header.jsx and 1 other location - About 1 hr to fix
    src/components/header.jsx on lines 138..138

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

    module.exports = function () {
    const app = this
     
    let options = {
    Model: model,
    Severity: Minor
    Found in api/services/user/index.js - About 1 hr to fix

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

      const games = (state = init, action) => {
      switch (action.type) {
      case constants.game.ADD.SUCCESS:
      return state.push(game(undefined, action))
      default:
      Severity: Major
      Found in src/reducers/games.js and 1 other location - About 1 hr to fix
      src/reducers/genres.js on lines 15..22

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

      const genres = (state = init, action) => {
      switch (action.type) {
      case constants.genre.ADD.SUCCESS:
      return state.push(genre(undefined, action))
      default:
      Severity: Major
      Found in src/reducers/genres.js and 1 other location - About 1 hr to fix
      src/reducers/games.js on lines 26..33

      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

      Function upload has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function upload (service, file) {
      function getBlob (file) {
      return new Promise((resolve, reject) => {
      const xhr = new window.XMLHttpRequest()
      xhr.open('GET', file.preview, true)
      Severity: Minor
      Found in src/sagas/lib/upload.js - About 1 hr to fix

        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 iconDrop = iconImage && iconImage.preview
        ? <img className='image-preview' src={iconImage.preview} />
        : <div className='image-preview'>Click or drop to upload Icon Image</div>
        Severity: Major
        Found in src/components/admin/modals/new-game.jsx and 1 other location - About 1 hr to fix
        src/components/admin/modals/new-game.jsx on lines 25..27

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

        render () {
        let input = {}
        return (
        <div id='newGenreModal' className='modal modal-fixed-footer'>
        <div className='modal-content'>
        Severity: Minor
        Found in src/components/admin/modals/new-genre.jsx - About 1 hr to fix

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

          const imageDrop = image && image.preview
          ? <img className='image-preview' src={image.preview} />
          : <div className='image-preview'>Click or drop to upload Main Image</div>
          Severity: Major
          Found in src/components/admin/modals/new-game.jsx and 1 other location - About 1 hr to fix
          src/components/admin/modals/new-game.jsx on lines 22..24

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

          render () {
          const usersGames = (
          this.getGamesList().map((game, i) =>
          <TableRow key={i}>
          <TableRowColumn>{i + 1}</TableRowColumn>
          Severity: Minor
          Found in src/components/user/users-games-table.jsx - About 1 hr to fix

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

            module.exports = function () {
            const app = this
            const imgUploadsDir = path.join(__dirname, '..', '..', '..', 'public', 'uploads', 'imgs')
            const directories = {
            icons: path.join(imgUploadsDir, 'icons'),
            Severity: Minor
            Found in api/services/game/index.js - About 1 hr to fix

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

              render () {
              const users = (
              this.props.users.toArray().map((user, i) =>
              <TableRow key={i}>
              <TableRowColumn>{i + 1}</TableRowColumn>
              Severity: Minor
              Found in src/components/user/users-table.jsx - About 1 hr to fix

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

                <li className='waves-effect waves-light'>
                <a className='modal-trigger' href='#newGameModal'><i className='material-icons'>games</i>New Game</a>
                </li>
                Severity: Major
                Found in src/components/admin/toolbar.jsx and 2 other locations - About 1 hr to fix
                src/components/admin/toolbar.jsx on lines 11..13
                src/components/admin/toolbar.jsx on lines 17..19
                Severity
                Category
                Status
                Source
                Language