MCPcopy
hub / github.com/Tencent/CodeAnalysis / get

Method get

server/projects/main/apps/codeproj/apis/v1.py:127–147  ·  view source on GitHub ↗
(self, request, **kwargs)

Source from the content-addressed store, hash-verified

125 authentication_classes = [TCANodeTokenBackend]
126
127 def get(self, request, **kwargs):
128 project = self.get_project()
129 if project.scan_scheme:
130 metric_setting = core.ScanSchemeManager.get_metric_setting(
131 project.scan_scheme)
132 obj = {
133 "lint_scan_enabled": core.ScanSchemeManager.get_lint_setting(project.scan_scheme).enabled,
134 "cc_scan_enabled": metric_setting.cc_scan_enabled,
135 "dup_scan_enabled": metric_setting.dup_scan_enabled,
136 "cloc_scan_enabled": metric_setting.cloc_scan_enabled
137 }
138 else:
139 obj = {
140 "lint_scan_enabled": False,
141 "cc_scan_enabled": False,
142 "dup_scan_enabled": False,
143 "cloc_scan_enabled": False
144 }
145 obj.update({"url": "%s/repos/%d/schemes/%d/info" %
146 (settings.LOCAL_DOMAIN, project.repo_id, project.scan_scheme_id)})
147 return Response(obj)
148
149
150class ProjectScanJobConfApiView(generics.GenericAPIView):

Callers 15

has_permissionMethod · 0.45
has_permissionMethod · 0.45
has_permissionMethod · 0.45
has_permissionMethod · 0.45
has_permissionMethod · 0.45
has_permissionMethod · 0.45
has_permissionMethod · 0.45
get_projectMethod · 0.45
validate_scheme_typeMethod · 0.45
validateMethod · 0.45
createMethod · 0.45
updateMethod · 0.45

Calls 4

get_metric_settingMethod · 0.80
get_projectMethod · 0.45
get_lint_settingMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected