Showing 336 of 336 total issues

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

        Album $album,
        string $source,
        string $extension = 'png',
        ?string $destination = '',
        bool $cleanUp = true
Severity: Minor
Found in app/Services/MediaMetadataService.php - About 35 mins to fix

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

            string $name,
            User $user,
            ?Folder $folder = null,
            array $songs = [],
            ?SmartPlaylistRuleGroupCollection $ruleGroups = null
    Severity: Minor
    Found in app/Services/PlaylistService.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 getByGenre has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

            {
              id: 4,
              name: 'Full Bass',
              preamp: -7.2,
              gains: [-8, 9, 9, 5, 1, -4, -8, -10, -11, -11]
          Severity: Minor
          Found in resources/assets/js/config/audio.ts and 1 other location - About 35 mins to fix
          resources/assets/js/config/audio.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 47.

          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(() => {
                  screen.getByTestId('song-list')
                  expect(screen.queryByTestId('screen-empty-state')).toBeNull()
                })
          Severity: Minor
          Found in resources/assets/js/components/screens/PlaylistScreen.spec.ts and 1 other location - About 35 mins to fix
          resources/assets/js/components/screens/PlaylistScreen.spec.ts on lines 44..47

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

          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

            {
              id: 'rose-petals',
              name: '…Has Its Thorns',
              thumbnailColor: '#7d083b',
              thumbnailUrl: bgRosePetal,
          Severity: Minor
          Found in resources/assets/js/themes.ts and 1 other location - About 35 mins to fix
          resources/assets/js/themes.ts on lines 101..110

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

          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

            {
              id: 'pop-culture',
              thumbnailColor: '#ad0937',
              thumbnailUrl: thumbPopCulture,
              properties: {
          Severity: Minor
          Found in resources/assets/js/themes.ts and 1 other location - About 35 mins to fix
          resources/assets/js/themes.ts on lines 154..163

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

          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

            {
              id: 9,
              name: 'Pop',
              preamp: -6.2,
              gains: [-1, 4, 7, 8, 5, -1, -2, -2, -1, -1]
          Severity: Minor
          Found in resources/assets/js/config/audio.ts and 1 other location - About 35 mins to fix
          resources/assets/js/config/audio.ts on lines 26..31

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

          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(() => {
                  screen.getByTestId('screen-empty-state')
                  expect(screen.queryByTestId('song-list')).toBeNull()
                })
          Severity: Minor
          Found in resources/assets/js/components/screens/PlaylistScreen.spec.ts and 1 other location - About 35 mins to fix
          resources/assets/js/components/screens/PlaylistScreen.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 47.

          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

            {
              id: 'purple-waves',
              name: 'Waves of Fortune',
              thumbnailColor: '#44115c',
              thumbnailUrl: bgPurpleWaves,
          Severity: Minor
          Found in resources/assets/js/themes.ts and 1 other location - About 35 mins to fix
          resources/assets/js/themes.ts on lines 91..100

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

          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

            {
              id: 'nemo',
              thumbnailColor: '#031724',
              thumbnailUrl: thumbNemo,
              properties: {
          Severity: Minor
          Found in resources/assets/js/themes.ts and 1 other location - About 35 mins to fix
          resources/assets/js/themes.ts on lines 111..120

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

          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 maybeSetMediaPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              private function maybeSetMediaPath(): void
              {
                  if (Setting::get('media_path')) {
                      return;
                  }
          Severity: Minor
          Found in app/Console/Commands/InitCommand.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

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

              public function buildUrl(string $uri, bool $appendKey = true): string
              {
                  if (!starts_with($uri, ['http://', 'https://'])) {
                      if ($uri[0] !== '/') {
                          $uri = "/$uri";
          Severity: Minor
          Found in app/Services/ApiClients/ApiClient.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

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

            private tryMatchRoute () {
              if (!this.cache.has(location.hash)) {
                for (let i = 0; i < this.routes.length; i++) {
                  const route = this.routes[i]
                  const matches = location.hash.match(new RegExp(`^#!?${route.path}/?(?:\\?(.*))?$`))
          Severity: Minor
          Found in resources/assets/js/router.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 useInfiniteScroll has a Cognitive Complexity of 7 (exceeds 5 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 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 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 getAllFileEntries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          async function getAllFileEntries (dataTransferItemList: DataTransferItemList) {
            const fileEntries: FileSystemEntry[] = []
            const queue: FileSystemEntry[] = []
          
            for (let i = 0, length = dataTransferItemList.length; i < length; i++) {
          Severity: Minor
          Found in resources/assets/js/utils/directoryReader.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 useUpload has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          export const useUpload = () => {
            const { isAdmin } = useAuthorization()
            const { toastSuccess, toastWarning } = useMessageToaster()
            const { go, isCurrentScreen } = useRouter()
          
          
          Severity: Minor
          Found in resources/assets/js/composables/useUpload.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

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

                await waitFor(() => {
                  expect(fetchMock).toHaveBeenCalledWith(albumId)
                  expect(html()).toMatchSnapshot()
                })
          Severity: Minor
          Found in resources/assets/js/components/ui/AlbumArtOverlay.spec.ts and 1 other location - About 35 mins to fix
          resources/assets/js/components/ui/AlbumArtOverlay.spec.ts on lines 30..33

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

          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