Showing 336 of 336 total issues

Function useFloatingUi has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useFloatingUi = (
  reference: HTMLElement | Ref<HTMLElement | undefined>,
  floating: HTMLElement | Ref<HTMLElement | undefined>,
  config: Partial<Config> = {}
) => {
Severity: Major
Found in resources/assets/js/composables/useFloatingUi.ts - About 2 hrs to fix

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

        it('clears queue', async () => {
          const { emitted } = this.renderComponent(0, 'Queue')
    
          await this.user.click(screen.getByTitle('Clear current queue'))
    
    
    Severity: Major
    Found in resources/assets/js/components/song/SongListControls.spec.ts and 1 other location - About 2 hrs to fix
    resources/assets/js/components/song/SongListControls.spec.ts on lines 74..80

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

    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 4 locations. Consider refactoring.
    Open

        it('queues', async () => {
          const queueMock = this.mock(queueStore, 'queue')
          await this.renderComponent()
    
          await this.user.click(screen.getByText('Queue'))
    Severity: Major
    Found in resources/assets/js/components/song/SongContextMenu.spec.ts and 3 other locations - About 2 hrs to fix
    resources/assets/js/components/album/AlbumContextMenu.spec.ts on lines 54..61
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 82..89
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 159..166

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

    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 4 locations. Consider refactoring.
    Open

        it('downloads', async () => {
          const downloadMock = this.mock(downloadService, 'fromAlbum')
          await this.renderComponent()
    
          await this.user.click(screen.getByText('Download'))
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 82..89
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 91..98
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 159..166

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

    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 4 locations. Consider refactoring.
    Open

        it('adds to favorites', async () => {
          const likeMock = this.mock(favoriteStore, 'like')
          await this.renderComponent()
    
          await this.user.click(screen.getByText('Favorites'))
    Severity: Major
    Found in resources/assets/js/components/song/SongContextMenu.spec.ts and 3 other locations - About 2 hrs to fix
    resources/assets/js/components/album/AlbumContextMenu.spec.ts on lines 54..61
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 82..89
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 91..98

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

    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

        it('deletes current playlist', async () => {
          const { emitted } = this.renderComponent(0, 'Playlist')
    
          await this.user.click(screen.getByTitle('Delete this playlist'))
    
    
    Severity: Major
    Found in resources/assets/js/components/song/SongListControls.spec.ts and 1 other location - About 2 hrs to fix
    resources/assets/js/components/song/SongListControls.spec.ts on lines 66..72

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

    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 4 locations. Consider refactoring.
    Open

        it('downloads', async () => {
          const downloadMock = this.mock(downloadService, 'fromSongs')
          await this.renderComponent()
    
          await this.user.click(screen.getByText('Download'))
    Severity: Major
    Found in resources/assets/js/components/song/SongContextMenu.spec.ts and 3 other locations - About 2 hrs to fix
    resources/assets/js/components/album/AlbumContextMenu.spec.ts on lines 54..61
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 91..98
    resources/assets/js/components/song/SongContextMenu.spec.ts on lines 159..166

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

    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

        it('adds songs to Favorites', async () => {
          const mock = this.mock(favoriteStore, 'like')
          this.renderComponent()
    
          await this.user.click(screen.getByTestId('add-to-favorites'))
    Severity: Major
    Found in resources/assets/js/components/song/AddToMenu.spec.ts and 1 other location - About 2 hrs to fix
    resources/assets/js/components/ui/YouTubeVideoItem.spec.ts on lines 35..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 79.

    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

        it('plays', async () => {
          const mock = this.mock(youTubeService, 'play')
          this.renderComponent()
    
          await this.user.click(screen.getByRole('button'))
    Severity: Major
    Found in resources/assets/js/components/ui/YouTubeVideoItem.spec.ts and 1 other location - About 2 hrs to fix
    resources/assets/js/components/song/AddToMenu.spec.ts on lines 71..78

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

    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

    SongRepository has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SongRepository extends Repository
    {
        use Searchable;
    
        public const SORT_COLUMNS_NORMALIZE_MAP = [
    Severity: Minor
    Found in app/Repositories/SongRepository.php - About 2 hrs to fix

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

        protected test () {
          it('renders for album', () => {
            expect(this.renderForAlbum().html()).toMatchSnapshot()
          })
      
      
      Severity: Major
      Found in resources/assets/js/components/ui/AlbumArtistThumbnail.spec.ts - About 2 hrs to fix

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

        Cypress.Commands.add('$assertPlaying', () => {
          cy.findByTestId('pause-btn').should('exist')
          cy.findByTestId('play-btn').should('not.exist')
          cy.$findInTestId('other-controls [data-testid=soundbars]').should('be.visible')
        })
        Severity: Major
        Found in cypress/support/commands.ts and 1 other location - About 2 hrs to fix
        cypress/support/commands.ts on lines 104..108

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

        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

        Cypress.Commands.add('$assertNotPlaying', () => {
          cy.findByTestId('pause-btn').should('not.exist')
          cy.findByTestId('play-btn').should('exist')
          cy.$findInTestId('other-controls [data-testid=soundbars]').should('not.exist')
        })
        Severity: Major
        Found in cypress/support/commands.ts and 1 other location - About 2 hrs to fix
        cypress/support/commands.ts on lines 98..102

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

        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

            it('gets an artist by ID', () => {
              const artist = factory<Artist>('artist')
              artistStore.vault.set(artist.id, artist)
              expect(artistStore.byId(artist.id)).toEqual(artist)
            })
        Severity: Major
        Found in resources/assets/js/stores/artistStore.spec.ts and 1 other location - About 2 hrs to fix
        resources/assets/js/stores/albumStore.spec.ts on lines 16..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 77.

        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

            it('gets an album by ID', () => {
              const album = factory<Album>('album')
              albumStore.vault.set(album.id, album)
              expect(albumStore.byId(album.id)).toEqual(album)
            })
        Severity: Major
        Found in resources/assets/js/stores/albumStore.spec.ts and 1 other location - About 2 hrs to fix
        resources/assets/js/stores/artistStore.spec.ts on lines 16..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 77.

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

          protected test () {
            it('has different behaviors for current user', () => {
              const user = factory<User>('user')
              this.actingAs(user).renderComponent(user)
        
        
        Severity: Major
        Found in resources/assets/js/components/user/UserCard.spec.ts - About 2 hrs to fix

          File songStore.spec.ts has 251 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { reactive } from 'vue'
          import isMobile from 'ismobilejs'
          import UnitTestCase from '@/__tests__/UnitTestCase'
          import { expect, it } from 'vitest'
          import factory from '@/__tests__/factory'
          Severity: Minor
          Found in resources/assets/js/stores/songStore.spec.ts - About 2 hrs to fix

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

              protected test () {
                it('initializes the store', () => {
                  const applyMock = this.mock(themeStore, 'applyThemeFromPreference')
            
                  themeStore.init()
            Severity: Minor
            Found in resources/assets/js/stores/themeStore.spec.ts - About 2 hrs to fix

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

                protected test () {
                  it('toggles one song', async () => {
                    const addMock = this.mock(favoriteStore, 'add')
                    const removeMock = this.mock(favoriteStore, 'remove')
                    const postMock = this.mock(http, 'post')
              Severity: Minor
              Found in resources/assets/js/stores/favoriteStore.spec.ts - About 2 hrs to fix

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

                  protected test () {
                    it('renders', async () => expect((await this.renderComponent()).html()).toMatchSnapshot())
                
                    it('plays all', async () => {
                      const songs = factory<Song>('song', 10)
                Severity: Minor
                Found in resources/assets/js/components/album/AlbumContextMenu.spec.ts - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language