checks the given module's functions code for invalidContent returns an array which contains the functions with invalid content
193576
function(oController, viewId, aInvalidContent, fnProcessInvalidFunction) {
				var _aInvalidControllerFunctions = [];
				Object.keys(oController).forEach(function(sProtoKey) {
					var sFnContent = oController[sProtoKey].toString().replace(/(\r\n|\n|\r)/gm, "");

					aInvalidContent.forEach(function(sInvalidContent) {
						if (sFnContent.indexOf(sInvalidContent) > 0) {
							fnProcessInvalidFunction(oController.getMetadata().getName(), sProtoKey, sInvalidContent, viewId);
						}
					});


				});
				return _aInvalidControllerFunctions;
			}
618550
def argspec_report(functions, module=''):
    '''
    
    '''
    ret = {}
    if '*' in module or '.' in module:
        for fun in fnmatch.filter(functions, module):
            try:
                aspec = get_function_argspec(functions[fun])
            except TypeError:
                # this happens if not callable
                continue

            args, varargs, kwargs, defaults = aspec

            ret[fun] = {}
            ret[fun]['args'] = args if args else None
            ret[fun]['defaults'] = defaults if defaults else None
            ret[fun]['varargs'] = True if varargs else None
            ret[fun]['kwargs'] = True if kwargs else None

    else:
        # "sys" should just match sys without also matching sysctl
        module_dot = module + '.'

        for fun in functions:
            if fun.startswith(module_dot):
                try:
                    aspec = get_function_argspec(functions[fun])
                except TypeError:
                    # this happens if not callable
                    continue

                args, varargs, kwargs, defaults = aspec

                ret[fun] = {}
                ret[fun]['args'] = args if args else None
                ret[fun]['defaults'] = defaults if defaults else None
                ret[fun]['varargs'] = True if varargs else None
                ret[fun]['kwargs'] = True if kwargs else None

    return ret
409012
def check(module):
  global passed, failed
  '''
  
  '''
  module_name = module.rsplit('/', 1)[1]
  if module[-3:] == ".py" and module_name not in IGNORED_FILES:
    print ("CHECKING ", module)
    pout = os.popen('pylint %s'% module, 'r')
    for line in pout:
      if "Your code has been rated at" in line:
        print ("PASSED pylint inspection: " + line)
        passed += 1
        return True
      if "-error" in line:
        print ("FAILED pylint inspection: " + line)
        failed += 1
        errors.append("FILE: " + module)
        errors.append("FAILED pylint inspection: " + line)
        return False
626054
private function checkContent($content)
    {
        if (! is_array($content) and ! is_string($content)) {
            throw new InvalidTypeException(
                'The content must be an array or string value, ' . gettype($content) . ' is given.'
            );
        }

        $this->checkSingleValuedContent($content);

        return is_array($content) ? $content : [$content];
    }
720010
def query_func_module(self, func):
        """"""
        exp = self.session.query(Export).filter_by(
            func=func).first()
        if exp:
            return exp
        logging.debug(_('Function not found: %s'), func)
        alt = func + 'A'
        exp = self.session.query(Export).filter_by(
            func=alt).first()
        if exp:
            logging.warning(_('Using ANSI version: %s'), alt)
            return exp
        logging.warning(_('Not handled: %s or %s'), func, alt)
        return None
323932
def validate_params(req, func)
      params = req["params"]
      if !params
        params = []
      end
      e_params  = func.params.length
      r_params  = params.length
      if e_params != r_params
        msg = "Function #{func.name}: Param length #{r_params} != expected length: #{e_params}"
        return err_resp(req, -32602, msg)
      end

      for i in (0..(e_params-1))
        expected = func.params[i]
        invalid = validate("Param[#{i}]", expected, expected["is_array"], params[i])
        if invalid != nil
          return err_resp(req, -32602, invalid)
        end
      end

      # valid
      return nil
    end
1339225
function decodeError(errorCode) {
    switch (errorCode) {
        case enums.ERROR_MODULE_NOT_EXIST:
            return { status: 404, error: enums.ERROR_MODULE_NOT_EXIST, message: 'This module does not exists.' };
        case enums.ERROR_MODULE_UNREACHABLE:
            return { status: 500, error: enums.ERROR_MODULE_UNREACHABLE, message: 'This module can not be reached.' };
        case enums.ERROR_MODULE_FORBIDDEN:
            return { status: 403, error: enums.ERROR_MODULE_FORBIDDEN, message: 'This module can not be accessed (forbidden).' };
    }
    return { status: 0, error: '', message: '' };
}
505177
function getContent(func) {
  var lines = func.toString().split('\n');
  // Drop the function declaration and closing bracket
  var onlyBody = lines.slice(1, lines.length -1);
  // Drop line number comments generated by Meteor, trim whitespace, make string
  onlyBody = _.map(onlyBody, function(line) {
    return line.slice(0, line.lastIndexOf("//")).trim();
  }).join('\n');
  // Make it look normal
  return beautify(onlyBody, { indent_size: 2 });
}
426898
function validateDoc (doc) {
  let issues = []

  function ignore (field) {
    return IGNORE_WARNINGS[field].indexOf(doc.name) !== -1
  }

  if (!doc.name) {
    issues.push('name missing in document')
  }

  if (!doc.description) {
    issues.push('function "' + doc.name + '": description missing')
  }

  if (!doc.syntax || doc.syntax.length === 0) {
    issues.push('function "' + doc.name + '": syntax missing')
  }

  if (!doc.examples || doc.examples.length === 0) {
    issues.push('function "' + doc.name + '": examples missing')
  }

  if (doc.parameters && doc.parameters.length) {
    doc.parameters.forEach(function (param, index) {
      if (!param.name || !param.name.trim()) {
        issues.push('function "' + doc.name + '": name missing of parameter ' + index + '')
      }
      if (!param.description || !param.description.trim()) {
        issues.push('function "' + doc.name + '": description missing for parameter ' + (param.name || index))
      }
      if (!param.types || !param.types.length) {
        issues.push('function "' + doc.name + '": types missing for parameter ' + (param.name || index))
      }
    })
  } else {
    if (!ignore('parameters')) {
      issues.push('function "' + doc.name + '": parameters missing')
    }
  }

  if (doc.returns) {
    if (!doc.returns.description || !doc.returns.description.trim()) {
      issues.push('function "' + doc.name + '": description missing of returns')
    }
    if (!doc.returns.types || !doc.returns.types.length) {
      issues.push('function "' + doc.name + '": types missing of returns')
    }
  } else {
    if (!ignore('returns')) {
      issues.push('function "' + doc.name + '": returns missing')
    }
  }

  if (!doc.seeAlso || doc.seeAlso.length === 0) {
    if (!ignore('seeAlso')) {
      issues.push('function "' + doc.name + '": seeAlso missing')
    }
  }

  return issues
}
371530
function getValidValues() {
    var typeSpec = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

    var valueStr = void 0;

    if (typeSpec.value) {
        var values = Array.isArray(typeSpec.value) ? typeSpec.value : [typeSpec.value];

        var validValues = values.map(function (value) {
            var valueName = value.name;
            var valueValue = value.value;

            if (valueValue) {
                if ((typeof valueValue === 'undefined' ? 'undefined' : _typeof(valueValue)) === 'object') {
                    return getValidValues(value);
                }

                return valueValue;
            } else if (valueName && valueName !== 'custom') {
                return '<' + valueName + '>';
            }
        });

        valueStr = validValues.join(', ');

        if (typeSpec.name === 'arrayOf') {
            valueStr = 'array[' + valueStr + ']';
        }
    } else if (typeSpec.name) {
        valueStr = '<' + typeSpec.name + '>';
    }

    return valueStr;
}
846651
function checkPreconditions(options) {
    if (!options) {
        throw Error("'options' must be specified!");
    }

    if (!(options.modules instanceof Array)) {
        throw Error("'options.modules' must be an array!");
    }

    // If the modules array is empty, immediately call the onComplete() if it exists
    if (!options.modules.length) {
        if (options.onComplete) {
            invokeOnComplete(options);
        }

        return false;
    }

    return true;
}
23276
function findFunctions(optionFunctions, defaultDir) {
  var allFunctions = [];
  optionFunctions = toArray(optionFunctions);
  optionFunctions.forEach(function (fn, i) {
    if (typeof fn === 'function') {
      allFunctions.push(fn);
      return;
    }
    if (typeof fn !== 'string') {
      throw new Error('function must be a string or array');
    }
    var m = requireMaybe(fn);
    if (!m) {
      m = requireMaybe(path.join(process.cwd(), fn));
    }
    if (!m) {
      m = requireMaybe(path.join('..', defaultDir, fn));
    }
    if (!m) {
      throw new Error('did not find function or problem loading function: ' + fn);
    }
    if (typeof m !== 'function') {
      throw new Error('function module must export a function');
    }
    allFunctions.push(m);
  });
  return allFunctions;
}
250928
function(content) {
                // Convert bad values into empty strings
                var isInvalid = content === null || content === undefined || isNaN(content) && '' + content === 'NaN';
                return '' + (isInvalid ? '' : content);
            }
905360
protected function _validateContent()
    {
        if (!$this->_workingDir) {
            return false;
        }

        $errors = [];
        if (!is_readable("{$this->_workingDir}src") || !is_dir("{$this->_workingDir}src")) {
            $errors[] = __d('installer', 'Invalid package, missing "src" directory.');
        }

        if (!is_readable("{$this->_workingDir}composer.json")) {
            $errors[] = __d('installer', 'Invalid package, missing "composer.json" file.');
        } else {
            $jsonErrors = Plugin::validateJson("{$this->_workingDir}composer.json", true);
            if (!empty($jsonErrors)) {
                $errors[] = __d('installer', 'Invalid "composer.json".');
                $errors = array_merge($errors, (array)$jsonErrors);
            } else {
                $json = (new File("{$this->_workingDir}composer.json"))->read();
                $json = json_decode($json, true);
                list(, $pluginName) = packageSplit($json['name'], true);

                if ($this->params['theme'] && !str_ends_with($pluginName, 'Theme')) {
                    $this->err(__d('installer', 'The given package is not a valid theme.'));

                    return false;
                } elseif (!$this->params['theme'] && str_ends_with($pluginName, 'Theme')) {
                    $this->err(__d('installer', 'The given package is not a valid plugin.'));

                    return false;
                }

                $this->_plugin = [
                    'name' => $pluginName,
                    'packageName' => $json['name'],
                    'type' => str_ends_with($pluginName, 'Theme') ? 'theme' : 'plugin',
                    'composer' => $json,
                ];

                if (Plugin::exists($this->_plugin['name'])) {
                    $exists = plugin($this->_plugin['name']);
                    if ($exists->status) {
                        $errors[] = __d('installer', '{0} "{1}" is already installed.', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name']]);
                    } else {
                        $errors[] = __d('installer', '{0} "{1}" is already installed but disabled, maybe you want try to enable it?.', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name']]);
                    }
                }

                if ($this->_plugin['type'] == 'theme' &&
                    !is_readable("{$this->_workingDir}webroot/screenshot.png")
                ) {
                    $errors[] = __d('installer', 'Missing "screenshot.png" file.');
                }

                if (isset($json['require'])) {
                    $checker = new RuleChecker($json['require']);
                    if (!$checker->check()) {
                        $errors[] = __d('installer', '{0} "{1}" depends on other packages, plugins or libraries that were not found: {2}', [($this->_plugin['type'] == 'plugin' ? __d('installer', 'The plugin') : __d('installer', 'The theme')), $this->_plugin['name'], $checker->fail(true)]);
                    }
                }
            }
        }

        if (!file_exists(ROOT . '/plugins') ||
            !is_dir(ROOT . '/plugins') ||
            !is_writable(ROOT . '/plugins')
        ) {
            $errors[] = __d('installer', 'Write permissions required for directory: {0}.', [ROOT . '/plugins/']);
        }

        foreach ($errors as $message) {
            $this->err($message);
        }

        return empty($errors);
    }
931810
def validate(self):
        
        # Check all values for None
        for attr in self.__dict__:
            if self.__dict__[attr] is None:
                raise ValueError(attr + " is not set")

        # Validate name
        invalid_chars = GPTaskSpec.invalid_chars()
        if any(char in invalid_chars for char in self.name):
            raise ValueError("module name includes invalid characters: " + self.name)

        # Validate LSID
        self._valid_lsid()

        # Validate categories
        if not self.all_strings(self.categories):
            raise TypeError("categories contains non-string value: " + str(self.categories))

        # Validate file formats
        if not self.all_strings(self.file_format):
            raise TypeError("file_format contains non-string value: " + str(self.file_format))

        # Validate support files
        if not self.all_strings(self.support_files):
            raise TypeError("support_files contains non-string value: " + str(self.support_files))

        # Validate parameter list
        if not self._all_params(self.parameters):
            raise TypeError("parameters contains non-GPParamSpec value: " + str(self.parameters))

        # Validate individual parameters
        for param in self.parameters:
            param.validate()

        # Return that everything validates
        return True
1163483
function isValidMethodSpec(methodSpec, methodName) {
  var valid = true;
  var printIgnoredMethodOnce = _.once(function() { console.log(methodName + ' from ' + path.basename(xml2js.opts.custom) + ' is omitted from JS documentation.'); });
  function checkRule(rule, errMsg) {
    if (!rule) {
      printIgnoredMethodOnce();
      console.log('  ' + errMsg);
      valid = false;
    }
  }
  checkRule(_.has(methodSpec, 'description'), 'no description given');
  checkRule(_.has(methodSpec, 'params'), 'no params given (specify "params": {} for no params)');
  _.each(methodSpec.params, function(paramSpec, paramName) {
    checkRule(_.has(paramSpec, 'type'), 'no type given for param ' + paramName);
    checkRule(_.has(paramSpec, 'description'), 'no description given for param ' + paramName);
  });
  checkRule(_.has(methodSpec, 'return'), 'no return given (specify "return": {} for no return value)');
  checkRule(_.has(methodSpec.return, 'type'), 'no type given for return value');
  checkRule(_.has(methodSpec.return, 'description'), 'no description given for return value');
  return valid;
}
1182840
function validateMethods() {
  xml2js.METHODS = _.pick(xml2js.METHODS, function(methodSpec, methodName) {
    return hasValidTypes(methodSpec, methodName);
  });
  _.each(xml2js.CLASSES, function(classSpec, className) {
    var valid = _.pick(classSpec.methods, function(methodSpec, methodName) {
      return hasValidTypes(methodSpec, className + '.' + methodName, className);
    });
    if (xml2js.opts.strict) {
      xml2js.CLASSES[className].methods = valid;
    }
  });
}