google/chromeos-filesystems

View on GitHub

Showing 29 of 78 total issues

Function request has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

WebDAVClient.prototype.request = function(verb, url, headers, data, responseType,
  onSuccess, onError) {
Severity: Major
Found in webdavfs/js/client.js - About 50 mins to fix

    Function ip has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    AWSValidator.prototype.ip = function(ip) {
      if (typeof ip !== 'string') { return false; }
    
      var parts = ip.split('.');
      if (parts.length !== 4) { return false; }
    Severity: Minor
    Found in s3fs/ui/awsvalidator.js - About 45 mins to fix

    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 mount has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var mount = function(bucket, region, access, secret, opt_callbacks) {
    Severity: Minor
    Found in s3fs/js/main.js - About 35 mins to fix

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

      WebDAVClient.prototype.put = function(url, data, opt_headers, onSuccess, onError) {
      Severity: Minor
      Found in webdavfs/js/client.js - About 35 mins to fix

        Function readFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        WebDAVFS.prototype.readFile = function(options) {
          var url = this.url + options.path;
          var headers = null;
        
          if (options.range && (options.range.start || options.range.end)) {
        Severity: Minor
        Found in webdavfs/js/wdfs.js - About 35 mins to fix

        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

        Avoid too many return statements within this function.
        Open

          return true;
        Severity: Major
        Found in s3fs/ui/awsvalidator.js - About 30 mins to fix

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

          var mount = function(bucket, region, access, secret, opt_callbacks) {
            window.s3fs = new S3FS(bucket, region, access, secret);
          
            var callbacks = opt_callbacks || {};
          
          
          Severity: Minor
          Found in s3fs/js/main.js - About 25 mins to fix

          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 restoreCredentials has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var restoreCredentials = function() {
            if (!chrome.storage) { return; }
            chrome.storage.sync.get(keys, function(items) {
              for (var key in items) {
                var value = items[key];
          Severity: Minor
          Found in s3fs/ui/auth.js - About 25 mins to fix

          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 restoreCredentials has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          var restoreCredentials = function() {
            if (!chrome.storage) { return; }
            chrome.storage.sync.get(keys, function(items) {
              for (var key in items) {
                var value = items[key];
          Severity: Minor
          Found in webdavfs/ui/auth.js - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language