MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-

View on GitHub

Showing 446 of 446 total issues

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

  componentDidMount() {
    this.props.keys.forEach((settingsKey) => {
      Emitter.on(`settings:change:${settingsKey}`, this.handleKeyChange);
    });
  }
Severity: Major
Found in src/renderer/ui/components/generic/SettingsProvider.js and 1 other location - About 1 hr to fix
src/renderer/ui/components/generic/SettingsProvider.js on lines 31..35

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

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

  static propTypes = {
    bonusEvents: PropTypes.array.isRequired,
    label: PropTypes.string.isRequired,
    setSetting: PropTypes.func.isRequired,
    settingsKey: PropTypes.string.isRequired,
Severity: Major
Found in src/renderer/ui/components/settings/FileInput.js and 1 other location - About 1 hr to fix
src/renderer/ui/components/settings/ThemeOptions.js on lines 14..19

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

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

  render() {
    const buttonProps = {
      primary: true,
    };
    let authStatus = TranslationProvider.query('lastfm-login-not-authorized');
Severity: Minor
Found in src/renderer/ui/components/settings/tabs/LastFMTab.js - About 1 hr to fix

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

                              'party is over', 'party\'s over'], () =>
        new Promise((resolve) => {
          origVolume = origVolume || GPM.volume.getVolume();
          GPM.volume.setVolume(0);
          resolve();
    src/renderer/windows/GPMWebView/interface/voiceControls/index.js on lines 152..157

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

    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

                              'get this party started'], () =>
        new Promise((resolve) => {
          origVolume = origVolume || GPM.volume.getVolume();
          GPM.volume.setVolume(100);
          resolve();
    src/renderer/windows/GPMWebView/interface/voiceControls/index.js on lines 161..166

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

    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 default has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (fileName) {
      const targetFileName = process.windowsStore ? `${fileName}-uwp` : fileName;
      const DIR = path.resolve(`${(app ? app.getPath('userData') : remote.require('electron').app.getPath('userData'))}/json_store`); // eslint-disable-line
    
      const PATH = `${DIR}/${targetFileName}.json`;
    Severity: Minor
    Found in src/main/utils/_jsonCreator.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function toggleMainWindow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function toggleMainWindow() {
      // the mainWindow variable will be GC'd
      // we must find the window ourselves
      const win = WindowManager.getAll('main')[0];
      if (!win) return;
    Severity: Minor
    Found in src/main/features/core/tray.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function installNowPlayingMenu has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function installNowPlayingMenu() {
      installNowPlayingSeperator();
      installNowPlayingButton('label-pause-after-song', ':gpmdppause', () => {
        Emitter.fireAtGoogle('pauseAfter:show');
      });
    Severity: Minor
    Found in src/renderer/windows/GPMWebView/interface/gpm/customUI.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function add has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      add(window, name = null) {
        const newID = Symbol();
        this.windows[newID] = window;
        this.IDMap[window.id] = newID;
        window.on('closed', () => {
    Severity: Minor
    Found in src/main/utils/WindowManager.js - About 1 hr to fix

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

        render() {
          const actions = [
            <FlatButton
              label={TranslationProvider.query('button-text-lets-go')}
              primary
      Severity: Minor
      Found in src/renderer/ui/components/modals/GoToModal.js - About 1 hr to fix

        Function waitForAudio has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const waitForAudio = setInterval(() => {
            if (document.querySelectorAll(audioSelector).length > 0) {
              clearInterval(waitForAudio);
        
              // DEV: We do this here so that we can set the output device before hooking the context
        Severity: Minor
        Found in src/renderer/windows/GPMWebView/playback/audioEQ.js - About 1 hr to fix

          Function postMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                postMessage: (obj) => {
                  if (extensionId === GOOGLE_MINI_PLAYER_EXT_ID) {
                    if (obj.type === PING) {
                      onMessage.call({ type: PONG, sentFrom: 'bg' });
                    } else if (obj.type === TRIGGER_CONNECT) {
          Severity: Minor
          Found in src/renderer/windows/GPMWebView/runtime.js - About 1 hr to fix

            Function handleStartupEvent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const handleStartupEvent = () => {
              if (process.platform !== 'win32') {
                return false;
              }
            
            
            Severity: Minor
            Found in src/squirrel.js - About 1 hr to fix

              Function timeHandler has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  this.timeHandler = (e, timeObj) => {
                    $(findDOMNode(this)).find('#lyrics_bar').width(`${(timeObj.total === 0 ? 0 : timeObj.current / timeObj.total) * 100}%`);
                    let jumped = false;
                    if (Math.abs(timeObj.current - jumpDetect) > 1000) {
                      animate = true;
              Severity: Minor
              Found in src/renderer/ui/components/generic/LyricsViewer.js - About 1 hr to fix

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

                  Emitter.on('notification:clicked', (event, id) => {
                    if (NOTIFICATIONS[id] && NOTIFICATIONS[id].onclick) {
                      NOTIFICATIONS[id].onclick();
                    }
                  });
                Severity: Major
                Found in src/renderer/generic/win32/polyfill_Notification.js and 2 other locations - About 1 hr to fix
                src/renderer/generic/win32/polyfill_Notification.js on lines 82..86
                src/renderer/generic/win32/polyfill_Notification.js on lines 89..93

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

                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

                  Emitter.on('notification:showed', (event, id) => {
                    if (NOTIFICATIONS[id] && NOTIFICATIONS[id].onshow) {
                      NOTIFICATIONS[id].onshow();
                    }
                  });
                Severity: Major
                Found in src/renderer/generic/win32/polyfill_Notification.js and 2 other locations - About 1 hr to fix
                src/renderer/generic/win32/polyfill_Notification.js on lines 67..71
                src/renderer/generic/win32/polyfill_Notification.js on lines 82..86

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

                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

                  Emitter.on('notification:closed', (event, id) => {
                    if (NOTIFICATIONS[id] && NOTIFICATIONS[id].onclose) {
                      NOTIFICATIONS[id].onclose();
                    }
                  });
                Severity: Major
                Found in src/renderer/generic/win32/polyfill_Notification.js and 2 other locations - About 1 hr to fix
                src/renderer/generic/win32/polyfill_Notification.js on lines 67..71
                src/renderer/generic/win32/polyfill_Notification.js on lines 89..93

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

                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 newString = `${(songInfo.title || TranslationProvider.query('label-unknown-song'))} - ${(songInfo.artist || TranslationProvider.query('label-unknown-artist'))}`; // eslint-disable-line
                Severity: Minor
                Found in src/main/features/core/windowTitleInfo.js and 1 other location - About 55 mins to fix
                src/main/features/core/windowTitleInfo.js on lines 26..26

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

                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

                  _setRepeat(mode) {
                    this.data.repeat = mode;
                    this._fire('change:repeat', this.data.repeat);
                    this._save();
                  }
                Severity: Major
                Found in src/main/utils/PlaybackAPI.js and 2 other locations - About 55 mins to fix
                src/main/utils/PlaybackAPI.js on lines 139..143
                src/main/utils/PlaybackAPI.js on lines 145..149

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

                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

                  _setShuffle(mode) {
                    this.data.shuffle = mode;
                    this._fire('change:shuffle', this.data.shuffle);
                    this._save();
                  }
                Severity: Major
                Found in src/main/utils/PlaybackAPI.js and 2 other locations - About 55 mins to fix
                src/main/utils/PlaybackAPI.js on lines 139..143
                src/main/utils/PlaybackAPI.js on lines 151..155

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

                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