nukeop/nuclear

View on GitHub

Showing 245 of 245 total issues

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

function getOption(key) {
  const settings = store.get('settings') || {};
  let value = settings[key];

  if (typeof value === 'undefined') {
Severity: Major
Found in packages/app/app/persistence/store.js and 1 other location - About 2 hrs to fix
packages/app/server/store.js on lines 10..18

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

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 getOption(key) {
  let settings = store.get('settings') || {};
  let value = settings[key];
  if (typeof value === 'undefined') {
    value = _.find(options, { name: key }).default;
Severity: Major
Found in packages/app/server/store.js and 1 other location - About 2 hrs to fix
packages/app/app/persistence/store.js on lines 37..46

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

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

      router
        .get('/now-playing', (req, res, next) => {
          getPlayingStatus()
            .then(res.json.bind(res))
            .catch(next);
    Severity: Major
    Found in packages/app/server/http/api/player.js and 1 other location - About 2 hrs to fix
    packages/app/server/http/api/queue.js on lines 16..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 79.

    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

        ) {
          let currentSong = this.props.queue.queueItems[
            this.props.queue.currentSong
          ];
          this.props.actions.scrobbleAction(
    Severity: Major
    Found in packages/app/app/containers/SoundContainer/index.js and 1 other location - About 2 hrs to fix
    packages/app/app/App.js on lines 92..101

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

    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

      scrobbleLastFm () {
        let currentSong = this.props.queue.queueItems[
          this.props.queue.currentSong
        ];
        this.props.actions.updateNowPlayingAction(
    Severity: Major
    Found in packages/app/app/App.js and 1 other location - About 2 hrs to fix
    packages/app/app/containers/SoundContainer/index.js on lines 66..75

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

    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 removeFavoriteAlbum(album) {
      const favorites = store.get('favorites');
      _.remove(favorites.albums, { id: album.id });
      store.set('favorites', favorites);
    
    
    Severity: Major
    Found in packages/app/app/actions/favorites.js and 1 other location - About 2 hrs to fix
    packages/app/app/actions/favorites.js on lines 35..44

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

    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

      router.get('/', (req, res, next) => {
        getQueue()
          .then(res.json.bind(res))
          .catch(next);
      })
    Severity: Major
    Found in packages/app/server/http/api/queue.js and 1 other location - About 2 hrs to fix
    packages/app/server/http/api/player.js on lines 29..40

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

    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 removeFavoriteTrack(track) {
      const favorites = store.get('favorites');
      _.remove(favorites.tracks, { uuid: track.uuid });
      store.set('favorites', favorites);
    
    
    Severity: Major
    Found in packages/app/app/actions/favorites.js and 1 other location - About 2 hrs to fix
    packages/app/app/actions/favorites.js on lines 57..66

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

    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

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

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

      Function panes has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        panes () {
          const {
            actions,
            dashboardData,
            history,
      Severity: Major
      Found in packages/app/app/components/Dashboard/index.js - About 2 hrs to fix

        Function localFileRouter has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function localFileRouter() {
          let cache = store.get('localMeta');
          let byArtist = _.groupBy(Object.values(cache), track => track.artist.name);
        
          ipcMain.on('refresh-localfolders', async event => {
        Severity: Major
        Found in packages/app/server/http/api/localfile.js - About 2 hrs to fix

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

            render() {
              let {
                addPlaylist,
                updatePlaylist,
                clearQueue,
          Severity: Major
          Found in packages/app/app/components/PlayQueue/QueueMenu/index.js - About 2 hrs to fix

            Function scanFoldersAndGetMeta has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export async function scanFoldersAndGetMeta(directories, cache = {}, onProgress = null) {
              const baseFiles = await Promise.all(
                _.flatMap(
                  SUPPORTED_FORMATS,
                  format => directories.map(
            Severity: Major
            Found in packages/app/server/local-files.js - About 2 hrs to fix

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

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

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

                  router.post('/', validate(updateEqualizerSchema), (req, res) => {
                    onUpdateEqualizer(req.body.values);
                    res.send();
                  })
                    .describe(getStandardDescription({
                Severity: Major
                Found in packages/app/server/http/api/equalizer.js and 2 other locations - About 2 hrs to fix
                packages/app/server/http/api/player.js on lines 91..101
                packages/app/server/http/api/player.js on lines 103..113

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

                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) => {
                      onSeek(req.body.value);
                      res.send();
                    })
                Severity: Major
                Found in packages/app/server/http/api/player.js and 2 other locations - About 2 hrs to fix
                packages/app/server/http/api/equalizer.js on lines 25..32
                packages/app/server/http/api/player.js on lines 91..101

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

                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) => {
                      onVolume(req.body.value);
                      res.send();
                    })
                Severity: Major
                Found in packages/app/server/http/api/player.js and 2 other locations - About 2 hrs to fix
                packages/app/server/http/api/equalizer.js on lines 25..32
                packages/app/server/http/api/player.js on lines 103..113

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

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

                export function settingsRouter() {
                
                  const router = express.Router();
                
                  swagger.swaggerize(router);
                Severity: Minor
                Found in packages/app/server/http/api/settings.js - About 2 hrs to fix

                  Function getChartOptions has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getChartOptions(data) {
                    return {
                      type: 'line',
                      data,
                      options: {
                  Severity: Minor
                  Found in packages/app/app/components/Equalizer/chart.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language