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

  render() {
    const actions = [
      <FlatButton
        label={TranslationProvider.query('button-text-not-now')}
        labelStyle={{ fontSize: 12 }}
Severity: Major
Found in src/renderer/ui/components/modals/OpenPortModal.js and 1 other location - About 1 day to fix
src/renderer/ui/components/modals/UpdateModal.js on lines 43..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 219.

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

  render() {
    const actions = [
      <FlatButton
        label={TranslationProvider.query('button-text-not-now')}
        labelStyle={{ fontSize: 12 }}
Severity: Major
Found in src/renderer/ui/components/modals/UpdateModal.js and 1 other location - About 1 day to fix
src/renderer/ui/components/modals/OpenPortModal.js on lines 39..64

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

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

  render() {
    const checkboxProps = {
      label: this.props.label,
      hintLabel: this.props.hintLabel,
      settingsKey: this.props.settingsKey,
Severity: Major
Found in src/renderer/ui/components/settings/ToggleableOption.js and 1 other location - About 6 hrs to fix
src/renderer/ui/components/settings/TextFieldSettings.js on lines 49..63

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

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

  render() {
    const textFieldProps = {
      label: this.props.label,
      settingsKey: this.props.settingsKey,
      dependsOnSettingsKey: this.props.dependsOnSettingsKey,
Severity: Major
Found in src/renderer/ui/components/settings/TextFieldSettings.js and 1 other location - About 6 hrs to fix
src/renderer/ui/components/settings/ToggleableOption.js on lines 61..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 157.

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 installGPMButton() {
  const elem = document.createElement('paper-button');
  elem.setAttribute('id', 'gpm-button');
  elem.setAttribute('class', 'yt-button-renderer');
  elem.setAttribute('style', 'background: #212121; color: orange; font-weight: bold;');
Severity: Major
Found in src/renderer/windows/GPMWebView/interface/ytm/customUI.js and 1 other location - About 5 hrs to fix
src/renderer/windows/GPMWebView/interface/gpm/customUI.js on lines 89..102

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

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 installYTMButton() {
  const elem = document.createElement('paper-button');
  elem.setAttribute('id', 'ytm-button');
  elem.setAttribute('class', 'paper-button-1');
  elem.setAttribute('style', 'background: #F43333; color: #FFF');
Severity: Major
Found in src/renderer/windows/GPMWebView/interface/gpm/customUI.js and 1 other location - About 5 hrs to fix
src/renderer/windows/GPMWebView/interface/ytm/customUI.js on lines 3..16

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

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

const handleWSMessage = (ws) =>
  (data) => {
    try {
      const command = JSON.parse(data);
      if (command.type === 'disconnect') {
Severity: Minor
Found in src/main/features/core/websocketAPI.js - About 4 hrs 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 setPresence has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

const setPresence = () => {
  if (!Settings.get('discordRichPresence', false)) {
    if (client) {
      client.disconnect();
      client = null;
Severity: Minor
Found in src/main/features/core/discordRichPresence.js - About 4 hrs 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

File gulpfile.babel.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint arrow-body-style: 0 */

import gulp from 'gulp';

import { spawn, exec } from 'child_process';
Severity: Minor
Found in gulpfile.babel.js - About 4 hrs to fix

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

    Emitter.on('playback:thumbsDown', () => {
      if (!remote.getGlobal('PlaybackAPI').data.song.title) return;
      new Notification('You just disliked', { // eslint-disable-line
        body: remote.getGlobal('PlaybackAPI').data.song.title,
        icon: remote.getGlobal('PlaybackAPI').data.song.albumArt,
    Severity: Major
    Found in src/renderer/windows/GPMWebView/playback/controller.js and 1 other location - About 4 hrs to fix
    src/renderer/windows/GPMWebView/playback/controller.js on lines 46..53

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

    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

    Emitter.on('playback:thumbsUp', () => {
      if (!remote.getGlobal('PlaybackAPI').data.song.title) return;
      new Notification('You just liked', { // eslint-disable-line
        body: remote.getGlobal('PlaybackAPI').data.song.title,
        icon: remote.getGlobal('PlaybackAPI').data.song.albumArt,
    Severity: Major
    Found in src/renderer/windows/GPMWebView/playback/controller.js and 1 other location - About 4 hrs to fix
    src/renderer/windows/GPMWebView/playback/controller.js on lines 60..67

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

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

    const setContextMenu = (track) => {
      const contextMenu = Menu.buildFromTemplate([
        {
          label: 'Service',
          enabled: false,
    Severity: Major
    Found in src/main/features/core/tray.js - About 3 hrs to fix

      Function mprisService has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function mprisService() {
        const mainWindow = WindowManager.getAll('main')[0];
      
        const player = mpris({
          name: 'google_play_music_desktop_player',
      Severity: Major
      Found in src/main/features/linux/mprisService.js - About 3 hrs to fix

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

        function hideNowPlayingMenu() {
          const lyricsButton = document.querySelector('#\\3Agpmdplyrics');
          const pauseButton = document.querySelector('#\\3Agpmdppause');
          lyricsButton.previousSibling.style.display = 'none';
          lyricsButton.style.display = 'none';
        Severity: Major
        Found in src/renderer/windows/GPMWebView/interface/gpm/customUI.js and 1 other location - About 3 hrs to fix
        src/renderer/windows/GPMWebView/interface/gpm/customUI.js on lines 179..186

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 106.

        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 showNowPlayingMenu() {
          const lyricsButton = document.querySelector('#\\3Agpmdplyrics');
          const pauseButton = document.querySelector('#\\3Agpmdppause');
          lyricsButton.previousSibling.style.display = 'block';
          lyricsButton.style.display = 'block';
        Severity: Major
        Found in src/renderer/windows/GPMWebView/interface/gpm/customUI.js and 1 other location - About 3 hrs to fix
        src/renderer/windows/GPMWebView/interface/gpm/customUI.js on lines 188..195

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

        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('FetchMainAppCustomStyles', () => {
          const mainAppPath = Settings.get('mainAppStyleFile');
          if (mainAppPath && fs.existsSync(mainAppPath)) {
            fs.readFile(mainAppPath, 'utf8', (err, css) => {
              Emitter.sendToAll('LoadMainAppCustomStyles', err ? '' : css);
        Severity: Major
        Found in src/main/features/core/customStyle.js and 2 other locations - About 3 hrs to fix
        src/main/features/core/customStyle.js on lines 14..23
        src/main/features/core/customStyle.js on lines 25..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 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

        PlaybackAPI has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PlaybackAPI extends EventEmitter {
          constructor(filePrefix = '') {
            super();
        
            this.PATH = createJSON(`${filePrefix}playback`);
        Severity: Minor
        Found in src/main/utils/PlaybackAPI.js - About 3 hrs to fix

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

          Emitter.on('FetchYTMCustomStyles', () => {
            const gpmPath = Settings.get('ytmStyleFile');
            if (gpmPath && fs.existsSync(gpmPath)) {
              fs.readFile(gpmPath, 'utf8', (err, css) => {
                Emitter.sendToGooglePlayMusic('LoadYTMCustomStyles', err ? '' : css);
          Severity: Major
          Found in src/main/features/core/customStyle.js and 2 other locations - About 3 hrs to fix
          src/main/features/core/customStyle.js on lines 3..12
          src/main/features/core/customStyle.js on lines 14..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

          Emitter.on('FetchGPMCustomStyles', () => {
            const gpmPath = Settings.get('gpmStyleFile');
            if (gpmPath && fs.existsSync(gpmPath)) {
              fs.readFile(gpmPath, 'utf8', (err, css) => {
                Emitter.sendToGooglePlayMusic('LoadGPMCustomStyles', err ? '' : css);
          Severity: Major
          Found in src/main/features/core/customStyle.js and 2 other locations - About 3 hrs to fix
          src/main/features/core/customStyle.js on lines 3..12
          src/main/features/core/customStyle.js on lines 25..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 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 2 locations. Consider refactoring.
          Open

          gulp.task('package:linux:64', ['clean-dist-linux-64', 'build-release'], (done) => {
            if (process.env.GPMDP_SKIP_PACKAGE) return done();
            packager(_.extend({}, defaultPackageConf, { platform: 'linux', arch: 'x64' }))
              .then(() => done())
              .catch((err) => done(err));
          Severity: Major
          Found in gulpfile.babel.js and 1 other location - About 3 hrs to fix
          gulpfile.babel.js on lines 359..364

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

          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