Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🇸🇦 العربية | 🇬🇧 English

🕸️ eidcloud-codebase-graph

Topics: eidcloud call-graph codebase-graph ast-analysis blast-radius dependency-graph php8

Release CI Pipeline PHP: 8.2+ License: MIT Open In Colab

Interactive AST Call-Graph and Dependency Topology Engine for PHP applications. Analyzes static code structures, maps class/method call trees down to database queries, and provides blast radius impact analysis to predict downstream breakage before committing code.


🏛️ Architecture & Call-Graph Topology

flowchart TD
    A["PHP Source Code (*.php)"] --> B["AST Token & Reflection Parser"]
    B --> C["Symbol Extractor (Namespaces, Classes, Methods)"]
    C --> D["Call-Site Linker & Reference Graph"]
    D --> E["Directed Acyclic Graph (DAG)"]
    E --> F["Blast Radius Impact Engine"]
    E --> G["Exporters (Mermaid, DOT, JSON, HTML)"]
Loading

🚀 Capabilities

  • Deep AST Call Traversal: Resolves method calls, static invocations, dependency injection instantiations, and SQL queries.
  • Blast Radius Impact Analysis: Calculates exact upstream callers and downstream dependencies when a symbol changes.
  • Complexity & Instability Metrics: Evaluates Afferent ($C_a$) and Efferent ($C_e$) coupling and Martin Instability metric ($I = \frac{C_e}{C_a + C_e}$).
  • Multiple Exporters: Generates Mermaid diagrams, Graphviz DOT files, and machine-readable JSON dumps.
  • Zero-Dependency Engine: Pure PHP 8.2+ with sub-millisecond graph synthesis.

⚙️ Installation & CLI Usage

git clone https://github.com/shadialhasan/eidcloud-codebase-graph.git
cd eidcloud-codebase-graph

Build & Export Call Graph

# Export Mermaid diagram to console
php bin/eidcloud-graph export ./src/ --format=mermaid

# Calculate Blast Radius for a specific class or method
php bin/eidcloud-graph impact ./src/ --symbol="App\Services\PaymentService::charge"

# Generate complete JSON graph dump
php bin/eidcloud-graph build ./src/ --out=callgraph.json

🧪 Running Automated Tests

php tests/run_tests.php

👤 Author & Maintainer

Eng. MHD. Shadi AL-Hasan


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 MHD. Shadi AL-Hasan. All rights reserved.

About

Interactive AST call-graph and dependency topology engine with blast radius impact analysis in pure PHP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages