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

View on GitHub

Showing 68 of 446 total issues

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

              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

                  Severity
                  Category
                  Status
                  Source
                  Language