Showing 120 of 336 total issues

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

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

    const init = (el: ElementWithTooltip, binding: DirectiveBinding) => {
      const $tooltip = getOrCreateTooltip(el)
    
      // make sure the actual title is removed from the element, but keep a backup for the updated() hook calls
      $tooltip.querySelector<HTMLDivElement>('.tooltip-content')!.innerText = binding.value
    Severity: Minor
    Found in resources/assets/js/directives/tooltip.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 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.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

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

                  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

                    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

                          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

                                  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

                                        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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language