nukeop/nuclear

View on GitHub

Showing 661 of 661 total issues

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

export const fetchNuclearConfiguration = () => async (dispatch) => {
  dispatch(fetchNuclearConfigurationAction.request());
  try {
    const service = new rest.NuclearConfigurationService(
      process.env.NUCLEAR_SERVICES_URL,
Severity: Major
Found in packages/app/app/actions/nuclear/configuration.ts and 1 other location - About 5 hrs to fix
packages/app/app/actions/nuclear/configuration.ts on lines 36..49

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

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

File index.ts has 375 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { app, remote } from 'electron';
import { v4 } from 'uuid';

export enum SettingType {
  BOOLEAN = 'boolean',
Severity: Minor
Found in packages/core/src/settings/index.ts - About 5 hrs to fix

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

            <div className={styles.row}>
              <CardsRow
                cards={
                  playlists?.map(playlist => ({
                    id: playlist.id.toString(),
    packages/app/app/components/Dashboard/EditorialsTab/index.tsx on lines 61..75

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

    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.row}>
              <CardsRow 
                cards={
                  artists?.map(artist => ({
                    id: artist.id.toString(),
    packages/app/app/components/Dashboard/EditorialsTab/index.tsx on lines 42..56

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

    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('should be able to change the lyrics provider plugin', async () => {
        const { component, store } = mountComponent();
        await waitFor(() => component.getAllByText(/Test Lyrics Provider/i)[0].click());
        await waitFor(() => component.getByText(/Different Lyrics Provider/i).click());
    
    
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 22..29
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 31..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 133.

    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('should be able to change the metadata provider plugin', async () => {
        const { component, store } = mountComponent();
        await waitFor(() => component.getAllByText(/Test Meta Provider/i)[0].click());
        await waitFor(() => component.getByText(/Another Meta Provider/i).click());
    
    
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 22..29
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 40..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 133.

    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('should be able to change the streaming provider plugin', async () => {
        const { component, store } = mountComponent();
        await waitFor(() => component.getAllByText(/Test Stream Provider/i)[0].click());
        await waitFor(() => component.getByText(/Different Stream Provider/i).click());
    
    
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 31..38
    packages/app/app/containers/PluginsContainer/PluginsContainer.test.tsx on lines 40..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 133.

    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('shows the track as verified if there are many verifications', async () => {
        fetchMock.post('http://verification.nuclear/stream-mappings/top-stream', {
          stream_id: 'CuklIb9d3fI',
          score: 10
        });
    packages/app/app/containers/StreamVerificationContainer/StreamVerificationContainer.test.tsx on lines 41..56

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

    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 go to best new track review after clicking it', async () => {
        const { component } = mountComponent();
        await waitFor(() => component.getByText(/Best new music/i).click());
    
        await waitFor(() => component.getByText(/test track title 2/i).click());
    packages/app/app/containers/DashboardContainer/DashboardContainer.test.tsx on lines 44..52

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

    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 go to best new album review after clicking it', async () => {
        const { component } = mountComponent();
        await waitFor(() => component.getByText(/Best new music/i).click());
    
        await waitFor(() => component.getByText(/test title 2/i).click());
    packages/app/app/containers/DashboardContainer/DashboardContainer.test.tsx on lines 54..62

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

    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('shows the track as weakly verified if there are few verifications', async () => {
        fetchMock.post('http://verification.nuclear/stream-mappings/top-stream', {
          stream_id: 'CuklIb9d3fI',
          score: 1
        });
    packages/app/app/containers/StreamVerificationContainer/StreamVerificationContainer.test.tsx on lines 58..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 130.

    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('tolerates typos', () => {
        const tracks = [
          ytTrack({
            title: 'The Whte Stipes - Sevn Natn Ary'
          }),
    Severity: Major
    Found in packages/core/src/rest/heuristics.test.ts and 2 other locations - About 4 hrs to fix
    packages/core/src/rest/heuristics.test.ts on lines 130..155
    packages/core/src/rest/heuristics.test.ts on lines 238..263

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

    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('prefers high quality videos', () => {
        const tracks = [
          ytTrack({
            title: 'Ozzy Osbourne - Crazy Train (crappy bootleg)'
          }),
    Severity: Major
    Found in packages/core/src/rest/heuristics.test.ts and 2 other locations - About 4 hrs to fix
    packages/core/src/rest/heuristics.test.ts on lines 83..108
    packages/core/src/rest/heuristics.test.ts on lines 238..263

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

    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('ranks live videos normally if they also appear in the search query title', () => {
        const tracks = [
          ytTrack({
            title: 'Black Sabbath - Paranoid'
          }),
    Severity: Major
    Found in packages/core/src/rest/heuristics.test.ts and 2 other locations - About 4 hrs to fix
    packages/core/src/rest/heuristics.test.ts on lines 83..108
    packages/core/src/rest/heuristics.test.ts on lines 130..155

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

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

    export const StreamVerificationContainer: React.FC = () => {
      const { t } = useTranslation('queue');
      const dispatch = useDispatch();
      const queue = useSelector(queueSelector);
      const settings = useSelector(settingsSelector);
    Severity: Major
    Found in packages/app/app/containers/StreamVerificationContainer/index.tsx - About 4 hrs to fix

      Function SpotifyPlaylistImporter has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const SpotifyPlaylistImporter: React.FC= () => {
        const { t } = useTranslation('playlists');
        const { onAccept, importProgress, playlistMeta, onClose } = useSpotifyPlaylistImporterProps(t);
        const progressPercent = Math.round((playlistMeta?.totalTracks ? importProgress/playlistMeta.totalTracks : 0) * 100);
      
      

        Function ipcConnect has 108 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ipcConnect: Middleware = () => next => {
          next({
            type: LocalLibrary.UPDATE_LOCAL_FOLDERS,
            payload: ipcRenderer.sendSync(IpcEvents.LOCALFOLDERS_GET)
          });
        Severity: Major
        Found in packages/app/app/store/middlewares/ipc.ts - About 4 hrs to fix

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

                <section className={styles.plugin_settings_section}>
                  <Header>{t('meta-providers')}</Header>
                  <hr />
                  <Segment>
                    <label>
          Severity: Major
          Found in packages/app/app/components/PluginsView/index.tsx and 2 other locations - About 4 hrs to fix
          packages/app/app/components/PluginsView/index.tsx on lines 62..75
          packages/app/app/components/PluginsView/index.tsx on lines 92..105

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

          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('search tracks', async () => {
              mockFetch('test');
              const endpoint = await rest.Audius._findHost();
              mockFetch([{ test: 'test data' }]);
              const response = await rest.Audius.trackSearch(endpoint, 'roto');
          Severity: Major
          Found in packages/core/src/rest/audius.test.ts and 1 other location - About 4 hrs to fix
          packages/core/src/rest/audius.test.ts on lines 78..85

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

          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

                <section className={styles.plugin_settings_section}>
                  <Header>{t('stream-providers')}</Header>
                  <hr />
                  <Segment>
                    <label>
          Severity: Major
          Found in packages/app/app/components/PluginsView/index.tsx and 2 other locations - About 4 hrs to fix
          packages/app/app/components/PluginsView/index.tsx on lines 77..90
          packages/app/app/components/PluginsView/index.tsx on lines 92..105

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

          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