Showing 415 of 610 total issues
File index.js
has 883 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module core/sync
* @flow
*/
Function updateFileAsync
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
async updateFileAsync(side /*: SideName */, doc /*: Metadata */) {
log.debug({ path: doc.path }, 'updateFileAsync')
const file /*: ?SavedMetadata */ = await this.pouch.bySyncedPath(doc.path)
if (!file) {
- 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
File merge.js
has 702 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module core/merge
* @flow
*/
File local_change.js
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** A local change as to be fed to Prep/Merge.
*
* Ended up being specific to ChokidarWatcher.
*
* @module core/local/chokidar/local_change
File metadata.js
has 589 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** Metadata of synchronized files & directories.
*
* ### File
*
* - `_rev`: from PouchDB
File main.js
has 571 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict'
require('../core/globals')
// Initialize `remote` module so that renderer processes can use it.
Function syncBatch
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
async syncBatch() /*: Promise<void> */ {
let change /*: Change */ = {}
while (!this.lifecycle.willStop()) {
await this.lifecycle.ready()
- 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 initialDiff
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
async function initialDiff(
channel /*: Channel */,
out /*: Channel */,
{ config, state } /*: { config: Config, state: InitialDiffState } */
) /*: Promise<void> */ {
- 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 debounce
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
function debounce(waiting /*: WaitingItem[] */, events /*: ChannelEvent[] */) {
for (let i = 0; i < events.length; i++) {
const event = events[i]
if (event.incomplete) {
- 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
File index.js
has 527 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module core/remote/watcher
* @flow
*/
Function sortForMove
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
const sortForMove = (move, b, moveFirst) => {
if (isMove(b)) {
if (isDescendant(move) && isDescendant(b)) {
if (areParentChild(deletedPath(move), deletedPath(b))) return moveFirst
if (areParentChild(deletedPath(b), deletedPath(move))) return -moveFirst
- 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 putFolderAsync
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
async putFolderAsync(side /*: SideName */, doc /*: Metadata */) {
log.debug({ path: doc.path }, 'putFolderAsync')
const folder /*: ?SavedMetadata */ = await this.pouch.bySyncedPath(doc.path)
if (!folder) {
- 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
File cozy.js
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module core/remote/cozy
* @flow
*/
File index.js
has 455 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @module core/pouch
* @flow
*/
Function Details
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Details = props => {
const { translate, interpolate } = props
return e('div', { className: 'details' }, [
e('header', { className: 'details__header' }, [
Function applyDoc
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
async applyDoc(
doc /*: SavedMetadata */,
side /*: Writer */
) /*: Promise<*> */ {
if (doc.incompatibilities && side.name === 'local') {
- 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 wrapError
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
const wrapError = (
err /*: FetchError | Error */,
doc /*: ?SavedMetadata */
) /*: RemoteError */ => {
if (isNetworkError(err)) {
Function makeComparator
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
const makeComparator = (
name /*: string */,
{ attributes } /*: { attributes?: Array<string> } */ = {}
) => {
const interestingPaths = attributes && attributes.map(f => f.split('.'))
- 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 38 (exceeds 5 allowed). Consider refactoring. Open
async moveFileAsync(
side /*: SideName */,
doc /*: Metadata */,
was /*: SavedMetadata */
) /*: Promise<*> */ {
- 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 wrapError
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
const wrapError = (
err /*: FetchError | Error */,
doc /*: ?SavedMetadata */
) /*: RemoteError */ => {
if (isNetworkError(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"