nukeop/nuclear

View on GitHub

Showing 663 of 663 total issues

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

export const useSpotifyPlaylistImporterProps = (t: TFunction<string>) => {
  const dispatch = useDispatch();
  const onImportFromUrl = useCallback((data: SpotifyPlaylist) => {
    dispatch(PlaylistActions.addPlaylistFromUrl(data, t));
  }, [dispatch, t]);
Severity: Minor
Found in packages/app/app/containers/SpotifyPlaylistImporter/hooks.tsx - 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 usePlayerControlsProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const usePlayerControlsProps = () => {
  const dispatch = useDispatch();
  const queue = useSelector(queueSelector);
  const settings = useSelector(settingsSelector);
  const playbackStatus = useSelector(playerSelectors.playbackStatus);
Severity: Minor
Found in packages/app/app/containers/PlayerBarContainer/hooks.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 eventEmitterControllerFactory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const eventEmitterControllerFactory = (metadataKey: symbol): ClassDecorator => (prefix?: string) => {
  /**
   * Get the metadata attached to the class by event decorator and add the prefix to eventNames if prefix is defined
   * @param target - the instance of the decorated class
   * @returns - the decorated class ready to use with inversify Container
Severity: Minor
Found in packages/main/src/utils/decorators.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 play has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async play() {
    if (this.isReady && this.activity) {
      this.pausedTotal += Date.now() - this.pauseStart;
      if (this.activity) {
        if (this.isPaused) {
Severity: Minor
Found in packages/main/src/services/discord/index.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 useResizablePanel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const useResizablePanel = ({
  initialWidth,
  collapsedWidth,
  collapseThreshold,
  isCollapsed,
Severity: Minor
Found in packages/app/app/containers/SidebarMenuContainer/hooks.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 TrackRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const TrackRow: React.FC<TrackRowProps> = ({
  track,
  mini,
  displayAlbum,
  displayArtist,
Severity: Minor
Found in packages/ui/lib/components/TrackRow/index.tsx - 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 SpotifyPlaylistImporter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const SpotifyPlaylistImporter: React.FC<SpotifyPlaylistImporterProps> = ({ 
  trigger,
  onClose: onCloseProp
}) => {
  const { t } = useTranslation('playlists');

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

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

    tracks={[{
      artist: 'Test Artist 2',
      title: 'Test Title 2',
      createdAt: new Date(new Date().setDate(new Date().getDate() - 1))
    }, {
Severity: Minor
Found in packages/ui/stories/components/trackTable.stories.tsx and 2 other locations - About 35 mins to fix
packages/ui/stories/components/trackTable.stories.tsx on lines 155..159
packages/ui/stories/components/trackTable.stories.tsx on lines 166..170

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

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

    }, {
      id: 'go-to-search',
      name: t('actions.go-to-search'),
      icon: 'search',
      category: t('categories.navigation'),
Severity: Major
Found in packages/app/app/containers/CommandPaletteContainer/hooks.ts and 10 other locations - About 35 mins to fix
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 129..135
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 135..141
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 141..147
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 147..153
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 159..165
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 165..171
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 171..177
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 177..183
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 183..189
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 189..195

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

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

    }, {
      id: 'go-to-favorite-tracks',
      name: t('actions.go-to-favorite-tracks'),
      icon: 'music',
      category: t('categories.navigation'),
Severity: Major
Found in packages/app/app/containers/CommandPaletteContainer/hooks.ts and 10 other locations - About 35 mins to fix
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 129..135
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 135..141
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 141..147
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 147..153
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 153..159
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 159..165
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 165..171
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 171..177
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 177..183
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 189..195

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

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

        PropTypes.shape({
          uuid: PropTypes.string,
          artist: PropTypes.string,
          name: PropTypes.string,
          thumbnail: PropTypes.string
Severity: Minor
Found in packages/app/app/components/PlaylistsSubMenu/index.js and 1 other location - About 35 mins to fix
packages/app/app/components/LibraryView/index.js on lines 146..151

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

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

  queueActions: PropTypes.shape({
    addToQueue: PropTypes.func,
    clearQueue: PropTypes.func,
    selectSong: PropTypes.func,
    playTrack: PropTypes.func
Severity: Minor
Found in packages/app/app/components/LibraryView/index.js and 1 other location - About 35 mins to fix
packages/app/app/components/PlaylistsSubMenu/index.js on lines 37..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 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

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

    }, {
      id: 'go-to-downloads',
      name: t('actions.go-to-downloads'),
      icon: 'download',
      category: t('categories.navigation'),
Severity: Major
Found in packages/app/app/containers/CommandPaletteContainer/hooks.ts and 10 other locations - About 35 mins to fix
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 129..135
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 141..147
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 147..153
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 153..159
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 159..165
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 165..171
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 171..177
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 177..183
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 183..189
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 189..195

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

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

    }, {
      id: 'go-to-settings',
      name: t('actions.go-to-settings'),
      icon: 'cog',
      category: t('categories.navigation'),
Severity: Major
Found in packages/app/app/containers/CommandPaletteContainer/hooks.ts and 10 other locations - About 35 mins to fix
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 129..135
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 135..141
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 141..147
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 147..153
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 153..159
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 165..171
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 171..177
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 177..183
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 183..189
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 189..195

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

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

        {withPlayNext && (
          <PopupButton
            data-testid='track-popup-play-next'
            onClick={onPlayNext}
            ariaLabel='Add track to play next'
Severity: Major
Found in packages/ui/lib/components/TrackPopup/index.tsx and 4 other locations - About 35 mins to fix
packages/ui/lib/components/TrackPopup/index.tsx on lines 100..108
packages/ui/lib/components/TrackPopup/index.tsx on lines 120..128
packages/ui/lib/components/TrackPopup/index.tsx on lines 130..138
packages/ui/lib/components/TrackPopup/index.tsx on lines 165..173

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

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

      const {track} =_.find(payload.downloads, (item) => item.track.uuid === payload.track);
Severity: Minor
Found in packages/app/app/store/middlewares/ipc.ts and 1 other location - About 35 mins to fix
packages/app/app/store/middlewares/ipc.ts on lines 116..116

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

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

    }, {
      artist: 'Test Artist 4',
      title: 'Test Title 4',
      createdAt: new Date(new Date().setDate(new Date().getDate() - 1))
    }]}
Severity: Minor
Found in packages/ui/stories/components/trackTable.stories.tsx and 2 other locations - About 35 mins to fix
packages/ui/stories/components/trackTable.stories.tsx on lines 151..155
packages/ui/stories/components/trackTable.stories.tsx on lines 166..170

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

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

      this.props.actions.addToQueue({
        artist: artist.name,
        name: track.name,
        thumbnail: track.thumbnail || track.image[0]['#text']
      });
Severity: Minor
Found in packages/app/app/containers/SoundContainer/index.js and 1 other location - About 35 mins to fix
packages/app/app/containers/SoundContainer/autoradio.js on lines 198..202

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

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

    }, {
      id: 'go-to-playlists',
      name: t('actions.go-to-playlists'),
      icon: 'list alternate outline',
      category: t('categories.navigation'),
Severity: Major
Found in packages/app/app/containers/CommandPaletteContainer/hooks.ts and 10 other locations - About 35 mins to fix
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 129..135
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 135..141
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 141..147
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 147..153
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 153..159
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 159..165
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 165..171
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 171..177
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 183..189
packages/app/app/containers/CommandPaletteContainer/hooks.ts on lines 189..195

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

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

    try {
      const { uuid } = data;
      this.downloadItems = this.downloadItems.filter((item => item.uuid === uuid));
    } catch (error) {
      this.window.send(IpcEvents.DOWNLOAD_ERROR, { uuid: data.uuid, error });
Severity: Minor
Found in packages/main/src/controllers/download.ts and 2 other locations - About 35 mins to fix
packages/main/src/controllers/download.ts on lines 51..119
packages/main/src/controllers/download.ts on lines 135..144

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