Showing 336 of 336 total issues

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

  async fetch () {
    this.state.songs = songStore.syncWithVault(await http.get<Song[]>('songs/favorite'))
    return this.state.songs
  }
Severity: Major
Found in resources/assets/js/stores/favoriteStore.ts and 1 other location - About 1 hr to fix
resources/assets/js/stores/recentlyPlayedStore.ts on lines 17..20

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

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

    cy.get('#extra').within(() => {
      cy.get('#extraTabYouTube').click()
      cy.get('[data-testid=youtube-search-result]:nth-child(2)').click()
    })
Severity: Major
Found in cypress/integration/youtube.spec.ts and 2 other locations - About 1 hr to fix
cypress/integration/song-context-menu.spec.ts on lines 105..109
cypress/integration/song-context-menu.spec.ts on lines 136..139

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

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

      await waitFor(() => {
        expect(fetchMock).toHaveBeenCalledWith(folder)
        expect(queueMock).toHaveBeenCalledWith(songs, true)
        expect(goMock).toHaveBeenCalledWith('queue')
      })
resources/assets/js/components/playlist/PlaylistContextMenu.spec.ts on lines 95..99

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

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

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

    it('does not have an option to download if downloading is disabled', async () => {
      commonStore.state.allow_download = false
      this.renderComponent()

      expect(screen.queryByText('Download')).toBeNull()
Severity: Major
Found in resources/assets/js/components/album/AlbumCard.spec.ts and 1 other location - About 1 hr to fix
resources/assets/js/components/artist/ArtistCard.spec.ts on lines 45..50

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

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

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

    it('does not have an option to download if downloading is disabled', async () => {
      commonStore.state.allow_download = false
      this.renderComponent()

      expect(screen.queryByText('Download')).toBeNull()
Severity: Major
Found in resources/assets/js/components/artist/ArtistCard.spec.ts and 1 other location - About 1 hr to fix
resources/assets/js/components/album/AlbumCard.spec.ts on lines 44..49

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

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

  async fetch () {
    this.state.songs = songStore.syncWithVault(await http.get<Song[]>('songs/recently-played'))
    return this.state.songs
  },
Severity: Major
Found in resources/assets/js/stores/recentlyPlayedStore.ts and 1 other location - About 1 hr to fix
resources/assets/js/stores/favoriteStore.ts on lines 45..48

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

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

  protected test () {
    it('downloads', async () => {
      const downloadMock = this.mock(downloadService, 'fromAlbum')
      await this.renderComponent()

Severity: Minor
Found in resources/assets/js/components/screens/AlbumScreen.spec.ts - About 1 hr to fix

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

      protected test () {
        it('renders an empty state if no songs found', async () => {
          commonStore.state.song_length = 0
          this.mock(overviewStore, 'init')
    
    
    Severity: Minor
    Found in resources/assets/js/components/screens/HomeScreen.spec.ts - About 1 hr to fix

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

        protected test () {
          it('functions', async () => {
            const song = factory<Song>('song')
      
            const searchMock = this.mock(youTubeService, 'searchVideosBySong').mockResolvedValueOnce({
      Severity: Minor
      Found in resources/assets/js/components/ui/YouTubeVideoList.spec.ts - About 1 hr to fix

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

              await waitFor(() => {
                expect(fetchMock).toHaveBeenCalledWith(playlist)
                expect(queueMock).toHaveBeenCalledWith(songs)
                expect(goMock).toHaveBeenCalledWith('queue')
              })
        resources/assets/js/components/playlist/PlaylistFolderContextMenu.spec.ts on lines 49..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 59.

        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

              await waitFor(() => {
                expect(fetchMock).toHaveBeenCalledWith(folder)
                expect(queueMock).toHaveBeenCalledWith(songs)
                expect(goMock).toHaveBeenCalledWith('queue')
              })
        resources/assets/js/components/playlist/PlaylistContextMenu.spec.ts on lines 59..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 59.

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

          initScene () {
            const _sphere_size = .7
            const _geom = new THREE.SphereGeometry(_sphere_size, 128, 128)
            const _geom_lowres = new THREE.SphereGeometry(_sphere_size, 64, 64)
        
        
        Severity: Minor
        Found in resources/assets/js/visualizers/asteroid/scripts/NoiseBlob.ts - About 1 hr to fix

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

            protected test () {
              it('downloads songs', () => {
                const mock = this.mock(downloadService, 'trigger')
                downloadService.fromSongs([factory<Song>('song', { id: 'foo' }), factory<Song>('song', { id: 'bar' })])
          
          
          Severity: Minor
          Found in resources/assets/js/services/downloadService.spec.ts - About 1 hr to fix

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

              update () {
                this.analyzer.getByteFrequencyData(this.audioBuffer)
                let bass = 0., mid = 0., high = 0.
            
                if (this.audioBuffer[0] === 0) {
            Severity: Minor
            Found in resources/assets/js/visualizers/asteroid/scripts/AudioAnalyzer.ts - About 1 hr to fix

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

                constructor () {
                  this.client = Axios.create({
                    baseURL: `${window.BASE_URL}api`,
                    headers: {
                      'X-Api-Version': 'v6'
              Severity: Minor
              Found in resources/assets/js/services/http.ts - About 1 hr to fix

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

                      await waitFor(() => {
                        expect(fetchMock).toHaveBeenCalled()
                        expect(playMock).toHaveBeenCalledWith(songs)
                        expect(goMock).toHaveBeenCalledWith('queue')
                      })
                Severity: Major
                Found in resources/assets/js/components/ui/FooterPlayButton.spec.ts and 1 other location - About 1 hr to fix
                resources/assets/js/components/ui/FooterPlayButton.spec.ts on lines 80..84

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

                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

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

                      await waitFor(() => {
                        expect(fetchMock).toHaveBeenCalled()
                        expect(playMock).toHaveBeenCalledWith(songs)
                        expect(goMock).toHaveBeenCalledWith('queue')
                      })
                Severity: Major
                Found in resources/assets/js/components/ui/FooterPlayButton.spec.ts and 1 other location - About 1 hr to fix
                resources/assets/js/components/ui/FooterPlayButton.spec.ts on lines 102..106

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

                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

                Method make has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        ?string $title,
                        ?string $artistName,
                        ?string $albumName,
                        ?string $albumArtistName,
                        ?int $track,
                Severity: Major
                Found in app/Values/SongUpdateData.php - About 1 hr to fix

                  Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          public ?string $title,
                          public ?string $artistName,
                          public ?string $albumName,
                          public ?string $albumArtistName,
                          public ?int $track,
                  Severity: Major
                  Found in app/Values/SongUpdateData.php - About 1 hr to fix

                    Function test has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      protected test () {
                        it('renders the queue', () => {
                          this.renderComponent(factory<Song>('song', 3))
                    
                          expect(screen.queryByTestId('song-list')).toBeTruthy()
                    Severity: Minor
                    Found in resources/assets/js/components/screens/QueueScreen.spec.ts - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language