How swastik2828/codescope works
CodeScope is a static-analysis CLI: a developer selects a local or GitHub repository, and the CLI resolves it, gathers file and Go-symbol data, derives dependency links and cycles, calculates health, and generates a report. The README also describes architecture mapping, structural metrics, and an interactive HTML dashboard; the sampled CLI and report code support these outputs. The CLI performs its own file walk, so the separate scanner package is not shown as part of this runtime path. Some report-generation details are omitted because the HTML source excerpt is partial.
Main entry points: main.go Analyze command · github.go GitHub resolver · go_parser.go Go parser · html.go Report generator
Components 14
CLI workflow
- Analyze command
cmd/codescope/main.go - Configuration
internal/config/config.go
Repository sources
- Local resolver
internal/source/local.go - GitHub resolver
internal/source/github.go - Archive extractor
internal/source/archive.go
Static analysis
- Go parser
internal/parser/go_parser.go - Dependency graph
internal/graph/graph.go - Cycle detection
internal/graph/scc.go - Health metrics
internal/metrics/health.go
Results and reports
- Analysis report model
internal/model/schema.go - Report generator
internal/report/html.go
Other components
- Developer
- GitHub
- Report reader
Connections 14
- Developer → Analyze command: runs analysis
- Analyze command → Local resolver: resolves local
- Analyze command → GitHub resolver: resolves remote
- GitHub resolver → GitHub: clones or downloads
- GitHub resolver → Archive extractor: extracts archive
- Analyze command → Configuration: loads settings
- Analyze command → Go parser: parses Go files
- Go parser → Analyze command: returns symbols
- Analyze command → Dependency graph: adds dependencies
- Analyze command → Cycle detection: detects cycles
- Analyze command → Health metrics: calculates health
- Analyze command → Analysis report model: builds report data
- Analyze command → Report generator: generates output
- Report generator → Report reader: writes HTML report