angularjs-route-blast-radius
Read-only mining codemod that estimates the migration "blast radius" of every ui-router
$stateProvider.state(...) and ngRoute $routeProvider.when(...) registration in a file — how
many downstream artifacts (component, controller, template, resolves, nested/child states) a
given route touches. No files are written to the target repo.
What it detects
$stateProvider.state('name', { ... })and the single-objectstate({ name: '...', ... })
form (ui-router), including chained.state(a).state(b).state(c)registrations.$routeProvider.when('/path', { ... })(ngRoute).- Per registration:
component,controller,template/templateUrl(including inside a
viewsmap), andresolvekey count. - ui-router nested states, detected by dot-separated state names (
dashboard.settings), plus
how many other states in the same file are children of this one (dashboard.settings.*).
Estimated touch points
text
| Touch points | Risk |
|---|---|
| ≤2 | low |
| 3–5 | medium |
| 6+ | high |
automation is partial when the route has no resolves and isn't nested (a fairly mechanical
Angular Router mapping), and manual otherwise (resolves and nested state hierarchies usually
require re-architecting, not a 1:1 route conversion). effort_points and recommended_phase
scale with resolve_count and is_nested.
Metrics
| Metric | Cardinalities |
|---|---|
route_blast_radius | route_id, router_type, has_component, has_controller, has_template_url, resolve_count, is_nested, estimated_touch_points, file, line, snippet, migration_category, risk, automation, effort_points, recommended_phase |
Limitations
- File-local: the "child state" count only considers other
.state()calls in the same file.
A large ui-router app that splits state definitions across multiple files will under-count
nested-state blast radius; combine withangularjs-routing-inventoryfor a full cross-file
picture. line/snippetare anchored to the.state/.whentoken and its arguments rather than the
whole call expression, because chained calls ($stateProvider.state(a).state(b)) all share the
same call-expression start position at$stateProvider.component/controller/templatedetection inside aviewsmap only looks one level deep.
Run
bash
Testing
bash
Development
bash
License
MIT