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

View on GitHub

Showing 63 of 446 total issues

Function setUpAutoUpdate has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const setUpAutoUpdate = () => {
  if (global.DEV_MODE) return;
  try {
    autoUpdater.setFeedURL(`https://update.gpmdp.xyz/update/${platform}/${app.getVersion()}`);

Severity: Minor
Found in src/main/features/core/autoUpdater.js - About 1 hr to fix

    Function constructor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor() {
        let ready = true;
        this.__defineGetter__('ready', () => ready);
        this.__defineSetter__('ready', (newValue) => {
          ready = newValue;
    Severity: Minor
    Found in src/renderer/rendererEmitter.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

      if ((osVersion[0] && parseInt(osVersion[0], 10) > 6) || (parseInt(osVersion[0], 10) === 6 && parseInt(osVersion[1], 10) > 1)) {
        // If we are above windows 7 we can use the system notifications but with
        // the silent flag forced on
        require('../silent_Notification');
      } else {
      Severity: Critical
      Found in src/renderer/generic/win32/polyfill_Notification.js - About 1 hr to fix

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

          render() {
            return (
              <SettingsTabWrapper>
                <PlatformSpecific platform="darwin">
                  <div style={{ paddingBottom: 16 }}>
        Severity: Minor
        Found in src/renderer/ui/components/settings/ThemeOptions.js - About 1 hr to fix

          Function waitForExternal has 39 lines of code (exceeds 25 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 1 hr to fix

            Function handleCommand has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              handleCommand(command) {
                if (!command) return;
                let matchedFn;
                let matchedKey = '';
                let fnArg;

              Function reset has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                reset() {
                  this.data = {
                    playing: false,
                    song: {
                      title: null,
              Severity: Minor
              Found in src/main/utils/PlaybackAPI.js - About 1 hr to fix

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

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

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

                    render() {
                      return (
                        <WindowContainer isMainWindow title={process.platform === 'darwin' ? this.state.title : ''} confirmClose={this._confirmCloseWindow}>
                          <div className="drag-handle-large"></div>
                          <div className={`loader ${this.state.loading ? '' : 'hidden'}`}>
                  Severity: Minor
                  Found in src/renderer/ui/pages/PlayerPage.js - About 1 hr to fix

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

                      render() {
                        return (
                          <WindowContainer title={TranslationProvider.query('title-settings')}>
                            <Tabs style={styles.tabContainer} contentContainerStyle={styles.tab}>
                              <Tab label={TranslationProvider.query('title-settings-general')}>
                    Severity: Minor
                    Found in src/renderer/ui/pages/SettingsPage.js - About 1 hr to fix

                      Function resolveLyrics has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const resolveLyrics = (song) => {
                        const promises = [() => attemptLyricsWikia(`${song.artist}:${song.title}`)];
                        let bracketed = song.title.match(bracketedRegex()) || [];
                      
                        // DEV: Attempt to find lyrics from wikia
                      Severity: Minor
                      Found in src/main/features/core/lyrics/index.js - About 1 hr to fix

                        Function fetchLyricsPage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          new Promise((resolve, reject) => {
                            const search = `http://www.lyricsfreak.com/search.php?a=search&type=song&q=${title.replace(/ /g, '+')}`;
                            request(search, (err, resp) => {
                              try {
                                if (err) return reject(err);
                        Severity: Minor
                        Found in src/main/features/core/lyrics/source_lyricsFreak.js - About 1 hr to fix

                          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

                            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 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 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 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 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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language