cozy-labs/cozy-desktop

View on GitHub

Showing 415 of 610 total issues

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

          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 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 { action: 'scan', 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 match(parent, true, pattern)
          Severity: Major
          Found in core/ignore.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 { 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 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 new SyncError({ sideName, err, 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

                            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 { action: 'modified', 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

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

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

                                module.exports.setEnabled = enabled => {
                                  autoLauncher
                                    .isEnabled()
                                    .then(was => {
                                      if (was !== enabled) {
                                Severity: Minor
                                Found in gui/js/autolaunch.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 addFileManagerShortcut has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                module.exports.addFileManagerShortcut = config => {
                                  if (platform === 'win32' && major >= 10) {
                                    win10PinToHome(config.syncPath)
                                  } else if (platform === 'win32' && major >= 6) {
                                    winAddLink(config.syncPath)
                                Severity: Minor
                                Found in gui/js/shortcut.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 deleteFileAsync has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  async deleteFileAsync(side /*: SideName */, doc /*: SavedMetadata */) {
                                    log.debug({ path: doc.path }, 'deleteFileAsync')
                                    const file /*: ?SavedMetadata */ = await this.pouch.bySyncedPath(doc.path)
                                
                                    if (!file) {
                                Severity: Minor
                                Found in core/merge.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 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 default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                exports.default = async function (configuration) {
                                  const { execSync } = require('child_process')
                                
                                  const whoami = 'customSign.js'
                                
                                
                                Severity: Minor
                                Found in build/windows/customSign.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