src/sync.js
File sync.js
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict'
/**
* sync.js
* Main cloud sync functionality
******************************/
Function getAllFiles
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function pushCryptQueue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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) {
- Read upRead up
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
Open
// TODO: Implement rename OP
- Exclude checks
TODO found Open
Open
// TODO: Implement Btree for file directory structure
- Exclude checks
TODO found Open
Open
// TODO: Implement recursive function
- Exclude checks
TODO found Open
Open
// TODO: map folderIds to their respective files & append to the toGet arr
- Exclude checks
TODO found Open
Open
// TODO: look into using path module
- Exclude checks
TODO found Open
Open
// TODO: FIX ASYNC issue >> .then invoked before fetchFolderItems finishes entirely (due to else clause always met
- Exclude checks