nukeop/nuclear

View on GitHub

Showing 285 of 285 total issues

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

  constructor() {
    super();
    this.name = 'Musicbrainz Meta Provider';
    this.sourceName = 'Musicbrainz Meta Provider';
    this.description = 'Metadata provider that uses Musicbrainz as a source.';
Severity: Major
Found in packages/core/src/plugins/meta/musicbrainz.ts and 1 other location - About 3 hrs to fix
packages/core/src/plugins/meta/discogs.ts on lines 33..41

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

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

export function playerRouter(rendererWindow: BrowserWindow['webContents']): ISwaggerizedRouter {

  const router = express.Router() as ISwaggerizedRouter;
  
  swagger.swaggerize(router);
Severity: Major
Found in packages/main/src/services/http/server/api/player.ts - About 3 hrs to fix

    Function initSwagger has 79 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function initSwagger(app: Express): void {
      swagger.reset();
      swagger.initialise(app, {
        title: 'Nuclear REST API',
        description: 'This Api allow you to remotly control nuclear desktop app',
    Severity: Major
    Found in packages/main/src/services/http/server/swagger.ts - About 3 hrs to fix

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

      export function loadBestNewAlbums() {
        return dispatch => {
          dispatch(loadBestNewAlbumsStart());
          getBestNewAlbums()
            .then(albums => {
      Severity: Major
      Found in packages/app/app/actions/dashboard.js and 1 other location - About 3 hrs to fix
      packages/app/app/actions/dashboard.js on lines 116..128

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

      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 loadBestNewTracks() {
        return dispatch => {
          dispatch(loadBestNewAlbumsStart());
          getBestNewTracks()
            .then(tracks => {
      Severity: Major
      Found in packages/app/app/actions/dashboard.js and 1 other location - About 3 hrs to fix
      packages/app/app/actions/dashboard.js on lines 83..95

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

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

        componentDidMount() {
          const { actions } = this.props;
      
          ipcRenderer.send(IpcEvents.STARTED);
      
      
      Severity: Major
      Found in packages/app/app/containers/IpcContainer/index.js - About 3 hrs to fix

        LinuxMediaService has 26 functions (exceeds 20 allowed). Consider refactoring.
        Open

        @systemMediaController() 
        class LinuxMediaService extends MprisService implements NuclearApi {
          tracks: MprisMeta[];
        
          constructor(
        Severity: Minor
        Found in packages/main/src/services/@linux/system-api.ts - About 3 hrs to fix

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

            decreaseSeek = () => {
              const { player, actions} = this.props;
          
              if (player.playbackProgress > 0) {
                actions.updateSeek(player.seek - this.getSeekIteration() * this.coef);
          Severity: Major
          Found in packages/app/app/containers/ShortcutsContainer/index.js and 1 other location - About 2 hrs to fix
          packages/app/app/containers/ShortcutsContainer/index.js on lines 82..90

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

          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

            increaseSeek = () => {
              const { player, actions } = this.props;
              
              if (player.playbackProgress < 100) {
                actions.updateSeek(player.seek + this.getSeekIteration() * this.coef);
          Severity: Major
          Found in packages/app/app/containers/ShortcutsContainer/index.js and 1 other location - About 2 hrs to fix
          packages/app/app/containers/ShortcutsContainer/index.js on lines 92..100

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

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

          const useTreeData = (tracks, localFolders) => {
            return useMemo(() => {
              const pathToEntryMap = {};
              function getEntryForFolder(path) {
                if (pathToEntryMap[path] === undefined) {
          Severity: Major
          Found in packages/app/app/components/LibraryView/LibraryFolderTree/index.js - About 2 hrs to fix

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

                  return {
                    source: this.sourceName,
                    id: videoId,
                    stream: adaptiveFormats.find(({ container, type }) => type.includes('audio') && container === 'webm').url,
                    duration: lengthSeconds,
            Severity: Major
            Found in packages/core/src/plugins/stream/InvidiousPlugin.ts and 1 other location - About 2 hrs to fix
            packages/core/src/plugins/stream/InvidiousPlugin.ts on lines 26..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 89.

            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: videoId,
                    stream: adaptiveFormats.find(({ container, type }) => type.includes('audio') && container === 'webm').url,
                    duration: lengthSeconds,
            Severity: Major
            Found in packages/core/src/plugins/stream/InvidiousPlugin.ts and 1 other location - About 2 hrs to fix
            packages/core/src/plugins/stream/InvidiousPlugin.ts on lines 51..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 89.

            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

            storiesOf('Cards', module)
              .add('Basic blank', () => (
                <div className='bg'>
                  <Card
                    header='Title'
            Severity: Major
            Found in packages/ui/stories/card.stories.js and 1 other location - About 2 hrs to fix
            packages/ui/stories/card.stories.js on lines 6..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 88.

            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

              decreaseVolume = () => {
                const { player, actions } = this.props;
            
                if (player.volume > 0) {
                  actions.updateVolume(player.volume - VOLUME_ITERATION * this.coef);
            Severity: Major
            Found in packages/app/app/containers/ShortcutsContainer/index.js and 1 other location - About 2 hrs to fix
            packages/app/app/containers/ShortcutsContainer/index.js on lines 62..70

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

            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

              increaseVolume = () => {
                const { player, actions } = this.props;
            
                if (player.volume < 100) {
                  actions.updateVolume(player.volume + VOLUME_ITERATION * this.coef);
            Severity: Major
            Found in packages/app/app/containers/ShortcutsContainer/index.js and 1 other location - About 2 hrs to fix
            packages/app/app/containers/ShortcutsContainer/index.js on lines 72..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 87.

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

            export default function PluginsReducer(state=initialState, action) {
              switch (action.type) {
              case CREATE_PLUGINS:
                return {
                  ...state,
            Severity: Major
            Found in packages/app/app/reducers/plugins.js - About 2 hrs to fix

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

              const volumeSliderColors = {
                fillColor: { r: 248, g: 248, b: 242, a: 1 },
                trackColor: { r: 68, g: 71, b: 90, a: 1 },
                thumbColor: { r: 248, g: 248, b: 242, a: 1 }
              };
              packages/app/app/components/Settings/index.js on lines 23..27

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

              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 volumeSliderColors = {
                fillColor: { r: 248, g: 248, b: 242, a: 1 },
                trackColor: { r: 68, g: 71, b: 90, a: 1 },
                thumbColor: { r: 248, g: 248, b: 242, a: 1 }
              };
              Severity: Major
              Found in packages/app/app/components/Settings/index.js and 1 other location - About 2 hrs to fix
              packages/app/app/components/VolumeControls/VolumeSlider/index.js on lines 6..10

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

              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(Config) private config: Config,
                  @inject(LocalLibraryDb) private store: LocalLibraryDb,
                  @inject(AcousticId) private acousticId: AcousticId,
                  @inject($mainLogger) private logger: Logger,
              Severity: Major
              Found in packages/main/src/services/local-library/index.ts and 1 other location - About 2 hrs to fix
              packages/main/src/controllers/settings.ts on lines 15..21

              Duplicated Code

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

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

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

              Tuning

              This issue has a mass of 86.

              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(Config) private config: Config,
                  @inject(HttpApi) private httpApi: HttpApi,
                  @inject(SystemApi) private systemApi: NuclearApi,
                  @inject(Store) private store: Store,
              Severity: Major
              Found in packages/main/src/controllers/settings.ts and 1 other location - About 2 hrs to fix
              packages/main/src/services/local-library/index.ts on lines 31..40

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

              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