Showing 336 of 336 total issues

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

  protected test () {
    it.each<[MediaInfoDisplayMode]>([['aside'], ['full']])('renders in %s mode', async (mode) => {
      await this.renderComponent(mode)

      screen.getByTestId('album-info-tracks')
Severity: Minor
Found in resources/assets/js/components/album/AlbumInfo.spec.ts - About 1 hr to fix

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

      protected test () {
        it.each<[string, keyof Events, User | Song[] | Playlist | PlaylistFolder | undefined]>([
          ['add-user-form', 'MODAL_SHOW_ADD_USER_FORM', undefined],
          ['invite-user-form', 'MODAL_SHOW_INVITE_USER_FORM', undefined],
          ['edit-user-form', 'MODAL_SHOW_EDIT_USER_FORM', factory<User>('user')],
    Severity: Minor
    Found in resources/assets/js/components/layout/ModalWrapper.spec.ts - About 1 hr to fix

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

        protected test () {
          it('performs an excerpt search', async () => {
            const result: ExcerptSearchResult = {
              songs: factory<Song>('song', 3),
              albums: factory<Album>('album', 3),
      Severity: Minor
      Found in resources/assets/js/stores/searchStore.spec.ts - About 1 hr to fix

        Function useSongMenuMethods has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useSongMenuMethods = (songs: Ref<Song[]>, close: Closure) => {
          const { addSongsToPlaylist } = usePlaylistManagement()
        
          const queueSongsAfterCurrent = () => {
            close()
        Severity: Minor
        Found in resources/assets/js/composables/useSongMenuMethods.ts - About 1 hr to fix

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

            private renderForAlbum () {
              album = factory<Album>('album', {
                name: 'IV',
                cover: 'https://test/album.jpg'
              })
          resources/assets/js/components/ui/AlbumArtistThumbnail.spec.ts on lines 27..38

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

          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

            private renderForArtist () {
              artist = factory<Artist>('artist', {
                name: 'Led Zeppelin',
                image: 'https://test/blimp.jpg'
              })
          resources/assets/js/components/ui/AlbumArtistThumbnail.spec.ts on lines 14..25

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

          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

              cy.get('#artistsWrapper').within(() => {
                cy.get('[data-testid=artist-card]:first-child .name').click()
                cy.url().should('contain', '/#!/artist/3')
              })
          Severity: Major
          Found in cypress/integration/artists.spec.ts and 1 other location - About 1 hr to fix
          cypress/integration/queuing.spec.ts on lines 39..42

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

          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

              cy.get('#songsWrapper').within(() => {
                cy.get('.screen-header [data-testid=btn-shuffle-all]').click()
                cy.url().should('contains', '/#!/queue')
              })
          Severity: Major
          Found in cypress/integration/queuing.spec.ts and 1 other location - About 1 hr to fix
          cypress/integration/artists.spec.ts on lines 44..47

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

          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

                cy.get('.screen-header').within(() => {
                  cy.findByText('Download All').should('be.visible')
                  cy.findByText('Info').click()
                })
          Severity: Major
          Found in cypress/integration/albums.spec.ts and 1 other location - About 1 hr to fix
          cypress/integration/artists.spec.ts on lines 52..55

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

          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

                cy.get('.screen-header').within(() => {
                  cy.findByText('Download All').should('be.visible')
                  cy.findByText('Info').click()
                })
          Severity: Major
          Found in cypress/integration/artists.spec.ts and 1 other location - About 1 hr to fix
          cypress/integration/albums.spec.ts on lines 51..54

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

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

            protected test () {
              it('renders the playlist', async () => {
                await this.renderComponent(factory<Song>('song', 10))
          
                await waitFor(() => {
          Severity: Minor
          Found in resources/assets/js/components/screens/PlaylistScreen.spec.ts - About 1 hr to fix

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

              protected test () {
                it('invites single email', async () => {
                  const inviteMock = this.mock(invitationService, 'invite')
                  const alertMock = this.mock(MessageToasterStub.value, 'success')
            
            
            Severity: Minor
            Found in resources/assets/js/components/user/InviteUserForm.spec.ts - About 1 hr to fix

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

                init (mediaElement: HTMLMediaElement) {
                  this.element = mediaElement
              
                  this.context = new AudioContext()
                  this.preampGainNode = this.context.createGain()
              Severity: Minor
              Found in resources/assets/js/services/audioService.ts - About 1 hr to fix

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

                  protected test () {
                    it('sets and gets a value', () => {
                      cache.set('foo', 'bar')
                      expect(cache.get('foo')).toBe('bar')
                    })
                Severity: Minor
                Found in resources/assets/js/services/cache.spec.ts - About 1 hr to fix

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

                  export const useSongListControls = () => {
                    const { isCurrentScreen } = useRouter()
                  
                    const getSongListControlsConfig = () => {
                      const config: SongListControlsConfig = {
                  Severity: Minor
                  Found in resources/assets/js/composables/useSongListControls.ts - About 1 hr to fix

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

                      protected test () {
                        it.each<[MediaInfoDisplayMode]>([['aside'], ['full']])('renders in %s mode', async (mode) => {
                          await this.renderComponent(mode)
                    
                          if (mode === 'aside') {
                    Severity: Minor
                    Found in resources/assets/js/components/artist/ArtistInfo.spec.ts - About 1 hr to fix

                      Method createSongEntry has 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              string $bucket,
                              string $key,
                              string $artistName,
                              string $albumName,
                              string $albumArtistName,
                      Severity: Major
                      Found in app/Services/S3Service.php - 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, true)
                                expect(goMock).toHaveBeenCalledWith('queue')
                              })
                        resources/assets/js/components/playlist/PlaylistFolderContextMenu.spec.ts on lines 86..90

                        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

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language