nukeop/nuclear

View on GitHub

Showing 285 of 285 total issues

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

  router.post('/', validate(updateEqualizerSchema), (req, res) => {
    rendererWindow.send(IpcEvents.EQUALIZER_UPDATE, req.body.values);
    res.send();
  })
    .describe(getStandardDescription({
Severity: Major
Found in packages/main/src/services/http/server/api/equalizer.ts and 2 other locations - About 2 hrs to fix
packages/main/src/services/http/server/api/player.ts on lines 82..92
packages/main/src/services/http/server/api/player.ts on lines 94..104

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

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

  router
    .post('/seek', validate(seekSchema), (req, res) => {
      rendererWindow.send(IpcEvents.SEEK, req.body.value);
      res.send();
    })
Severity: Major
Found in packages/main/src/services/http/server/api/player.ts and 2 other locations - About 2 hrs to fix
packages/main/src/services/http/server/api/equalizer.ts on lines 26..33
packages/main/src/services/http/server/api/player.ts on lines 82..92

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

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

  router
    .post('/volume', validate(volumeSchema), (req, res) => {
      rendererWindow.send(IpcEvents.VOLUME, req.body.value);
      res.send();
    })
Severity: Major
Found in packages/main/src/services/http/server/api/player.ts and 2 other locations - About 2 hrs to fix
packages/main/src/services/http/server/api/equalizer.ts on lines 26..33
packages/main/src/services/http/server/api/player.ts on lines 94..104

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

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

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

      <ContextPopup
        trigger={<button>Test</button>}
        artist='Test artist'
        title='Test title'
      >
Severity: Major
Found in packages/ui/stories/contextPopup.stories.js and 1 other location - About 2 hrs to fix
packages/ui/stories/contextPopup.stories.js on lines 33..52

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

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

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

      <ContextPopup
        trigger={<button>Test</button>}
        artist='Test artist'
        title='Test title'
        thumb='https://i.imgur.com/4euOws2.jpg'
Severity: Major
Found in packages/ui/stories/contextPopup.stories.js and 1 other location - About 2 hrs to fix
packages/ui/stories/contextPopup.stories.js on lines 10..28

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

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 render has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      compact,
      items,
      settings,
Severity: Major
Found in packages/app/app/components/PlayQueue/index.js - About 2 hrs to fix

    Function swaggerRouter has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function swaggerRouter(store: Store): Router {
      const router = express.Router();
    
      router.get('/swagger.json', (req, res) => {
        res.json(swaggerJson);
    Severity: Major
    Found in packages/main/src/services/http/server/api/swagger.ts - About 2 hrs to fix

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

              <div className={styles.error_overlay}>
                <div className={styles.error_message}>{error.message}</div>
                <div className={styles.error_details}>{error.details}</div>
              </div>
      Severity: Major
      Found in packages/ui/lib/components/QueueItem/index.js and 1 other location - About 2 hrs to fix
      packages/ui/lib/components/ToastContainer/Toast/index.js on lines 32..37

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

      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.toast_text}
              >
                <div className={styles.title}>{ props.title }</div>
                <div className={styles.details}>{ props.details }</div>
      Severity: Major
      Found in packages/ui/lib/components/ToastContainer/Toast/index.js and 1 other location - About 2 hrs to fix
      packages/ui/lib/components/QueueItem/index.js on lines 66..69

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

      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 index.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import PropTypes from 'prop-types';
      import Img from 'react-image';
      import _ from 'lodash';
      import { Dimmer, Icon, Loader } from 'semantic-ui-react';
      Severity: Minor
      Found in packages/app/app/components/AlbumView/index.js - About 2 hrs to fix

        File search.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import logger from 'electron-timber';
        import { rest } 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/search.js - About 2 hrs to fix

          App has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @withTranslation('app')
          class App extends React.PureComponent {
            constructor(props) {
              super(props);
            }
          Severity: Minor
          Found in packages/app/app/App.js - About 2 hrs to fix

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

            module.exports = (env: BuildEnv): import('webpack').Configuration => {
              if (!env.TARGET) {
                env.TARGET = osMapper[os.platform() as string];
              }
            
            
            Severity: Major
            Found in packages/main/webpack.config.ts - About 2 hrs to fix

              Function EqualizerReducer has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function EqualizerReducer(state = getInitialState(), action) {
                let newState;
              
                switch (action.type) {
                case CHANGE_VALUE: {
              Severity: Major
              Found in packages/app/app/reducers/equalizer.js - About 2 hrs to fix

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

                const getArtistReleases = (id: string): Promise<MusicbrainzArtist> =>
                  new Promise((resolve, reject) => {
                    nb.artist(id, { inc: 'releases+release-groups' }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 56..61
                packages/core/src/rest/Musicbrainz.ts on lines 63..68

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

                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 getReleaseGroupDetails = (releaseGroupId: string): Promise<MusicbrainzReleaseGroup> =>
                  new Promise((resolve, reject) => {
                    nb.releaseGroup(releaseGroupId, { inc: 'releases' }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 49..54
                packages/core/src/rest/Musicbrainz.ts on lines 63..68

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

                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 trackSearch = (terms: string): Promise<MusicbrainzTrackResponse> =>
                  new Promise((resolve, reject) => {
                    nb.search('work', { work: terms }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 15..20
                packages/core/src/rest/Musicbrainz.ts on lines 22..27

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

                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 releaseSearch = (terms: string): Promise<MusicbrainzReleaseGroupResponse> =>
                  new Promise((resolve, reject) => {
                    nb.search('release-group', { release: terms }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 15..20
                packages/core/src/rest/Musicbrainz.ts on lines 29..34

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

                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 artistSearch = (terms: string): Promise<MusicbrainzArtistResponse> =>
                  new Promise((resolve, reject) => {
                    nb.search('artist', { artist: terms }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 22..27
                packages/core/src/rest/Musicbrainz.ts on lines 29..34

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

                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 getReleaseDetails = (releaseId: string): Promise<MusicbrainzRelease> =>
                  new Promise((resolve, reject) => {
                    nb.release(releaseId, { inc: 'artists+recordings+genres' }, (err, response) => {
                      err ? reject(err) : resolve(response);
                    });
                Severity: Major
                Found in packages/core/src/rest/Musicbrainz.ts and 2 other locations - About 2 hrs to fix
                packages/core/src/rest/Musicbrainz.ts on lines 49..54
                packages/core/src/rest/Musicbrainz.ts on lines 56..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 81.

                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