Skip to content

nur-srijan/cogmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cogmap Logo

🧠 Cogmap

Most codebases are cities. Cogmap is the satellite view.

Cogmap is a Python CLI tool that parses a codebase, builds a weighted dependency graph with graph-theory metrics, and exports it as an interactive cognitive map.

It's not just "AST → diagram." It's "make large systems understandable."


Features

  • 🔍 Deep parsing — modules, classes, functions, imports, call graph (static)
  • 📊 Graph metrics — degree centrality, betweenness centrality, fan-in/fan-out
  • 🌡 Cognitive heatmap — color nodes by criticality (red = core, blue = leaf, gray = dead)
  • 🏗 Architectural smell detection — God modules, circular imports, dead modules, high fan-in
  • 📦 Multiple export formats:
    • Interactive HTML (D3.js, click nodes for details)
    • Mermaid diagram
    • JSON graph (for further tooling)

Install

We recommend using a modern Python tool manager like uv or pipx to install cogmap in an isolated environment.

Recommended: uv (Fastest)

uv tool install cogmap

# Or run directly without installing
uvx cogmap analyze ./my_project

Alternative: pipx

pipx install cogmap

Alternative: Standard pip

pip install cogmap

# or from source:
git clone https://github.com/yourusername/cogmap
cd cogmap && pip install -e .

Usage

# Analyze a project
cogmap analyze ./my_project

# Export interactive HTML map
cogmap export --format html

# Export Mermaid diagram
cogmap export --format mermaid

# Show stats + smell report
cogmap stats

# Options
cogmap analyze ./project --ignore tests,migrations --collapse-stdlib --depth 3

Output

Format Description
cogmap.html Interactive D3.js force graph, click nodes for stats
cogmap.md Mermaid diagram, paste into mermaid.live
cogmap.json Raw graph JSON for further tooling

Roadmap

  • cogmap explain <file> — AI-powered module summarization
  • JavaScript/TypeScript parser
  • Graphviz / PlantUML exporters
  • Git blame overlay (who owns what)

License

MIT

About

Most codebases are cities. Cogmap is the satellite view.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors