MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / analyze

Method analyze

client/tool/jaaf.py:38–61  ·  view source on GitHub ↗
(self, params)

Source from the content-addressed store, hash-verified

36 return True
37
38 def analyze(self, params):
39 source_dir = params["source_dir"]
40 work_dir = params["work_dir"]
41
42 rules = RuleParamer.java_param_formart(params["rule_list"])
43 with open("rules.json", "w") as f1:
44 f1.write(json.dumps(rules))
45 f1.close()
46 if not rules:
47 return []
48
49 ast = ASTParser(source_dir, work_dir)
50 ast.parser()
51 bcp = ByteCodeParser(source_dir, work_dir)
52 bcp.parser()
53
54 loong = Loong(
55 config=os.path.join(work_dir, "rules.json"),
56 dbdir=work_dir,
57 project_root=source_dir,
58 jar_mode=False,
59 )
60 result = loong.scan()
61 return result
62
63
64tool = JavaASTAPIFinder

Callers

nothing calls this directly

Calls 8

parserMethod · 0.95
parserMethod · 0.95
scanMethod · 0.95
ASTParserClass · 0.90
ByteCodeParserClass · 0.90
LoongClass · 0.90
java_param_formartMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected