cozy-labs/cozy-desktop

View on GitHub

Showing 415 of 610 total issues

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

                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

                    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

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

                              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 { type: 'NULL' }
                          Severity: Major
                          Found in core/sync/index.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return { action: 'created', kind, path: relativePath, ino }
                            Severity: Major
                            Found in core/local/channel_watcher/parcel_producer.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return { action: 'scan', kind, path: relativePath, ino }
                              Severity: Major
                              Found in core/local/channel_watcher/parcel_producer.js - About 30 mins to fix

                                Function init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const init = (app, listener) => {
                                  tray = new Tray(nativeImage.createEmpty())
                                
                                  // XXX: updating the status should always come after the initialization of the
                                  // `tray` as we use it.
                                Severity: Minor
                                Found in gui/js/tray.js - About 25 mins 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 moveFileAsync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  async moveFileAsync(
                                    side /*: SideName */,
                                    doc /*: Metadata */,
                                    was /*: SavedMetadata */
                                  ) {
                                Severity: Minor
                                Found in core/prep.js - About 25 mins 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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    run: (docs /*: SavedMetadata[] */) /*: Promise<SavedMetadata[]> */ => {
                                      return Promise.resolve(
                                        docs.map(doc => {
                                          if (doc.incompatibilities) {
                                            if (doc.incompatibilities.length === 1) {
                                Severity: Minor
                                Found in core/migrations/migrations.js - About 25 mins 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 moveFolderAsync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  async moveFolderAsync(
                                    side /*: SideName */,
                                    doc /*: Metadata */,
                                    was /*: SavedMetadata */,
                                    newRemoteRevs /*: ?RemoteRevisionsByID */
                                Severity: Minor
                                Found in core/prep.js - About 25 mins 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 sortForDescendant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const sortForDescendant = (desc, b, descFirst) => {
                                  if (areParentChild(deletedPath(desc), createdPath(b))) return descFirst
                                  if (areParentChild(deletedPath(b), createdPath(desc))) return -descFirst
                                
                                  if (areParentChild(createdPath(b), deletedPath(desc))) return descFirst
                                Severity: Minor
                                Found in core/remote/change.js - About 25 mins 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

                                Severity
                                Category
                                Status
                                Source
                                Language