File app.js
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** Entry point of the synchronization core.
*
* @module core/app
* @flow
*/
Function setup
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
async setup() {
const clientInfo = this.clientInfo()
log.info(clientInfo, 'user config')
if (!this.config.isValid()) {
Function sendMailToSupport
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
async sendMailToSupport(content /*: string */) {
const incidentID = uuid()
const zipper = createGzip({
// TODO tweak this values, low resources for now.
memLevel: 7,
Function setup
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
async setup() {
const clientInfo = this.clientInfo()
log.info(clientInfo, 'user config')
if (!this.config.isValid()) {
- 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 addRemote
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
async addRemote(
cozyUrl /*: string */,
syncPath /*: string */,
deviceName /*: string */
) {
Function uploadFileToSupport
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async uploadFileToSupport(
incident /*: string */,
name /*: string */,
data /*: string|stream.Readable */
) {
Function addRemote
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async addRemote(
cozyUrl /*: string */,
syncPath /*: string */,
deviceName /*: string */
) {
- 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 removeRemote
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async removeRemote() {
try {
if (!this.remote) this.instanciate()
try {
- 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"