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

Method analyze

client/tool/eslint.py:53–77  ·  view source on GitHub ↗

扫描分析源码 :param params: :return:

(self, params)

Source from the content-addressed store, hash-verified

51 ToolDisplay.print_log(self.sensitive, self.sensitive_word_maps, message)
52
53 def analyze(self, params):
54 """
55 扫描分析源码
56 :param params:
57 :return:
58 """
59 envs = os.environ
60 work_dir = os.getcwd()
61
62 # 表示Eslint扫描Js以及React框架
63 eslint_type = "JAVASCRIPT"
64 eslint_ext = ".js,.jsx"
65 if "ESLINT_%s_EXT" % eslint_type in envs:
66 eslint_ext = envs.get("ESLINT_%s_EXT" % eslint_type)
67 # 扫描html内嵌js
68 if envs.get("ESLINT_EXT_HTML"):
69 eslint_ext = eslint_ext + ",.html"
70
71 error_output = os.path.join(work_dir, "%s_eslint_result.xml" % eslint_type.lower())
72
73 config_path, rule_filte_flag = self.config(params, eslint_type, True)
74
75 self.scan(params, config_path, error_output, eslint_ext)
76
77 return self.data_handle(params, error_output, rule_filte_flag)
78
79 def config(self, params, eslint_type, use_custom_prority=False):
80 """

Callers

nothing calls this directly

Calls 4

configMethod · 0.95
scanMethod · 0.95
data_handleMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected