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

View on GitHub

Showing 63 of 446 total issues

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

      const _save = () => {
        if (!mini) {
          if (mainWindow.isFullScreen()) {
            Settings.set('fullscreen', true);
            return;
      Severity: Minor
      Found in src/main/features/core/persistAppState.js - About 55 mins 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 _registerHotkeyIfSet has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      const _registerHotkeyIfSet = (accelerator, action) => {
        if (accelerator) {
          try {
            const success = globalShortcut.register(accelerator, () => {
              if (action === 'showLyrics') {
      Severity: Minor
      Found in src/main/features/core/keyboardShortcuts.js - About 55 mins 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 connect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        connect: (extensionId) => {
          const createChannel = (label) => { // eslint-disable-line
            const fns = [];
            return {
              addListener: (...args) => {
      Severity: Minor
      Found in src/renderer/windows/GPMWebView/runtime.js - About 55 mins 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 set has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

        set(key, value) {
          if (this.coupled) {
            const valChanged = this.data[key] !== value;
            this.data[key] = value;
            if (this._hooks[key] && valChanged) {
      Severity: Minor
      Found in src/main/utils/Settings.js - About 55 mins 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 showToast has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      window.showToast = function (text, dismissable, buttonText, buttonColor, buttonEventFunction, postCreationFunction) { // eslint-disable-line
      Severity: Minor
      Found in src/renderer/windows/GPMWebView/interface/generic/toast.js - About 45 mins to fix

        Function fetchLyrics has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const fetchLyrics = (track, artist) =>
          fetchLyricsPage(track, artist)
            .then((url) =>
              new Promise((resolve, reject) => {
                request(url, (err, resp) => {
        Severity: Minor
        Found in src/main/features/core/lyrics/source_lyricsFreak.js - About 45 mins 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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          render() {
            if (process.platform === this.props.platform) {
              if (!this.props.versionRange) return this.props.children;
        
              if (osVersion === null) {
        Severity: Minor
        Found in src/renderer/ui/components/generic/PlatformSpecific.js - About 45 mins 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 receiverFn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const receiverFn = (receivers) =>
          new Promise((resolve, reject) => {
            let dialog = document.createElement('paper-dialog');
            trigID++;
            const body = document.getElementsByTagName('body')[0];
        Severity: Minor
        Found in src/renderer/windows/GPMWebView/chromecast.js - About 45 mins 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 _save has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          _save() {
            if (Settings.get('enableJSON_API', true)) {
              try {
                fs.writeFileSync(this.PATH, JSON.stringify(this.data, null, 4));
              } catch (e) {
        Severity: Minor
        Found in src/main/utils/PlaybackAPI.js - About 45 mins 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 _load has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          _load(retryCount = 5) {
            let userSettings;
            try {
              userSettings = JSON.parse(fs.readFileSync(this.PATH, 'utf8'));
            } catch (e) {
        Severity: Minor
        Found in src/main/utils/Settings.js - About 45 mins 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 render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          render() {
            const muiTheme = generateTheme(this.state.theme, this.state.themeColor, this.state.themeType);
        
            const fadedBackground = {};
            if (this.state.theme && this.state.themeType === 'FULL') {
        Severity: Minor
        Found in src/renderer/ui/components/generic/WindowContainer.js - About 45 mins 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 installSidebarButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function installSidebarButton(translationKey, type, icon, index, href, fn) {
        Severity: Minor
        Found in src/renderer/windows/GPMWebView/interface/gpm/customUI.js - About 45 mins to fix

          Function constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor(...args) {
              super(...args);
          
              this.once = true;
              const service = Settings.get('service');
          Severity: Minor
          Found in src/renderer/ui/pages/PlayerPage.js - About 35 mins 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 generateGulpLinuxDistroTask has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          const generateGulpLinuxDistroTask = (prefix, name, arch) => {
            gulp.task(`${prefix}:linux:${arch}`, [`package:linux:${arch}`], (done) => {
              const tool = require(`electron-installer-${name}`);
          
              const defaults = {
          Severity: Minor
          Found in gulpfile.babel.js - About 35 mins 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

          Avoid too many return statements within this function.
          Open

            return false;
          Severity: Major
          Found in src/squirrel.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return true;
            Severity: Major
            Found in src/squirrel.js - About 30 mins to fix

              Function attemptMetroLyrics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              const attemptMetroLyrics = (path) =>
                new Promise((resolve, reject) => {
                  fetch(`http://www.metrolyrics.com/${path}.html`)
                    .then((data) => data.text())
                    .then((html) => {
              Severity: Minor
              Found in src/main/features/core/lyrics/source_metroLyrics.js - About 25 mins 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 getAppIconFileName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function getAppIconFileName() {
                let appIconFileName;
                if (process.platform === 'darwin') {
                  appIconFileName = 'macTemplate.png';
                } else if (WindowManager.getWindowManagerGDMName() === 'kde-plasma') {
              Severity: Minor
              Found in src/main/features/core/tray.js - About 25 mins 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

              Severity
              Category
              Status
              Source
              Language