Showing 134 of 387 total issues

Function constructor has 27 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

    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

      Method acquireReleaseVersionInteractively has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function acquireReleaseVersionInteractively(): string
          {
              $patchVersion = (clone $this->currentVersion)->incrementPatch()->prefix();
      
              $suggestedVersions = [
      Severity: Minor
      Found in app/Console/Commands/ReleaseCommand.php - About 1 hr to fix

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

        const generate = (partOfCompilation = false): Song => {
          const artistId = faker.datatype.number({ min: 3 })
          const artistName = faker.name.findName()
        
          return {
        Severity: Minor
        Found in resources/assets/js/__tests__/factory/songFactory.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 renderComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                      ITunesService $iTunesService,
                      SettingRepository $settingRepository,
                      SongRepository $songRepository,
                      PlaylistRepository $playlistRepository,
                      ApplicationInformationService $applicationInformationService,
              Severity: Major
              Found in app/Http/Controllers/API/FetchInitialDataController.php - About 1 hr to fix

                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

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

                  public async play (playable: Playable, position = 0) {
                    if (isEpisode(playable)) {
                      useEpisodeProgressTracking().trackEpisode(playable)
                    }
                
                
                Severity: Minor
                Found in resources/assets/js/services/playbackService.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 resolve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  public async resolve () {
                    if (!location.hash || location.hash === '#/' || location.hash === '#!/') {
                      return Router.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 __invoke has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        SongStorage $storage,
                        AlbumRepository $albumRepository,
                        SongRepository $songRepository,
                        UploadRequest $request,
                        Authenticatable $user
                Severity: Minor
                Found in app/Http/Controllers/API/UploadController.php - About 35 mins to fix

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

                          string $genre,
                          array $sortColumns,
                          string $sortDirection,
                          ?User $scopedUser = null,
                          int $perPage = 50
                  Severity: Minor
                  Found in app/Repositories/SongRepository.php - About 35 mins to fix

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

                            UpdatePlaybackStatusRequest $request,
                            SongRepository $songRepository,
                            QueueService $queueService,
                            PodcastService $podcastService,
                            Authenticatable $user
                    Severity: Minor
                    Found in app/Http/Controllers/API/UpdatePlaybackStatusController.php - About 35 mins to fix

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

                              public string $provider,
                              public string $id,
                              public string $email,
                              public string $name,
                              public ?string $avatar,
                      Severity: Minor
                      Found in app/Values/SSOUser.php - About 35 mins to fix

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

                            public function handle($request, Closure $next, $maxAttempts = 600, $decayMinutes = 1, $prefix = ''): Response
                        Severity: Minor
                        Found in app/Http/Middleware/ThrottleRequests.php - About 35 mins to fix

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

                                  Playlist $playlist,
                                  SongRepository $repository,
                                  SmartPlaylistService $smartPlaylistService,
                                  DownloadService $download,
                                  Authenticatable $user
                          Severity: Minor
                          Found in app/Http/Controllers/Download/DownloadPlaylistController.php - About 35 mins to fix

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

                                    array $sortColumns,
                                    string $sortDirection,
                                    bool $ownSongsOnly = false,
                                    ?User $scopedUser = null,
                                    int $perPage = 50
                            Severity: Minor
                            Found in app/Repositories/SongRepository.php - About 35 mins to fix

                              Function useDraggable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const useDraggable = (type: DraggableType) => {
                                const startDragging = (event: DragEvent, dragged: Draggable) => {
                                  if (!event.dataTransfer) {
                                    return
                                  }
                              Severity: Minor
                              Found in resources/assets/js/composables/useDragAndDrop.ts - About 35 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 getLocalPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getLocalPath(Song $song): ?string
                                  {
                                      if (!$song->storage->supported()) {
                                          return null;
                                      }
                              Severity: Minor
                              Found in app/Services/DownloadService.php - About 35 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

                              Severity
                              Category
                              Status
                              Source
                              Language