cnap-cobre/synapse

View on GitHub
frontend/src/services/Dropbox/dropboxFileActions.js

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 2 of 2 total issues

Function uploadFile has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const uploadFile = (csrftoken, file, path) => {
const UPLOAD_FILE_SIZE_LIMIT = 150 * 1024 * 1024;
const db = dbx(csrftoken);
const trimmedPath = path.slice('/dropbox/home'.length);
 
 
Severity: Minor
Found in frontend/src/services/Dropbox/dropboxFileActions.js - About 1 hr to fix

    Function uploadFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    const uploadFile = (csrftoken, file, path) => {
    const UPLOAD_FILE_SIZE_LIMIT = 150 * 1024 * 1024;
    const db = dbx(csrftoken);
    const trimmedPath = path.slice('/dropbox/home'.length);
     
     
    Severity: Minor
    Found in frontend/src/services/Dropbox/dropboxFileActions.js - About 25 mins to fix
    Category
    Status