nukeop/nuclear

View on GitHub

Showing 654 of 654 total issues

Function playlistRouter has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function playlistRouter(store: Store, rendererWindow: BrowserWindow['webContents']): ISwaggerizedRouter {

  const router = express.Router() as ISwaggerizedRouter;
  
  swagger.swaggerize(router);
Severity: Minor
Found in packages/main/src/services/http/server/api/playlist.ts - About 2 hrs to fix

    Function settingsRouter has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function settingsRouter(store: Store, rendererWindow: BrowserWindow['webContents']): ISwaggerizedRouter {
    
      const router = express.Router() as ISwaggerizedRouter;
    
      swagger.swaggerize(router);
    Severity: Minor
    Found in packages/main/src/services/http/server/api/settings.ts - About 2 hrs to fix

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

        it('should display local library in album grid mode', () => {
          const { component } = mountComponent();
      
          waitFor(() => component.getByTestId('library-list-type-toggle-album-grid').click());
      
      
      packages/app/app/containers/LibraryViewContainer/LibraryViewContainer.test.tsx on lines 36..42

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

      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('should display local library in folder tree mode', () => {
          const { component } = mountComponent();
      
          waitFor(() => component.getByTestId('library-list-type-toggle-folder-tree').click());
      
      
      packages/app/app/containers/LibraryViewContainer/LibraryViewContainer.test.tsx on lines 28..34

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

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

        panes() {
          const artistsHasResults = _.get(this.props.artistSearchResults, ['length'], 0) > 0;
          const albumsHasResults = _.get(this.props.albumSearchResults, ['length'], 0) > 0;
          const tracksHasResults = _.get(this.props.trackSearchResults, ['info', 'length'], 0) > 0;
          const playlistsHasResults = _.get(this.props.playlistSearchResults, ['info', 'length'], 0) > 0;
      Severity: Minor
      Found in packages/app/app/components/SearchResults/index.js - About 1 hr to fix

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

            <div className={styles.empty_state}>
              <FontAwesome name='download' />
              <h2>{t('empty')}</h2>
              <div>{t('empty-help')}</div>
            </div>
        Severity: Major
        Found in packages/app/app/components/Downloads/index.tsx and 1 other location - About 1 hr to fix
        packages/app/app/components/LyricsView/index.tsx on lines 31..35

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

        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

              <div className={styles.empty_state}>
                <Icon name='music' />
                <h2>{t('empty')}</h2>
                <div>{t('empty-help')}</div>
              </div>
        Severity: Major
        Found in packages/app/app/components/LyricsView/index.tsx and 1 other location - About 1 hr to fix
        packages/app/app/components/Downloads/index.tsx on lines 15..19

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

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

        export default function PlayerReducer(state=initialState, action: PlayerReducerActions): PlayerReducerState {
          switch (action.type) {
          case getType(PlayerActions.startPlayback):
            return Object.assign({}, state, {
              playbackStatus: Sound.status.PLAYING
        Severity: Minor
        Found in packages/app/app/reducers/player.ts - About 1 hr to fix

          Function Mic has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const Mic = () => {
            const [audioNode, setAudioNode] = useState<AudioNode>();
            const [audioContext, setAudioContext] = useState<AudioContext>();
            const [preset, setPreset] = useState<string>();
            useEffect(() => {
          Severity: Minor
          Found in packages/ui/stories/components/visualizer.stories.tsx - About 1 hr to fix

            Function constructor has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(
                @inject(Config) private config: Config,
                @inject($mainLogger) private logger: Logger,
                @inject($ipcLogger) private ipcLogger: Logger,
                @inject(Platform) private platform: Platform,
            Severity: Minor
            Found in packages/main/src/services/window/index.ts - About 1 hr to fix

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

                      {windowWidth > VOLUME_POPUP_BREAKPOINT &&
                        <VolumeControls
                          volume={volume}
                          updateVolume={updateVolume}
                          toggleMute={toggleMute}
              Severity: Major
              Found in packages/ui/lib/components/PlayerBar/index.tsx and 1 other location - About 1 hr to fix
              packages/ui/lib/components/PlayerBar/index.tsx on lines 112..121

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

              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

                      {windowWidth < VOLUME_POPUP_BREAKPOINT &&
                        <VolumePopUp
                          volume={volume}
                          updateVolume={updateVolume}
                          toggleMute={toggleMute}
              Severity: Major
              Found in packages/ui/lib/components/PlayerBar/index.tsx and 1 other location - About 1 hr to fix
              packages/ui/lib/components/PlayerBar/index.tsx on lines 122..131

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

              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

              const SearchBox: React.FC<SearchBarProps> = ({
                loading,
                disabled,
                placeholder,
                searchProviders,
              Severity: Major
              Found in packages/ui/lib/components/SearchBox/index.tsx and 1 other location - About 1 hr to fix
              packages/app/app/components/PlayQueue/index.tsx on lines 50..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 72.

              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

                  playOptions={[
                    { icon: ('repeat' as SemanticICONS), enabled: false, name: 'Repeat' },
                    { icon: ('magic' as SemanticICONS), name: 'Autoradio' },
                    { icon: ('random' as SemanticICONS), enabled: false, name: 'Shuffle' }
                  ]}
              Severity: Major
              Found in packages/ui/stories/components/playerBar.stories.tsx and 1 other location - About 1 hr to fix
              packages/ui/stories/components/miniPlayer.stories.tsx on lines 25..29

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

              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

                playOptions={[
                  { icon: ('repeat' as SemanticICONS), enabled: false, name: 'Repeat' },
                  { icon: ('magic' as SemanticICONS), name: 'Autoradio' },
                  { icon: ('random' as SemanticICONS), enabled: false, name: 'Shuffle' }
                ]}
              Severity: Major
              Found in packages/ui/stories/components/miniPlayer.stories.tsx and 1 other location - About 1 hr to fix
              packages/ui/stories/components/playerBar.stories.tsx on lines 29..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 72.

              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

                  const initialState = initialStore ||
                    buildStoreState()
                      .withArtistDetails()
                      .withPlaylists([{
                        id: 'test-playlist-id',
              packages/app/app/containers/PlayQueueContainer/PlayQueueContainer.test.tsx on lines 196..205

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

              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

                  const initialState = initialStore || buildStoreState()
                    .withTracksInPlayQueue()
                    .withPlaylists([{
                      id: 'test-playlist-id',
                      name: 'test playlist',
              packages/app/app/containers/ArtistViewContainer/ArtistViewContainer.test.tsx on lines 220..230

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

              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

                actions: {
                  queueDrop,
                  repositionSong,
                  addToDownloads,
                  selectNewStream,
              Severity: Major
              Found in packages/app/app/components/PlayQueue/index.tsx and 1 other location - About 1 hr to fix
              packages/ui/lib/components/SearchBox/index.tsx on lines 30..45

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

              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

                                <a
                                  href='#'
                                  className={styles.album_favorites_button_wrap}
                                  data-testid='add-remove-favorite'
                                  onClick={
              Severity: Major
              Found in packages/app/app/components/AlbumView/index.tsx and 1 other location - About 1 hr to fix
              packages/app/app/components/ArtistView/index.tsx on lines 76..90

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

              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

                            <a
                              href='#'
                              className={styles.artist_favorites_button_wrap}
                              data-testid='add-remove-favorite'
                              onClick={
              Severity: Major
              Found in packages/app/app/components/ArtistView/index.tsx and 1 other location - About 1 hr to fix
              packages/app/app/components/AlbumView/index.tsx on lines 62..74

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

              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