yoichiro/chromeos-filesystem-webdav

View on GitHub

Showing 50 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

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        WebDavFS.prototype.onMoveEntryRequested = function(options, successCallback, errorCallback) {
            console.log("onMoveEntryRequested");
            console.log(options);
            var webDavClient = getWebDavClient.call(this, options.fileSystemId);
            webDavClient.moveEntry({
    Severity: Major
    Found in app/scripts/webdav_fs.js and 1 other location - About 1 day to fix
    app/scripts/webdav_fs.js on lines 228..246

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 198.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        WebDavFS.prototype.onCopyEntryRequested = function(options, successCallback, errorCallback) {
            console.log("onCopyEntryRequested");
            console.log(options);
            var webDavClient = getWebDavClient.call(this, options.fileSystemId);
            webDavClient.copyEntry({
    Severity: Major
    Found in app/scripts/webdav_fs.js and 1 other location - About 1 day to fix
    app/scripts/webdav_fs.js on lines 208..226

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 198.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          WebDavClient.prototype.moveEntry = function(options) {
              var headers = createHeaders.call(this, {
                  "Destination": this.getUrl() + encodePath(options.targetPath),
                  "Overwrite": "F"
              });
      Severity: Major
      Found in app/scripts/webdav_client.js and 1 other location - About 7 hrs to fix
      app/scripts/webdav_client.js on lines 229..243

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 193.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          WebDavClient.prototype.copyEntry = function(options) {
              var headers = createHeaders.call(this, {
                  "Destination": this.getUrl() + encodePath(options.targetPath),
                  "Overwrite": "F"
              });
      Severity: Major
      Found in app/scripts/webdav_client.js and 1 other location - About 7 hrs to fix
      app/scripts/webdav_client.js on lines 212..226

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 193.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          WebDavFS.prototype.onCreateFileRequested = function(options, successCallback, errorCallback) {
              console.log("onCreateFileRequested");
              console.log(options);
              var webDavClient = getWebDavClient.call(this, options.fileSystemId);
              webDavClient.createFile({
      Severity: Major
      Found in app/scripts/webdav_fs.js and 1 other location - About 6 hrs to fix
      app/scripts/webdav_fs.js on lines 190..206

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 174.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          WebDavFS.prototype.onDeleteEntryRequested = function(options, successCallback, errorCallback) {
              console.log("onDeleteEntryRequested");
              console.log(options);
              var webDavClient = getWebDavClient.call(this, options.fileSystemId);
              webDavClient.deleteEntry({
      Severity: Major
      Found in app/scripts/webdav_fs.js and 1 other location - About 6 hrs to fix
      app/scripts/webdav_fs.js on lines 285..301

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 174.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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 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

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                              $.ajax({
                                  type: "GET",
                                  url: this.getUrl() + encodePath(options.path),
                                  headers: headers,
                                  dataType: "binary",
                      Severity: Major
                      Found in app/scripts/webdav_client.js and 1 other location - About 1 hr to fix
                      app/scripts/webdav_client.js on lines 293..321

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 59.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  $.ajax({
                                      type: "GET",
                                      url: this.getUrl() + encodePath(options.path),
                                      headers: headers,
                                      dataType: "binary",
                          Severity: Major
                          Found in app/scripts/webdav_client.js and 1 other location - About 1 hr to fix
                          app/scripts/webdav_client.js on lines 166..178

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 59.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language