A-SW Hub / Repositories
Local Gitea · READ ONLY
← 저장소 Repositories
REPOSITORY

via/alice-sdv-demo Private

A-SW 코드-배포 파이프라인 검증용 ALICE SDV 예제

https://git.agrithing.ai/via/alice-sdv-demo.git
13 commits
COMMIT DETAIL

ci: add Python static and dynamic analysis

VIA Quality Engineering <[email protected]> · 2026. 8. 2. 오후 9:32:28
26a84fbca43f6665229b85c799332435603339d4
1 changed files +4 −1 parent 5cf6f47
modified tools/quality_scan.py +4−1 View file
@@ -9,6 +9,9 @@ from pathlib import Path
9 9
10 10 ROOT = Path(__file__).resolve().parents[1]
11 11 SCHEMA = "asw.quality-result/v1"
12 + BRANCH_NODES = (ast.If, ast.For, ast.AsyncFor, ast.While, ast.Try, ast.BoolOp)
13 + if hasattr(ast, "Match"):
14 + BRANCH_NODES += (ast.Match,)
12 15
13 16
14 17 def write_result(path: str, payload: dict) -> None:
@@ -38,7 +41,7 @@ def static_analysis() -> dict:
38 41 for node in ast.walk(tree):
39 42 if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
40 43 functions += 1
41 complexity = 1 + sum(isinstance(item, (ast.If, ast.For, ast.AsyncFor, ast.While, ast.Try, ast.BoolOp, ast.Match)) for item in ast.walk(node))
44 + complexity = 1 + sum(isinstance(item, BRANCH_NODES) for item in ast.walk(node))
42 45 maximum_complexity = max(maximum_complexity, complexity)
43 46 if complexity > 12:
44 47 issues.append({"rule": "PY-COMPLEXITY", "severity": "MEDIUM", "path": relative, "line": node.lineno, "message": f"{node.name} complexity {complexity} exceeds warning threshold 12"})