Showing 336 of 336 total issues

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

export const usePlaylistManagement = () => {
  const { toastSuccess } = useMessageToaster()
  const { showErrorDialog } = useDialogBox()

  const addSongsToPlaylist = async (playlist: Playlist, songs: Song[]) => {
Severity: Minor
Found in resources/assets/js/composables/usePlaylistManagement.ts - About 1 hr to fix

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

      private async renderComponent () {
        commonStore.state.use_last_fm = true
    
        album = factory<Album>('album', {
          id: 42,
    Severity: Minor
    Found in resources/assets/js/components/screens/AlbumScreen.spec.ts - About 1 hr to fix

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

        protected test () {
          it('renders', () => expect(this.render(SettingsScreen).html()).toMatchSnapshot())
      
          it('submits the settings form', async () => {
            const updateMock = this.mock(settingStore, 'update')
      Severity: Minor
      Found in resources/assets/js/components/screens/SettingsScreen.spec.ts - About 1 hr to fix

        Function useInfiniteScroll has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useInfiniteScroll = (loadMore: Closure) => {
          const scroller = ref<HTMLElement>()
        
          const scrolling = (event: UIEvent) => {
            const target = event.target as HTMLElement
        Severity: Minor
        Found in resources/assets/js/composables/useInfiniteScroll.ts - About 1 hr to fix

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

              it('logs out', async () => {
                const deleteMock = this.mock(http, 'delete')
                await userStore.logout()
          
                expect(deleteMock).toHaveBeenCalledWith('me')
          Severity: Major
          Found in resources/assets/js/stores/userStore.spec.ts and 1 other location - About 1 hr to fix
          resources/assets/js/stores/userStore.spec.ts on lines 67..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 56.

          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 profile', async () => {
                const getMock = this.mock(http, 'get')
                await userStore.getProfile()
          
                expect(getMock).toHaveBeenCalledWith('me')
          Severity: Major
          Found in resources/assets/js/stores/userStore.spec.ts and 1 other location - About 1 hr to fix
          resources/assets/js/stores/userStore.spec.ts on lines 60..65

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

          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

              album.cover = (await http.put<{ coverUrl: string }>(`album/${album.id}/cover`, { cover })).coverUrl
          Severity: Major
          Found in resources/assets/js/stores/albumStore.ts and 1 other location - About 1 hr to fix
          resources/assets/js/stores/artistStore.ts on lines 38..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 56.

          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

              artist.image = (await http.put<{ imageUrl: string }>(`artist/${artist.id}/image`, { image })).imageUrl
          Severity: Major
          Found in resources/assets/js/stores/artistStore.ts and 1 other location - About 1 hr to fix
          resources/assets/js/stores/albumStore.ts on lines 50..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 56.

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

            update () {
              const shaders = [
                this.shaderMesh,
                this.shaderWire,
                this.shaderPoints,
          Severity: Minor
          Found in resources/assets/js/visualizers/asteroid/scripts/NoiseBlob.ts - About 1 hr to fix

            Function resolveDroppedSongs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const resolveDroppedSongs = async (event: DragEvent) => {
                try {
                  const type = getDragType(event)
                  if (!type) return <Song[]>[]
            
            
            Severity: Minor
            Found in resources/assets/js/composables/useDragAndDrop.ts - About 1 hr to fix

              Function getSongListControlsConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const getSongListControlsConfig = () => {
                  const config: SongListControlsConfig = {
                    play: true,
                    addTo: {
                      queue: true,
              Severity: Minor
              Found in resources/assets/js/composables/useSongListControls.ts - About 1 hr to fix

                Method maybeSetUpDatabase has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function maybeSetUpDatabase(): void
                    {
                        $attempt = 0;
                
                        while (true) {
                Severity: Minor
                Found in app/Console/Commands/InitCommand.php - About 1 hr to fix

                  Function setup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    setup (props, { slots }) {
                      let toastSuccess: ReturnType<typeof useMessageToaster>['toastSuccess']
                      let showConfirmDialog: ReturnType<typeof useDialogBox>['showConfirmDialog']
                      let go: ReturnType<typeof useRouter>['go']
                  
                  
                  Severity: Minor
                  Found in resources/assets/js/components/utils/GlobalEventListeners.ts - About 1 hr to fix

                    Function renderComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      protected async renderComponent () {
                        commonStore.state.use_last_fm = true
                    
                        artist = factory<Artist>('artist', {
                          id: 42,
                    Severity: Minor
                    Found in resources/assets/js/components/screens/ArtistScreen.spec.ts - About 1 hr to fix

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

                        add (songs: Song | Song[]) {
                          this.state.songs = unionBy(this.state.songs, arrayify(songs), 'id')
                        },
                      Severity: Major
                      Found in resources/assets/js/stores/favoriteStore.ts and 1 other location - About 1 hr to fix
                      resources/assets/js/stores/favoriteStore.ts on lines 25..27

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

                      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

                        remove (songs: Song | Song[]) {
                          this.state.songs = differenceBy(this.state.songs, arrayify(songs), 'id')
                        },
                      Severity: Major
                      Found in resources/assets/js/stores/favoriteStore.ts and 1 other location - About 1 hr to fix
                      resources/assets/js/stores/favoriteStore.ts on lines 21..23

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

                      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('does not have an option to delete songs if current user is not admin', async () => {
                            await this.actingAs().renderComponent()
                            expect(screen.queryByText('Delete from Filesystem')).toBeNull()
                          })
                      Severity: Minor
                      Found in resources/assets/js/components/song/SongContextMenu.spec.ts and 1 other location - About 55 mins to fix
                      resources/assets/js/components/song/SongContextMenu.spec.ts on lines 259..262

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

                      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

                        protected beforeEach () {
                          super.beforeEach(() => {
                            albumStore.vault.clear()
                            albumStore.state.albums = []
                          })
                      Severity: Minor
                      Found in resources/assets/js/stores/albumStore.spec.ts and 1 other location - About 55 mins to fix
                      resources/assets/js/stores/artistStore.spec.ts on lines 8..13

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

                      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.each([
                            ['foo', 'Foo'],
                            ['foo-bar', 'Foo Bar'],
                            ['foo-bar--baz', 'Foo Bar Baz'],
                            ['foo-bar--baz---', 'Foo Bar Baz']
                      Severity: Minor
                      Found in resources/assets/js/utils/formatters.spec.ts and 1 other location - About 55 mins to fix
                      resources/assets/js/utils/formatters.spec.ts on lines 56..61

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

                      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(searchMock).toHaveBeenNthCalledWith(2, song, 'foo')
                              expect(screen.getAllByRole('listitem')).toHaveLength(8)
                            })
                      Severity: Minor
                      Found in resources/assets/js/components/ui/YouTubeVideoList.spec.ts and 1 other location - About 55 mins to fix
                      resources/assets/js/components/ui/YouTubeVideoList.spec.ts on lines 35..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 54.

                      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