Aalexbit-codemod

angularjs-dom-mutation

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

miningmetricsangularjscode-miningmigration-assessmentdom_mutation
PRO
0 executions
Use dashboard

Run locally

npx codemod angularjs-dom-mutation

This is a Pro codemod. Preview changes and insights for free, no login or code sharing required. Applying changes and accessing insights requires a paid plan and sign in.Learn more

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

Development

bash

License

MIT

Ready to contribute?

Build your own codemod and share it with the community.