nukeop/nuclear

View on GitHub

Showing 208 of 208 total issues

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

      <Tab.Pane attached={false}>
        <PlaylistResults
          playlistSearchStarted={this.props.playlistSearchStarted}
          playlistSearchResults={this.props.playlistSearchResults}
          addToQueue={this.props.addToQueue}
Severity: Major
Found in app/components/SearchResults/index.js and 1 other location - About 4 hrs to fix
app/components/SearchResults/AllResults/index.js on lines 47..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        <div className={styles.row}>
          <PlaylistResults
            playlistSearchStarted={this.props.playlistSearchStarted}
            playlistSearchResults={this.props.playlistSearchResults}
            addToQueue={this.props.addToQueue}
Severity: Major
Found in app/components/SearchResults/AllResults/index.js and 1 other location - About 4 hrs to fix
app/components/SearchResults/index.js on lines 98..108

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 115.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File App.js has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import FontAwesome from 'react-fontawesome';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { NavLink, withRouter } from 'react-router-dom';
Severity: Minor
Found in app/App.js - About 4 hrs to fix

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

        if (
          this.props.scrobbling.lastFmScrobblingEnabled &&
          this.props.scrobbling.lastFmSessionKey
        ) {
          let currentSong = this.props.queue.queueItems[
    Severity: Major
    Found in app/App.js and 1 other location - About 3 hrs to fix
    app/containers/SoundContainer/index.js on lines 73..85

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 111.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        if (
          this.props.scrobbling.lastFmScrobblingEnabled &&
          this.props.scrobbling.lastFmSessionKey
        ) {
          let currentSong = this.props.queue.queueItems[
    Severity: Major
    Found in app/containers/SoundContainer/index.js and 1 other location - About 3 hrs to fix
    app/App.js on lines 88..100

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 111.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function TrackPopupContainer has 95 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const TrackPopupContainer = props => {
      const {
        trigger,
        track,
        artist,
    Severity: Major
    Found in app/containers/TrackPopupContainer/index.js - About 3 hrs to fix

      File index.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import logger from 'electron-timber';
      import core from 'nuclear-core';
      import _ from 'lodash';
      import globals from '../globals';
      
      
      Severity: Minor
      Found in app/actions/index.js - About 3 hrs to fix

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

        const EmptyState = () => {
          const { t } = useTranslation('downloads');
        
          return (
            <div className={styles.empty_state}>
        Severity: Major
        Found in app/components/Downloads/index.js and 1 other location - About 3 hrs to fix
        app/components/FavoriteTracksView/index.js on lines 13..23

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        const EmptyState = () => {
          const { t } = useTranslation('favorites');
        
          return (
            <div className={styles.empty_state} >
        Severity: Major
        Found in app/components/FavoriteTracksView/index.js and 1 other location - About 3 hrs to fix
        app/components/Downloads/index.js on lines 11..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 107.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        app.on('ready', () => {
          createWindow();
        
          (async () => {
            const availablePort = await getPort({ port: getPort.makeRange(3000, 3100) });
        Severity: Major
        Found in server/main.dev.linux.js and 1 other location - About 3 hrs to fix
        server/main.dev.js on lines 136..146

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 103.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

        app.on('ready', () => {
          createWindow();
        
          (async () => {
            const availablePort = await getPort({ port: getPort.makeRange(3000, 3100) });
        Severity: Major
        Found in server/main.dev.js and 1 other location - About 3 hrs to fix
        server/main.dev.linux.js on lines 176..186

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 103.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function createWindow has 82 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function createWindow () {
          win = new BrowserWindow({
            width: 1366,
            height: 768,
            frame: !getOption('framelessWindow'),
        Severity: Major
        Found in server/main.dev.js - About 3 hrs to fix

          Function playerRouter has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function playerRouter() {
          
            const router = express.Router();
            
            swagger.swaggerize(router);
          Severity: Major
          Found in server/http/api/player.js - About 3 hrs to fix

            Function initSwagger has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function initSwagger(app) {
              swagger.reset();
              swagger.initialise(app, {
                title: 'Nuclear REST API',
                description: 'This Api allow you to remotly control nuclear desktop app',
            Severity: Major
            Found in server/http/lib/swagger.js - About 3 hrs to fix

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

              export function loadBestNewTracks() {
                return dispatch => {
                  dispatch(loadBestNewAlbumsStart());
                  getBestNewTracks()
                    .then(tracks => {
              Severity: Major
              Found in app/actions/dashboard.js and 1 other location - About 3 hrs to fix
              app/actions/dashboard.js on lines 87..99

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 96.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

              export function loadBestNewAlbums() {
                return dispatch => {
                  dispatch(loadBestNewAlbumsStart());
                  getBestNewAlbums()
                    .then(albums => {
              Severity: Major
              Found in app/actions/dashboard.js and 1 other location - About 3 hrs to fix
              app/actions/dashboard.js on lines 120..132

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 96.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function createWindow has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function createWindow() {
                logger.log('Electron is ready, creating a window');
                win = new BrowserWindow({
                  width: 1366,
                  height: 768,
              Severity: Major
              Found in server/main.dev.linux.js - About 3 hrs to fix

                File index.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from 'react';
                import PropTypes from 'prop-types';
                import { Button, Input, Radio, Segment, Dropdown } from 'semantic-ui-react';
                import Range from 'react-range-progress';
                import cx from 'classnames';
                Severity: Minor
                Found in app/components/Settings/index.js - About 3 hrs to fix

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

                  function reduceArtistInfoSearchSuccess (state, action) {
                    return Object.assign({}, state, {
                      artistDetails: Object.assign({}, state.artistDetails, {
                        [`${action.payload.id}`]: Object.assign({}, action.payload.info, {
                          loading: false
                  Severity: Major
                  Found in app/reducers/search.js and 1 other location - About 2 hrs to fix
                  app/reducers/search.js on lines 66..74

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 93.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  function reduceAlbumInfoSearchSuccess (state, action) {
                    return Object.assign({}, state, {
                      albumDetails: Object.assign({}, state.albumDetails, {
                        [`${action.payload.id}`]: Object.assign({}, action.payload.info, {
                          loading: false
                  Severity: Major
                  Found in app/reducers/search.js and 1 other location - About 2 hrs to fix
                  app/reducers/search.js on lines 86..94

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 93.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language