gedankenstuecke/oh_data_uploader

View on GitHub
static/upload.js

Summary

Maintainability
A
2 hrs
Test Coverage

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

function uploadFile(fle,metadata) {
  makeRequest({
    method: 'POST',
    url: "https://www.openhumans.org/api/direct-sharing/project/files/upload/direct/?access_token="+access_token,
    headers: {
Severity: Minor
Found in static/upload.js - About 1 hr to fix

    Function makeRequest has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function makeRequest (opts) {
      return new Promise(function (resolve, reject) {
        var xhr = new XMLHttpRequest();
        xhr.open(opts.method, opts.url);
        xhr.onload = function () {
    Severity: Minor
    Found in static/upload.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status