nukeop/nuclear

View on GitHub

Showing 239 of 239 total issues

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

export function formatDuration(duration) {
  let sec_num = parseInt(duration, 10);
  let hours   = Math.floor(sec_num / 3600);
  let minutes = Math.floor((sec_num - (hours * 3600)) / 60);
  let seconds = sec_num - (hours * 3600) - (minutes * 60);
Severity: Major
Found in packages/ui/lib/utils.js and 1 other location - About 1 day to fix
packages/app/app/utils.js on lines 3..24

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 204.

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 formatDuration(duration) {
  let secNum = parseInt(duration, 10);
  let hours = Math.floor(secNum / 3600);
  let minutes = Math.floor((secNum - (hours * 3600)) / 60);
  let seconds = secNum - (hours * 3600) - (minutes * 60);
Severity: Major
Found in packages/app/app/utils.js and 1 other location - About 1 day to fix
packages/ui/lib/utils.js on lines 1..22

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 204.

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

storiesOf('QueueItem', module)
  .add('Basic', () => {
    return (
      <div style={{
        background: '#282a36',
Severity: Major
Found in packages/ui/stories/index.stories.js and 1 other location - About 5 hrs to fix
packages/ui/stories/index.stories.js on lines 38..139

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 152.

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 362 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 packages/app/app/App.js - About 4 hrs to fix

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

    import logger from 'electron-timber';
    import { LastFmApi } from '@nuclear/core';
    import _ from 'lodash';
    import artPlaceholder from '../../resources/media/art_placeholder.png';
    import globals from '../globals';
    Severity: Minor
    Found in packages/app/app/actions/index.js - About 4 hrs to fix

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

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

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

            <section className={styles.plugin_settings_section}>
              <Header>{t('lyrics-providers')}</Header>
              <hr />
              <Segment>
                <label>
        Severity: Major
        Found in packages/app/app/components/PluginsView/index.js and 2 other locations - About 4 hrs to fix
        packages/app/app/components/PluginsView/index.js on lines 31..45
        packages/app/app/components/PluginsView/index.js on lines 47..61

        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 120.

        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 3 locations. Consider refactoring.
        Open

            <section className={styles.plugin_settings_section}>
              <Header>{t('stream-providers')}</Header>
              <hr />
              <Segment>
                <label>
        Severity: Major
        Found in packages/app/app/components/PluginsView/index.js and 2 other locations - About 4 hrs to fix
        packages/app/app/components/PluginsView/index.js on lines 47..61
        packages/app/app/components/PluginsView/index.js on lines 63..77

        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 120.

        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 3 locations. Consider refactoring.
        Open

            <section className={styles.plugin_settings_section}>
              <Header>{t('meta-providers')}</Header>
              <hr />
              <Segment>
                <label>
        Severity: Major
        Found in packages/app/app/components/PluginsView/index.js and 2 other locations - About 4 hrs to fix
        packages/app/app/components/PluginsView/index.js on lines 31..45
        packages/app/app/components/PluginsView/index.js on lines 63..77

        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 120.

        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}
        packages/app/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

        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 packages/app/app/components/SearchResults/index.js and 1 other location - About 4 hrs to fix
        packages/app/app/components/SearchResults/AllResults/index.js on lines 50..60

        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 3 locations. Consider refactoring.
        Open

        const EmptyState = () => {
          const { t } = useTranslation('favorite-albums');
          return (
            <div className={styles.empty_state}>
              <Icon name='star'/>
        Severity: Major
        Found in packages/app/app/components/FavoriteAlbumsView/index.js and 2 other locations - About 3 hrs to fix
        packages/app/app/components/Downloads/index.js on lines 12..22
        packages/app/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 105.

        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 3 locations. Consider refactoring.
        Open

        export const EmptyState = () => {
          const { t } = useTranslation('favorites');
        
          return (
            <div className={styles.empty_state} >
        Severity: Major
        Found in packages/app/app/components/FavoriteTracksView/index.js and 2 other locations - About 3 hrs to fix
        packages/app/app/components/Downloads/index.js on lines 12..22
        packages/app/app/components/FavoriteAlbumsView/index.js on lines 13..22

        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 105.

        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 3 locations. Consider refactoring.
        Open

        const EmptyState = () => {
          const { t } = useTranslation('downloads');
        
          return (
            <div className={styles.empty_state}>
        Severity: Major
        Found in packages/app/app/components/Downloads/index.js and 2 other locations - About 3 hrs to fix
        packages/app/app/components/FavoriteAlbumsView/index.js on lines 13..22
        packages/app/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 105.

        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 84 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 packages/app/server/main.dev.js - About 3 hrs to fix

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

          const TrackPopupContainer = props => {
            const {
              trigger,
              track,
              artist,
          Severity: Major
          Found in packages/app/app/containers/TrackPopupContainer/index.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 packages/app/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 packages/app/server/http/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 packages/app/app/actions/dashboard.js and 1 other location - About 3 hrs to fix
                packages/app/app/actions/dashboard.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 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 packages/app/app/actions/dashboard.js and 1 other location - About 3 hrs to fix
                packages/app/app/actions/dashboard.js on lines 121..133

                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

                Severity
                Category
                Status
                Source
                Language