Registry
Aalexbit-codemod avatar

angularjs-dom-mutation

Mine AngularJS DOM mutation patterns (jQuery, element, $compile, document); read-only metrics

alexbit-codemod0 executions

  • mining
  • metrics
  • angularjs
  • code-mining
  • migration-assessment
  • dom_mutation

angularjs-dom-mutation

Read-only mining codemod that detects direct DOM manipulation patterns in AngularJS source that block a clean migration to Angular's template/Renderer2 model, and emits dom_mutation metrics. No files are written to the target repo.

What it detects

pattern_kindDetected viaRiskAutomation
jquery$(...) / jQuery(...) calls and $.xxx / jQuery.xxx member accesshighmanual
angular_elementangular.element(...) calls and element.xxx jqLite member access (link/directive element param)highpartial
documentdocument.xxx member accessmediumpartial
compile$compile identifier usage (DI param, direct call, or member access target)criticalmanual
native_dom.querySelector, .getElementById, .innerHTML, .appendChild member access on any objecthighmanual

A single line can match more than one pattern (e.g. angular.element(document.body) reports both angular_element and document) — each is a distinct migration signal and is emitted as its own metric row.

Metrics

MetricCardinalities
dom_mutationfile, line, snippet, pattern_kind, migration_category (dom), risk, automation, effort_points, recommended_phase

Installation

bash
# Install from registry
codemod run angularjs-dom-mutation

# Or run locally
codemod run -w workflow.yaml

Development

bash
# Test the transformation
pnpm test

# Type-check
pnpm run check-types

# Validate the workflow
codemod workflow validate -w workflow.yaml

# Publish to registry
codemod login
codemod publish

License

MIT

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.