yoichiro/chromeos-filesystem-webdav

View on GitHub

Showing 21 of 50 total issues

Function exports has 208 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (grunt) {

    require('load-grunt-tasks')(grunt);
    require('time-grunt')(grunt);

Severity: Major
Found in Gruntfile.js - About 1 day to fix

    File webdav_fs.js has 496 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    "use strict";
    
    (function() {
    
        // Constructor
    Severity: Minor
    Found in app/scripts/webdav_fs.js - About 7 hrs to fix

      File webdav_client.js has 441 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      "use strict";
      
      (function() {
      
          // Constructor
      Severity: Minor
      Found in app/scripts/webdav_client.js - About 6 hrs to fix

        Function assignEventHandlers has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var assignEventHandlers = function() {
                chrome.fileSystemProvider.onUnmountRequested.addListener(
                    function(options, successCallback, errorCallback) { // Unmount immediately
                        var fileSystemId = options.fileSystemId;
                        var webDavClient = getWebDavClient.call(this, fileSystemId);
        Severity: Major
        Found in app/scripts/webdav_fs.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if (window.FormData &&
                          ((options.dataType && (options.dataType === 'binary')) ||
                           (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) ||
                                             (window.Blob && options.data instanceof Blob))))) {
                          return {
          Severity: Critical
          Found in app/scripts/webdav_client.js - About 2 hrs to fix

            Function get has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                MetadataCache.prototype.get = function(entryPath) {
                    if (entryPath === "/") {
                        return {
                            needFetch: true,
                            exists: true
            Severity: Minor
            Found in app/scripts/metadata_cache.js - About 1 hr to fix

              Function appendCredentialToScreen has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var appendCredentialToScreen = function(credential) {
                      var credentials = document.querySelector("#credentials");
                      var div = document.createElement("div");
                      div.setAttribute("horizontal", "true");
                      div.setAttribute("layout", "true");
              Severity: Minor
              Found in app/scripts/window.js - About 1 hr to fix

                Function closeFile has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    WebDavClient.prototype.closeFile = function(options) {
                        var writeRequest = this.writeRequestMap[options.openRequestId];
                        if (writeRequest && writeRequest.mode === "WRITE") {
                            var localFileName = writeRequest.localFileName;
                            var errorHandler = function(error) {
                Severity: Minor
                Found in app/scripts/webdav_client.js - About 1 hr to fix

                  Function onClickedBtnMount has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var onClickedBtnMount = function(evt) {
                          console.log("onClickedBtnMount");
                          var btnMount = document.querySelector("#btnMount");
                          evt.preventDefault();
                          btnMount.setAttribute("disabled", "true");
                  Severity: Minor
                  Found in app/scripts/window.js - About 1 hr to fix

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

                        WebDavClient.prototype.truncate = function(options) {
                            var headers = createHeaders.call(this, {});
                            $.ajax({
                                type: "GET",
                                url: this.getUrl() + encodePath(options.path),
                    Severity: Minor
                    Found in app/scripts/webdav_client.js - About 1 hr to fix

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

                          var initializeJQueryAjaxBinaryHandler = function() {
                              $.ajaxTransport("+binary", function(options, originalOptions, jqXHR){
                                  if (window.FormData &&
                                      ((options.dataType && (options.dataType === 'binary')) ||
                                       (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) ||
                      Severity: Minor
                      Found in app/scripts/webdav_client.js - About 1 hr to fix

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

                            var onClickedBtnKeep = function(evt) {
                                console.log("onClickedBtnKeep");
                                chrome.storage.local.get("settings", function(items) {
                                    var settings = items.settings || {};
                                    var keepPassword = settings.keepPassword || "keepPasswordNo";
                        Severity: Minor
                        Found in app/scripts/window.js - About 1 hr to fix

                          Function doMount has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var doMount = function(request, sendResponse) {
                                  webdav_fs_.checkAlreadyMounted(request.url, request.username, function(exists) {
                                      if (exists) {
                                          sendResponse({
                                              type: "error",
                          Severity: Minor
                          Found in app/scripts/background.js - About 1 hr to fix

                            Function readDirectory has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                WebDavClient.prototype.readDirectory = function(options) {
                                    var headers = createHeaders.call(this, {
                                        "Content-Type": "text/xml; charset=UTF-8",
                                        "Depth": 1
                                    });
                            Severity: Minor
                            Found in app/scripts/webdav_client.js - About 1 hr to fix

                              Function onReadFileRequested has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  WebDavFS.prototype.onReadFileRequested = function(options, successCallback, errorCallback) {
                                      console.log("onReadFileRequested - start");
                                      console.log(options);
                                      var filePath = getOpenedFiles.call(this, options.fileSystemId)[options.openRequestId];
                                      var webDavClient = getWebDavClient.call(this, options.fileSystemId);
                              Severity: Minor
                              Found in app/scripts/webdav_fs.js - About 1 hr to fix

                                Function setMessageResources has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    var setMessageResources = function() {
                                        var selector = "data-message";
                                        var elements = document.querySelectorAll("[" + selector + "]");
                                
                                        for (var i = 0; i < elements.length; i++) {
                                Severity: Minor
                                Found in app/scripts/window.js - About 1 hr to fix

                                  Function assignEventHandlers has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      var assignEventHandlers = function() {
                                          var btnMount = document.querySelector("#btnMount");
                                          btnMount.addEventListener("click", function(e) {
                                              onClickedBtnMount(e);
                                          });
                                  Severity: Minor
                                  Found in app/scripts/window.js - About 1 hr to fix

                                    Function openFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        WebDavClient.prototype.openFile = function(filePath, requestId, mode, successCallback, errorCallback) {
                                    Severity: Minor
                                    Found in app/scripts/webdav_client.js - About 35 mins to fix

                                      Function doMount has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          var doMount = function(url, authType, username, password, callback) {
                                      Severity: Minor
                                      Found in app/scripts/webdav_fs.js - About 35 mins to fix

                                        Function WebDavClient has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            var WebDavClient = function(webDavFS, url, authType, username, password) {
                                        Severity: Minor
                                        Found in app/scripts/webdav_client.js - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language