adobe/brackets

View on GitHub
src/thirdparty/globmatch.js

Summary

Maintainability
F
4 days
Test Coverage

File globmatch.js has 649 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This is a slightly modified version of the minimatch library
// https://github.com/isaacs/minimatch
// (MIT-licensed, Copyright 2009-2011 Isaac Z. Schlueter)
//
// It has been modified to work properly with RequireJS and
Severity: Major
Found in src/thirdparty/globmatch.js - About 1 day to fix

    Function parse has 188 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function parse (pattern, isSub) {
      var options = this.options
    
      // shortcuts
      if (!options.noglobstar && pattern === "**") return GLOBSTAR
    Severity: Major
    Found in src/thirdparty/globmatch.js - About 7 hrs to fix

      Function braceExpand has 114 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function braceExpand (pattern, options) {
        options = options || this.options
        pattern = typeof pattern === "undefined"
          ? this.pattern : pattern
      
      
      Severity: Major
      Found in src/thirdparty/globmatch.js - About 4 hrs to fix

        Function matchOne has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Minimatch.prototype.matchOne = function (file, pattern, partial) {
          var options = this.options
        
          if (options.debug) {
            console.error("matchOne",
        Severity: Major
        Found in src/thirdparty/globmatch.js - About 3 hrs to fix

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

          function make () {
            // don't do it more than once.
            if (this._made) return
          
            var pattern = this.pattern
          Severity: Minor
          Found in src/thirdparty/globmatch.js - About 1 hr to fix

            Avoid deeply nested control flow statements.
            Open

                      if (swallowee === "." || swallowee === ".." ||
                          (!options.dot && swallowee.charAt(0) === ".")) {
                        if (options.debug)
                          console.error("dot detected!", file, fr, pattern, pr)
                        break WHILE
            Severity: Major
            Found in src/thirdparty/globmatch.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                        if (options.debug)
                          console.error('globstar swallow a segment, and continue')
              Severity: Major
              Found in src/thirdparty/globmatch.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if (options.debug)
                            console.error('globstar found match!', fr, fl, swallowee)
                Severity: Major
                Found in src/thirdparty/globmatch.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (file[fi] === "." || file[fi] === ".." ||
                                (!options.dot && file[fi].charAt(0) === ".")) return false
                  Severity: Major
                  Found in src/thirdparty/globmatch.js - About 45 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      return ret
                    Severity: Major
                    Found in src/thirdparty/globmatch.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return !this.negate
                      Severity: Major
                      Found in src/thirdparty/globmatch.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            if (!hit) return false
                        Severity: Major
                        Found in src/thirdparty/globmatch.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return partial
                          Severity: Major
                          Found in src/thirdparty/globmatch.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                              return regExp
                            Severity: Major
                            Found in src/thirdparty/globmatch.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return braceExpand("\\" + pattern, options)
                              Severity: Major
                              Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  if (options.flipNegate) return false
                                Severity: Major
                                Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return true
                                  Severity: Major
                                  Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            if (fr === fl) return true
                                    Severity: Major
                                    Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                        return this.negate
                                      Severity: Major
                                      Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                            return emptyFileEnd
                                        Severity: Major
                                        Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                return false
                                          Severity: Major
                                          Found in src/thirdparty/globmatch.js - About 30 mins to fix

                                            There are no issues that match your filters.

                                            Category
                                            Status