Showing 415 of 610 total issues
Avoid too many return
statements within this function. Open
if (docA.path.startsWith(docB.path + sep)) return 1
Avoid too many return
statements within this function. Open
if (docB.path.startsWith(docA.path + sep)) return -1
Avoid too many return
statements within this function. Open
return new SyncError({
sideName,
err: remoteErrors.wrapError(err, doc),
doc
})
Avoid too many return
statements within this function. Open
return null
Avoid too many return
statements within this function. Open
else return bunyanErrObjectToError(err)
Avoid too many return
statements within this function. Open
return { type: 'DEL', side: outdatedSide.name }
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return new SyncError({ sideName, err, code: EXCLUDED_DIR_CODE, doc })
Avoid too many return
statements within this function. Open
return { type: 'EDIT', side: outdatedSide.name }
Avoid too many return
statements within this function. Open
return { type: 'ADD', side: outdatedSide.name }
Avoid too many return
statements within this function. Open
return event
Avoid too many return
statements within this function. Open
if (docB.path.startsWith(docA.path + sep)) return -1
Avoid too many return
statements within this function. Open
return { type: 'NULL' }
Avoid too many return
statements within this function. Open
return { action: 'created', kind, path: relativePath, ino }
Avoid too many return
statements within this function. Open
return { action: 'scan', kind, path: relativePath, ino }
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.
- 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
Function moveFileAsync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async moveFileAsync(
side /*: SideName */,
doc /*: Metadata */,
was /*: SavedMetadata */
) {
- 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
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) {
- 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
Function moveFolderAsync
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async moveFolderAsync(
side /*: SideName */,
doc /*: Metadata */,
was /*: SavedMetadata */,
newRemoteRevs /*: ?RemoteRevisionsByID */
- 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
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
- 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"