get_repo_critical_files
Identify and rank structurally critical files in a repository using complexity and size metrics, directing attention to high-impact code for faster understanding.
Instructions
Identify and analyze the most structurally significant files in a repository to guide code understanding efforts.
PARAMETER:
repo_path: Repository identifier (GitHub URL, Azure DevOps URL, or local path) Examples: 'https://github.com/user/repo', 'https://dev.azure.com/org/project/_git/repo', '/home/user/project' The format will be normalized automatically
RESPONSE CHARACTERISTICS:
Analysis Metrics:
Calculates importance scores based on:
Function count (weight: 2.0)
Total cyclomatic complexity (weight: 1.5)
Maximum cyclomatic complexity (weight: 1.2)
Lines of code (weight: 0.05)
Provides detailed metrics per file
Ranks files by composite importance score
Resource Management:
Repository must be previously cloned via clone_repo
Analysis performed on-demand using Lizard
Efficient for both small and large codebases
Supports both full-repo and targeted analysis
Scope Control Options:
'files': Analyze specific files. If only this is provided, the entire repository will be searched for matching file names.
'directories': Analyze all source files within specific directories.
If BOTH 'files' and 'directories' are provided, the tool will perform an INTERSECTION, analyzing only the files named in 'files' that are also located within the specified 'directories'.
'limit': Control maximum results returned.
Response Metadata:
Total files analyzed
Analysis completion status
NOTE: This tool is designed to guide initial codebase exploration by identifying structurally significant files. Results can be used to target subsequent get_source_repo_map calls for detailed analysis.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| limit | No | ||
| repo_path | Yes | ||
| directories | No | ||
| include_metrics | No |