cozy-labs/cozy-desktop

View on GitHub

Showing 610 of 610 total issues

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

        if (idConflict) {
          log.warn({ idConflict }, IdConflict.description(idConflict))
          return this.resolveConflictAsync(side, doc)
        }
Severity: Major
Found in core/merge.js and 3 other locations - About 30 mins to fix
core/merge.js on lines 107..110
core/merge.js on lines 340..343
core/merge.js on lines 514..517

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

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

Avoid too many return statements within this function.
Open

        return { type: 'ADD', side: outdatedSide.name }
Severity: Major
Found in core/sync/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          if (docA.path.startsWith(docB.path + sep)) return 1
    Severity: Major
    Found in core/sync/index.js - About 30 mins to fix

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

              if (idConflict) {
                log.warn({ idConflict }, IdConflict.description(idConflict))
                return this.resolveConflictAsync(side, doc)
              }
      Severity: Major
      Found in core/merge.js and 3 other locations - About 30 mins to fix
      core/merge.js on lines 107..110
      core/merge.js on lines 340..343
      core/merge.js on lines 637..640

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

      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

        map(
          fn /*: (ChannelBatch) => ChannelBatch */,
          notifyErr /*: Error => any */
        ) /*: Channel */ {
          const channel = new Channel()
      Severity: Minor
      Found in core/local/channel_watcher/channel.js and 1 other location - About 30 mins to fix
      core/local/channel_watcher/channel.js on lines 91..98

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

      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 (remoteDoc.type !== DIR_TYPE && remoteDoc.type !== FILE_TYPE) {
              return {
                sideName,
                type: 'InvalidChange',
                doc: remoteDoc,
      Severity: Minor
      Found in core/remote/watcher/index.js and 1 other location - About 30 mins to fix
      core/remote/watcher/index.js on lines 485..492

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

      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 (doc.docType !== metadata.FILE && doc.docType !== metadata.FOLDER) {
            return {
              sideName,
              type: 'InvalidChange',
              doc,
      Severity: Minor
      Found in core/remote/watcher/index.js and 1 other location - About 30 mins to fix
      core/remote/watcher/index.js on lines 421..448

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

      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

      Avoid too many return statements within this function.
      Open

            if (docA.path.startsWith(docB.path + sep)) return 1
      Severity: Major
      Found in core/sync/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              if (docB.path.startsWith(docA.path + sep)) return -1
        Severity: Major
        Found in core/sync/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return new SyncError({
                sideName,
                err: remoteErrors.wrapError(err, doc),
                doc
              })
          Severity: Major
          Found in core/sync/errors.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return null
            Severity: Major
            Found in core/local/channel_watcher/filter_ignored.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    else return bunyanErrObjectToError(err)
              Severity: Major
              Found in core/utils/sentry.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return { type: 'DEL', side: outdatedSide.name }
                Severity: Major
                Found in core/sync/index.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return 0
                  Severity: Major
                  Found in core/sync/index.js - About 30 mins to fix

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

                            case 'DirDeletion':
                              log.info({ path }, 'folder was deleted permanently')
                              await this.prep.deleteFolderAsync(sideName, change.doc)
                              break
                    Severity: Major
                    Found in core/remote/watcher/index.js and 5 other locations - About 30 mins to fix
                    core/remote/watcher/index.js on lines 623..626
                    core/remote/watcher/index.js on lines 631..634
                    core/remote/watcher/index.js on lines 635..638
                    core/remote/watcher/index.js on lines 639..642
                    core/remote/watcher/index.js on lines 643..646

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

                    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

                    Avoid too many return statements within this function.
                    Open

                        return new SyncError({ sideName, err, code: EXCLUDED_DIR_CODE, doc })
                    Severity: Major
                    Found in core/sync/errors.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return { type: 'EDIT', side: outdatedSide.name }
                      Severity: Major
                      Found in core/sync/index.js - About 30 mins to fix

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

                                case 'FileAddition':
                                  log.info({ path }, 'file was added remotely')
                                  await this.prep.addFileAsync(sideName, change.doc)
                                  break
                        Severity: Major
                        Found in core/remote/watcher/index.js and 5 other locations - About 30 mins to fix
                        core/remote/watcher/index.js on lines 623..626
                        core/remote/watcher/index.js on lines 627..630
                        core/remote/watcher/index.js on lines 635..638
                        core/remote/watcher/index.js on lines 639..642
                        core/remote/watcher/index.js on lines 643..646

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

                        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

                          asyncMap(
                            fn /*: (ChannelBatch) => Promise<ChannelBatch> */,
                            notifyErr /*: Error => any */
                          ) /*: Channel */ {
                            const channel = new Channel()
                        Severity: Minor
                        Found in core/local/channel_watcher/channel.js and 1 other location - About 30 mins to fix
                        core/local/channel_watcher/channel.js on lines 65..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 45.

                        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

                        Avoid too many return statements within this function.
                        Open

                            return { type: 'ADD', side: outdatedSide.name }
                        Severity: Major
                        Found in core/sync/index.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language