nukeop/nuclear

View on GitHub

Showing 665 of 665 total issues

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

          <div className={styles.favorite_part}>
            <Icon name={isFavorite ? 'heart' : 'heart outline'}
              size='large'
              onClick={
                isFavorite
Severity: Major
Found in packages/ui/lib/components/TrackInfo/index.tsx and 1 other location - About 1 hr to fix
packages/ui/lib/components/MiniPlayer/MiniTrackInfo/index.tsx on lines 31..43

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

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

export type AudiusReleaseSearchResult = {
  id: number;
  cover_image: string;
  genre: string[];
  style: string[];
Severity: Major
Found in packages/core/src/rest/Audius.types.ts and 1 other location - About 1 hr to fix
packages/core/src/rest/Discogs.types.ts on lines 30..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 62.

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 3 locations. Consider refactoring.
Open

export function setNumberOption(option, state, fromMain) {
  setOption(option, state);

  return {
    type: Settings.SET_NUMBER_OPTION,
Severity: Major
Found in packages/app/app/actions/settings.ts and 2 other locations - About 1 hr to fix
packages/app/app/actions/settings.ts on lines 13..21
packages/app/app/actions/settings.ts on lines 23..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 62.

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 3 locations. Consider refactoring.
Open

  it('add api key to url', () => {
    const api = setupLastFmApi('test', 'test');
    const url = 'http://example.com?test=test1&test2=test3';
    const withKey = api.addApiKey(url);

Severity: Major
Found in packages/core/src/rest/lastfm.test.ts and 2 other locations - About 1 hr to fix
packages/core/src/rest/lastfm.test.ts on lines 22..28
packages/core/src/rest/lastfm.test.ts on lines 30..36

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

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

  createPopup() {
    const {
      url,
      width,
      height,
Severity: Minor
Found in packages/app/app/components/OauthPopup/index.js - About 1 hr to fix

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

    export function addPlaylistFromFile(filePath, t) {
      return async dispatch => {
        if (!filePath || typeof filePath !== 'string') {
          dispatch(error(t('import-fail-title'), t('error-empty-data'), null, null));
          return;
    Severity: Minor
    Found in packages/app/app/actions/playlists.ts - About 1 hr to fix

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

      export const CommandPaletteContainer: React.FC = () => {
        const { t } = useTranslation('command-palette');
        const [isOpen, setOpen] = useState(false);
        const [input, setInput] = useState('');
        const inputRef = useRef<Input>();
      Severity: Minor
      Found in packages/app/app/containers/CommandPaletteContainer/index.tsx - About 1 hr to fix

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

        export type SpotifyTrack = {
          index: number;
          id?: string;
          thumbnail: string;
          title: string;
        packages/core/src/helpers/playlist/spotify.ts on lines 3..12

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

        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

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

          async fetchArtistDetailsByName(artistName: string): Promise<ArtistDetails> {
            const artists = await this.searchForArtists(artistName);
            return this.fetchArtistDetails(artists[0]?.id); 
          }
        Severity: Major
        Found in packages/core/src/plugins/meta/bandcamp.ts and 1 other location - About 1 hr to fix
        packages/core/src/plugins/meta/itunesmusic.ts on lines 106..109

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

        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

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

          async fetchArtistDetailsByName(artistName: string): Promise<ArtistDetails> {
            const artists = await this.searchForArtists(artistName);
            return this.fetchArtistDetails(artists[0]?.id); 
          }
        Severity: Major
        Found in packages/core/src/plugins/meta/itunesmusic.ts and 1 other location - About 1 hr to fix
        packages/core/src/plugins/meta/bandcamp.ts on lines 93..96

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

        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: 'go-to-next-page',
              name: t('actions.go-to-next-page'),
              shortcut: [isMac() ? '⌥ + →' : 'alt + →'],
              icon: 'chevron right',
        packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 73..80

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

        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

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

        type SpotifyTrack = {
          index: number;
          id?: string;
          thumbnail: string;
          title: string;
        Severity: Major
        Found in packages/core/src/helpers/playlist/spotify.ts and 1 other location - About 1 hr to fix
        packages/app/app/containers/SpotifyPlaylistImporter/hooks.tsx on lines 12..21

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

        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: 'go-to-previous-page',
              name: t('actions.go-to-previous-page'),
              shortcut: [isMac() ? '⌥ + ←' : 'alt + ←'],
              icon: 'chevron left',
        packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 66..73

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

        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: 'previous',
              name: t('actions.previous'),
              shortcut: [isMac() ? '⌘ + ←' : 'ctrl + ←'],
              icon: 'backward',
        packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 52..59

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

        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: 'next',
              name: t('actions.next'),
              shortcut: [isMac() ? '⌘ + →' : 'ctrl + →'],
              icon: 'forward',
        packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 59..66

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

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

        export default function QueueReducer(state = defaultState, action) {
          switch (action.type) {
          case Queue.ADD_QUEUE_ITEM:
            return {
              ...state,
        Severity: Minor
        Found in packages/app/app/reducers/queue.ts - About 1 hr to fix

          Function Toast has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Toast = (props: ToastProps) => {
            return (
              <div
                className={cx(
                  common.nuclear,
          Severity: Minor
          Found in packages/ui/lib/components/ToastContainer/Toast/index.tsx - About 1 hr to fix

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

                  podcastsHasResults && {
                    menuItem: this.props.t('podcast'),
                    render: () =>
                      this.renderPane(
                        this.props.podcastSearchResults,
            Severity: Major
            Found in packages/app/app/components/SearchResults/index.js and 2 other locations - About 1 hr to fix
            packages/app/app/components/SearchResults/index.js on lines 117..124
            packages/app/app/components/SearchResults/index.js on lines 125..132

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

            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 3 locations. Consider refactoring.
            Open

                  albumsHasResults && {
                    menuItem: this.props.t('album_plural'),
                    render: () =>
                      this.renderPane(
                        this.props.albumSearchResults,
            Severity: Major
            Found in packages/app/app/components/SearchResults/index.js and 2 other locations - About 1 hr to fix
            packages/app/app/components/SearchResults/index.js on lines 117..124
            packages/app/app/components/SearchResults/index.js on lines 145..152

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

            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 4 locations. Consider refactoring.
            Open

              lastFmTrackSearchSuccess: createStandardAction(Search.LASTFM_TRACK_SEARCH_SUCCESS).map((terms: string, searchResults: LastfmTrackMatchInternal[]) => {
                return {
                  payload: {
                    id: terms,
                    info: searchResults
            Severity: Major
            Found in packages/app/app/actions/search.ts and 3 other locations - About 1 hr to fix
            packages/app/app/actions/search.ts on lines 22..29
            packages/app/app/actions/search.ts on lines 31..38
            packages/app/app/actions/search.ts on lines 108..115

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

            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