Measure architectural health metrics (coupling, cohesion, circular dependencies, complexity, and maintainability) of the repository.
(
path: Optional[str] = typer.Argument(None, help="Path to the directory to simulate. Defaults to the current directory."),
context: Optional[str] = typer.Option(None, "--context", "-c", help="Specific context to use"),
)
| 95 | |
| 96 | @simulate_app.command("metrics") |
| 97 | def simulate_metrics( |
| 98 | path: Optional[str] = typer.Argument(None, help="Path to the directory to simulate. Defaults to the current directory."), |
| 99 | context: Optional[str] = typer.Option(None, "--context", "-c", help="Specific context to use"), |
| 100 | ): |
| 101 | """ |
| 102 | Measure architectural health metrics (coupling, cohesion, circular dependencies, complexity, and maintainability) of the repository. |
| 103 | """ |
| 104 | load_cgc_credentials(context) |
| 105 | repo_path = get_repo_path(path) |
| 106 | |
| 107 | services = _initialize_services(context) |
| 108 | db_manager = services[0] |
| 109 | |
| 110 | try: |
| 111 | twin = CodeGraphTwin(repo_path).load_from_db(db_manager) |
| 112 | summary = twin.get_metrics_summary() |
| 113 | print_metrics(summary, f"Architectural Metrics: {twin.repo_name}") |
| 114 | except Exception as e: |
| 115 | console.print(f"[bold red]Simulation Error:[/bold red] {e}") |
| 116 | finally: |
| 117 | db_manager.close_driver() |
| 118 | |
| 119 | |
| 120 | @simulate_app.command("run") |
nothing calls this directly
no test coverage detected