[C4.3] 在 ARCHITECTURE.md 中添加代码复杂性度量衡

作者: yusufkaraaslan创建于 2026年1月4日更新于 2026年2月5日
标签enhancementroadmap:H1.3

In codebase_scraper.py

def analyze_code_metrics(directory: Path) -> Dict[str, Any]: metrics = { 'complexity': [], 'function_lengths': [], 'nesting_depths': [], 'duplicates': [] } for file in source_files:

Parse with AST (Python) or regex (others)

ast_tree = ast.parse(file.read_text())

Calculate metrics

metrics['complexity'].append(calculate_complexity(ast_tree)) metrics['function_lengths'].append(get_function_sizes(ast_tree)) metrics['nesting_depths'].append(max_nesting_depth(ast_tree)) return { 'avg_complexity': ...

内容来源: yusufkaraaslan/Skill_Seekers