src/thirdparty/globmatch.js
File globmatch.js
has 649 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Function parse
has 188 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse (pattern, isSub) {
var options = this.options
// shortcuts
if (!options.noglobstar && pattern === "**") return GLOBSTAR
Function braceExpand
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function braceExpand (pattern, options) {
options = options || this.options
pattern = typeof pattern === "undefined"
? this.pattern : pattern
Function matchOne
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Minimatch.prototype.matchOne = function (file, pattern, partial) {
var options = this.options
if (options.debug) {
console.error("matchOne",
Function make
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function make () {
// don't do it more than once.
if (this._made) return
var pattern = this.pattern
Avoid deeply nested control flow statements. Open
Open
if (swallowee === "." || swallowee === ".." ||
(!options.dot && swallowee.charAt(0) === ".")) {
if (options.debug)
console.error("dot detected!", file, fr, pattern, pr)
break WHILE
Avoid deeply nested control flow statements. Open
Open
if (options.debug)
console.error('globstar swallow a segment, and continue')
Avoid deeply nested control flow statements. Open
Open
if (options.debug)
console.error('globstar found match!', fr, fl, swallowee)
Avoid deeply nested control flow statements. Open
Open
if (file[fi] === "." || file[fi] === ".." ||
(!options.dot && file[fi].charAt(0) === ".")) return false
Avoid too many return
statements within this function. Open
Open
return ret
Avoid too many return
statements within this function. Open
Open
return !this.negate
Avoid too many return
statements within this function. Open
Open
if (!hit) return false
Avoid too many return
statements within this function. Open
Open
return partial
Avoid too many return
statements within this function. Open
Open
return regExp
Avoid too many return
statements within this function. Open
Open
return braceExpand("\\" + pattern, options)
Avoid too many return
statements within this function. Open
Open
if (options.flipNegate) return false
Avoid too many return
statements within this function. Open
Open
return true
Avoid too many return
statements within this function. Open
Open
if (fr === fl) return true
Avoid too many return
statements within this function. Open
Open
return this.negate
Avoid too many return
statements within this function. Open
Open
return emptyFileEnd
Avoid too many return
statements within this function. Open
Open
return false