Exemplo n.º 1
0
def check_javascript(adoc):
    anid = adoc["_id"]
    if "script" in adoc:
        check_string(adoc["script"], ["W025"])
    if adoc["_id"][:8] == '_design/' and \
       adoc["language"] == "javascript":
        check_dict(adoc)
Exemplo n.º 2
0
def check_javascript(adoc):
    anid = adoc["_id"]
    if "script" in adoc:
        check_string(adoc["script"], ["W025"])
    if adoc["_id"][:8] == '_design/' and \
       adoc["language"] == "javascript":
        check_dict(adoc)
Exemplo n.º 3
0
def check_dict(adic):
    for k,v in adic.items():
        if type(v) == type({}):
            check_dict(v)
        elif type(v) == type("") and re.search("\w*function", v):
            try:
                check_string(v, ["W025"])
            except Exception, e:
                print "\n  Error in: \n", k
                raise e
Exemplo n.º 4
0
def check_dict(adic):
    for k, v in adic.items():
        if type(v) == type({}):
            check_dict(v)
        elif type(v) == type("") and re.search("\w*function", v):
            try:
                check_string(v, ["W025"])
            except:
                print "\n  Error in: \n", k
                traceback.print_exc()
                raise