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

View on GitHub

Showing 63 of 446 total issues

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

      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 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 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 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 _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 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 _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 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 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 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

          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

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

              const waitForExternal = setInterval(() => {
                if (serviceReady()) {
                  clearInterval(waitForExternal);
              
                  if (service === 'youtube-music') {
              Severity: Minor
              Found in src/renderer/windows/GPMWebView/index.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