nukeop/nuclear

View on GitHub

Showing 661 of 661 total issues

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

    try {
      return Youtube.trackSearch(query, this.sourceName);
    } catch (e) {
      logger.error(`Error while searching  for ${terms} on Youtube`);
      logger.error(e);
Severity: Major
Found in packages/core/src/plugins/stream/YoutubePlugin.ts and 1 other location - About 1 hr to fix
packages/core/src/plugins/stream/YoutubePlugin.ts on lines 27..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 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

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

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

    try {
      return Youtube.getStreamForId(id, this.sourceName);
    } catch (e) {
      logger.error(`Error while looking up streams for id: ${id} on Youtube`);
      logger.error(e);
Severity: Major
Found in packages/core/src/plugins/stream/YoutubePlugin.ts and 1 other location - About 1 hr to fix
packages/core/src/plugins/stream/YoutubePlugin.ts on lines 18..23

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

  router
    .post('/minimize', (req, res) => {
      ipcMain.emit('minimize');
      res.send();
    })
Severity: Major
Found in packages/main/src/services/http/server/api/window.ts and 2 other locations - About 1 hr to fix
packages/main/src/services/http/server/api/window.ts on lines 13..18
packages/main/src/services/http/server/api/window.ts on lines 20..25

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

Function mockAlbumResult has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function mockAlbumResult() {
  global.fetch = jest.fn(() =>
    Promise.resolve({
      json: jest.fn(() => ({
        'resultCount': 1,
Severity: Minor
Found in packages/core/src/plugins/meta/metaMocks/iTunesMusicMocks.ts - About 1 hr to fix

    Function loadUserPlugin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function loadUserPlugin(path) {
      return async (dispatch, getState) => {
        dispatch(loadUserPluginStart(path));
        try {
          const api = createApi();
    Severity: Minor
    Found in packages/app/app/actions/plugins.js - About 1 hr to fix

      Function equalizerRouter has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function equalizerRouter(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/equalizer.ts - About 1 hr to fix

        Function mountComponent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const mountComponent = (initialStore?: AnyProps) => {
            const initialState = initialStore ||
              buildStoreState()
                .withArtistDetails()
                .withPlaylists([{

          Function render has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              return (
                <Route render={({ location }) => {
                  return (
                    <MainLayout>
          Severity: Minor
          Found in packages/app/app/containers/MainContentContainer/index.js - About 1 hr to fix

            Function fetchArtistDetails has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async fetchArtistDetails(artistId: string): Promise<ArtistDetails> {
                const AudiusInfo: AudiusArtistInfo = (await ((await Audius.getArtist(this.apiEndpoint, artistId)).json())).data;
                AudiusInfo.name = cleanName(AudiusInfo.name);
            
                const lastFmInfo: LastFmArtistInfo = (await (await this.lastfm.getArtistInfo(AudiusInfo.name)).json()).artist;
            Severity: Minor
            Found in packages/core/src/plugins/meta/audius.ts - About 1 hr to fix

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

                const mountComponent = mountedComponentFactory(
                  ['/dashboard'],
                  buildStoreState()
                    .withDashboard()
                    .withPlugins()
              packages/app/app/containers/DashboardContainer/DashboardContainer.test.tsx on lines 169..179

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

              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

                    template.push({
                      label: this.trayMenuTranslations.next,
                      type: 'normal',
                      click: async () => {
                        this.window.send(IpcEvents.NEXT);
              Severity: Major
              Found in packages/main/src/services/trayMenu/index.ts and 1 other location - About 1 hr to fix
              packages/main/src/services/trayMenu/index.ts on lines 111..117

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

              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

                    template.push({
                      label: this.trayMenuTranslations.previous,
                      type: 'normal',
                      click: async () => {
                        this.window.send(IpcEvents.PREVIOUS);
              Severity: Major
              Found in packages/main/src/services/trayMenu/index.ts and 1 other location - About 1 hr to fix
              packages/main/src/services/trayMenu/index.ts on lines 103..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 59.

              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 function artistSearch(terms: string, limit: string): Promise<Response> {
                return fetch(`${apiUrl}/search?limit=${limit}&media=music&entity=musicArtist&term=${terms}`);
              }
              Severity: Major
              Found in packages/core/src/rest/iTunes.ts and 1 other location - About 1 hr to fix
              packages/core/src/rest/iTunes.ts on lines 4..6

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

              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

                  constructor(
                      @inject(Platform) private platform: Platform,
                      @inject(Store) private store: Store,
                      @inject(Window) private window: Window
                  ) { }
              Severity: Major
              Found in packages/main/src/services/touchbar/index.ts and 1 other location - About 1 hr to fix
              packages/main/src/services/local-library/db.ts on lines 24..28

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

              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 function podcastSearch(terms: string, limit: string): Promise<Response> {
                return fetch(`${apiUrl}/search?limit=${limit}&media=podcast&term=${terms}`);
              }
              Severity: Major
              Found in packages/core/src/rest/iTunes.ts and 1 other location - About 1 hr to fix
              packages/core/src/rest/iTunes.ts on lines 21..23

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

              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

                constructor(
                  @inject($mainLogger) private logger: Logger,
                  @inject(Config) private config: Config,
                  @inject(Store) private store: Store
                ) {}
              Severity: Major
              Found in packages/main/src/services/local-library/db.ts and 1 other location - About 1 hr to fix
              packages/main/src/services/touchbar/index.ts on lines 26..30

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

              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 mountComponent = mountedComponentFactory(
                  ['/dashboard'],
                  buildStoreState()
                    .withDashboard()
                    .withPlugins()
              packages/app/app/containers/BestNewMusicCardContainer/BestNewMusicCardContainer.test.tsx on lines 48..58

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

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

              const MiniPlayerContainer: React.FC = () => {
                const seekbarProps = useSeekbarProps();
                const playerControlsProps = usePlayerControlsProps();
                const trackInfoProps = useTrackInfoProps();
                const volumeControlsProps = useVolumeControlsProps();
              Severity: Minor
              Found in packages/app/app/containers/MiniPlayerContainer/index.tsx - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language