nukeop/nuclear

View on GitHub

Showing 661 of 661 total issues

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

export enum LocalLibraryKeyNames {
  Pending = 'pending',
  Error = 'error',
  Folders = 'folders',
  Page = 'page',
Severity: Major
Found in packages/app/app/actions/local.ts and 1 other location - About 1 hr to fix
packages/app/app/actions/actionTypes.ts on lines 186..199

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

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 Range has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const Range = ({
  value,
  min,
  max,
  thumbSize,
Severity: Minor
Found in packages/ui/lib/components/Range/index.tsx - About 1 hr 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 getTracksFromDOM has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function getTracksFromDOM(processedIndex) {
    const cookieBanner = document.getElementById('onetrust-banner-sdk');

    if (cookieBanner) {
      cookieBanner.style.setProperty('display', 'none', 'important');
Severity: Minor
Found in packages/core/src/helpers/playlist/spotify.ts - About 1 hr to fix

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

        if (match.path.endsWith(ALBUMS_PATH)) {
          return <FavoriteAlbumsView
            albums={_.get(favorites, 'albums')}
            removeFavoriteAlbum={favoritesActions.removeFavoriteAlbum}
            albumInfoSearch={searchActions.albumInfoSearch}
    Severity: Major
    Found in packages/app/app/containers/FavoritesContainer/index.js and 1 other location - About 1 hr to fix
    packages/app/app/containers/FavoritesContainer/index.js on lines 66..72

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

    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

        if (match.path.endsWith(ARTISTS_PATH)) {
          return <FavoriteArtistsView
            artists={_.get(favorites, 'artists')}
            removeFavoriteArtist={favoritesActions.removeFavoriteArtist}
            artistInfoSearch={searchActions.artistInfoSearch}
    Severity: Major
    Found in packages/app/app/containers/FavoritesContainer/index.js and 1 other location - About 1 hr to fix
    packages/app/app/containers/FavoritesContainer/index.js on lines 45..51

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

    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

                {
                  onAddToDownloads &&
                  <PopupButton
                    ariaLabel={strings.addSelectedTracksToDownloads}
                    label={strings.addSelectedTracksToDownloads}
    packages/ui/lib/components/TrackTable/Headers/SelectionHeader.tsx on lines 56..64

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

    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

                {
                  onAddToFavorites &&
                  <PopupButton
                    ariaLabel={strings.addSelectedTracksToFavorites}
                    label={strings.addSelectedTracksToFavorites}
    packages/ui/lib/components/TrackTable/Headers/SelectionHeader.tsx on lines 65..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 66.

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

    export default function ScrobblingReducer(state=initialState, action) {
      switch (action.type) {
      case Scrobbling.LASTFM_CONNECT:
        return Object.assign({}, state, {
          lastFmAuthToken: action.payload
    Severity: Minor
    Found in packages/app/app/reducers/scrobbling.ts - About 1 hr to fix

      Function extractPlaylist has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async function extractPlaylist(): Promise<SpotifyPlaylist> {
          const playlist = getPlaylistGeneralInfo();
          
          ipcRenderer.sendToHost('import-spotify-playlist-metadata', playlist);
      
      
      Severity: Minor
      Found in packages/core/src/helpers/playlist/spotify.ts - About 1 hr to fix

        Function createChart has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const createChart = (canvas) => {
          const context = canvas.getContext('2d');
          
          const lineGradient = context.createLinearGradient(0, 0, 0, 400);
          lineGradient.addColorStop(0, 'rgb(80, 250, 123, 0.3)');   
        Severity: Minor
        Found in packages/app/app/components/Equalizer/chart.ts - About 1 hr to fix

          Function SettingsContainer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const SettingsContainer: React.FC = () => {
            const dispatch = useDispatch();
            const scrobbling = useSelector(scrobblingSelector);
            const importfavs = useSelector(importfavsSelector);
            const mastodon = useSelector(mastodonSelector);
          Severity: Minor
          Found in packages/app/app/containers/SettingsContainer/index.tsx - About 1 hr to fix

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

                    return [{
                      source: this.sourceName,
                      id: track.id,
                      stream: track.audio,
                      duration: track.duration,
            Severity: Major
            Found in packages/core/src/plugins/stream/JamendoPlugin.ts and 1 other location - About 1 hr to fix
            packages/core/src/plugins/stream/JamendoPlugin.ts on lines 53..61

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

            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

            OauthPopup.propTypes = {
              url: PropTypes.string,
              width: PropTypes.number,
              height: PropTypes.number,
              render: PropTypes.func,
            Severity: Major
            Found in packages/app/app/components/OauthPopup/index.js and 1 other location - About 1 hr to fix
            packages/app/app/containers/SearchResultsContainer/index.js on lines 28..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 65.

            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

                  return {
                    source: this.sourceName,
                    id: track.id,
                    stream: track.audio,
                    duration: track.duration,
            Severity: Major
            Found in packages/core/src/plugins/stream/JamendoPlugin.ts and 1 other location - About 1 hr to fix
            packages/core/src/plugins/stream/JamendoPlugin.ts on lines 25..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 65.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            const mapDispatchToProps = dispatch => bindActionCreators({
              albumInfoSearch: SearchActions.albumInfoSearch,
              artistInfoSearch: SearchActions.artistInfoSearch,
              podcastInfoSearch: SearchActions.podcastSearch,
              addToQueue: QueueActions.addToQueue,
            Severity: Major
            Found in packages/app/app/containers/SearchResultsContainer/index.js and 1 other location - About 1 hr to fix
            packages/app/app/components/OauthPopup/index.js on lines 57..65

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 65.

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

            export const useTrackInfoProps = () => {
              const dispatch = useDispatch();
              const history = useHistory();
              const queue = useSelector(queueSelector);
              const hasTracks = queue.queueItems.length > 0;
            Severity: Minor
            Found in packages/app/app/containers/PlayerBarContainer/hooks.ts - About 1 hr to fix

              Function useArtistViewProps has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useArtistViewProps = () => {
                const dispatch = useDispatch();
                const history = useHistory();
                const { artistId } = useParams<{ artistId: string }>();
                const artistDetails = useSelector(searchSelectors.artistDetails);
              Severity: Minor
              Found in packages/app/app/containers/ArtistViewContainer/hooks.ts - About 1 hr to fix

                Function listen has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  listen(): void {
                    const ipc = this.get<IpcMain>(ipcService);
                    const logger = this.get<Logger>($ipcLogger);
                
                    this.controllers.forEach((Controller) => {
                Severity: Minor
                Found in packages/main/src/utils/container.ts - About 1 hr to fix

                  Function init has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      init() {
                        if (this.platform.isMac()) {
                          const logo = new TouchBarButton({
                            icon: touchbarIcons.logo,
                            backgroundColor: '#000000'
                  Severity: Minor
                  Found in packages/main/src/services/touchbar/index.ts - About 1 hr to fix

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

                      router
                        .post('/play-pause', (req, res) => {
                          rendererWindow.send(IpcEvents.PLAYPAUSE);
                          res.send();
                        })
                    Severity: Major
                    Found in packages/main/src/services/http/server/api/player.ts and 6 other locations - About 1 hr to fix
                    packages/main/src/services/http/server/api/player.ts on lines 33..38
                    packages/main/src/services/http/server/api/player.ts on lines 40..45
                    packages/main/src/services/http/server/api/player.ts on lines 47..52
                    packages/main/src/services/http/server/api/player.ts on lines 61..66
                    packages/main/src/services/http/server/api/player.ts on lines 68..73
                    packages/main/src/services/http/server/api/player.ts on lines 75..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 64.

                    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