HR/CryptoSync

View on GitHub
src/sync.js

Summary

Maintainability
C
7 hrs
Test Coverage

File sync.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict'
/**
 * sync.js
 * Main cloud sync functionality
 ******************************/
Severity: Minor
Found in src/sync.js - About 4 hrs to fix

    Function getAllFiles has 55 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.getAllFiles = function (email) {
      // get all drive files and start downloading them
      logger.verbose(`PROMISE for retrieving all of ${email} files`)
      return new Promise(
        function (resolve, reject) {
    Severity: Major
    Found in src/sync.js - About 2 hrs to fix

      Function pushCryptQueue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      exports.pushCryptQueue = function (file) {
        logger.verbose(`PROMISE: pushCryptQueue for ${file.name}`)
        return new Promise(function (resolve, reject) {
          exports.cryptQueue.push(file, function (err, file) {
            if (err) {
      Severity: Minor
      Found in src/sync.js - About 35 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

      TODO found
      Open

      // TODO: Implement rename OP
      Severity: Minor
      Found in src/sync.js by fixme

      TODO found
      Open

            // TODO: Implement Btree for file directory structure
      Severity: Minor
      Found in src/sync.js by fixme

      TODO found
      Open

      // TODO: Implement recursive function
      Severity: Minor
      Found in src/sync.js by fixme

      TODO found
      Open

                // TODO: map folderIds to their respective files & append to the toGet arr
      Severity: Minor
      Found in src/sync.js by fixme

      TODO found
      Open

          // TODO: look into using path module
      Severity: Minor
      Found in src/sync.js by fixme

      TODO found
      Open

              // TODO: FIX ASYNC issue >> .then invoked before fetchFolderItems finishes entirely (due to else clause always met
      Severity: Minor
      Found in src/sync.js by fixme

      There are no issues that match your filters.

      Category
      Status