Showing 120 of 336 total issues

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

        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

                    Function usePlaylistManagement has a Cognitive Complexity of 9 (exceeds 5 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 55 mins to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function useFloatingUi has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

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

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

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

                            private SongService $songService,
                            private SongRepository $songRepository,
                            private AlbumRepository $albumRepository,
                            private ArtistRepository $artistRepository,
                            private LibraryManager $libraryManager,
                    Severity: Minor
                    Found in app/Http/Controllers/API/SongController.php - About 45 mins to fix

                      Method __invoke has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              ITunesService $iTunesService,
                              SettingRepository $settingRepository,
                              SongRepository $songRepository,
                              ApplicationInformationService $applicationInformationService,
                              QueueService $queueService,
                      Severity: Minor
                      Found in app/Http/Controllers/API/FetchInitialDataController.php - About 45 mins to fix

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

                                private MediaCacheService $mediaCacheService,
                                private Artisan $artisan,
                                private Hash $hash,
                                private DotenvEditor $dotenvEditor,
                                private DB $db,
                        Severity: Minor
                        Found in app/Console/Commands/InitCommand.php - About 45 mins to fix

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

                                  private getID3 $getID3,
                                  private MediaMetadataService $mediaMetadataService,
                                  private SongRepository $songRepository,
                                  private SimpleLrcReader $lrcReader,
                                  private Cache $cache,
                          Severity: Minor
                          Found in app/Services/FileSynchronizer.php - About 45 mins to fix

                            Function resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                              public async resolve () {
                                if (!location.hash || location.hash === '#/' || location.hash === '#!/') {
                                  return this.go(this.homeRoute.path)
                                }
                            
                            
                            Severity: Minor
                            Found in resources/assets/js/router.ts - About 45 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const init = async (container: HTMLElement) => {
                              const gl = document.createElement('canvas').getContext('webgl')!
                              const postctx = container.appendChild(document.createElement('canvas')).getContext('2d')!
                              const postprocess = postctx.canvas
                              const canvas = gl.canvas
                            Severity: Minor
                            Found in resources/assets/js/visualizers/fluid-cube/index.ts - About 45 mins to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

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

                                    private SettingRepository $settingRepository,
                                    private SongRepository $songRepository,
                                    private FileSynchronizer $fileSynchronizer,
                                    private Finder $finder,
                                    private LoggerInterface $logger
                            Severity: Minor
                            Found in app/Services/MediaSyncService.php - About 35 mins to fix

                              Method updateUser has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function updateUser(User $user, string $name, string $email, string|null $password, bool $isAdmin): User
                              Severity: Minor
                              Found in app/Services/UserService.php - About 35 mins to fix

                                Method writeArtistImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        Artist $artist,
                                        string $source,
                                        string $extension = 'png',
                                        ?string $destination = '',
                                        bool $cleanUp = true
                                Severity: Minor
                                Found in app/Services/MediaMetadataService.php - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language