mx-impact
v0.1.1
Published
Blast-radius analyzer for Mendix projects. See what breaks before you change anything.
Maintainers
Readme
mx-impact
Blast-radius analyzer for Mendix projects. See what breaks before you change anything.
Mendix's Studio Pro "Find Usages" is shallow — it misses transitive callers, widget-level bindings, and XPath filters. mx-impact reads your .mpr via mxcli and produces a focused blast-radius view of exactly what a proposed change would touch.
- A tree explorer shows you the project.
mx-impactshows you the consequences of changing one thing inside it.
Features
- 🎯 Focused subgraph — only the elements that reference the target, laid out in concentric rings by severity.
- 📐 Safety score — one number (0–100) you can gate PRs on.
- 🔁 Transitive analysis — follows callers up through microflows and nanoflows.
- 📄 Text / JSON / SARIF output — pipe into CI, a PR comment, or Azure DevOps gates.
- 🖥️ Local web UI — exploratory mode with a blast-radius graph and break list.
- 🧪 Stub mode — develop and demo without a real
.mpr.
Requirements
- Node.js ≥ 18
mxclion yourPATH- A Mendix project (
.mpr). Tested against Mendix 11.6.
mx-impactdoes not modify your.mpr. It is read-only. Still, close the project in Studio Pro before running any MxCLI-backed tool.
Install
npm install -g mx-impactOr use without installing:
npx mx-impact --helpVerify the prerequisites:
mx-impact checkQuick start
CLI
# Analyze an attribute
mx-impact impact attr:Sales.Customer.Email ./MyApp.mpr
# Entity with transitive callers
mx-impact impact entity:Sales.Customer ./MyApp.mpr --transitive
# Machine-readable output for CI
mx-impact impact microflow:Sales.SUB_CalcDiscount ./MyApp.mpr \
--format sarif --out impact.sarifWeb UI
mx-impact serve ./MyApp.mprOpens at http://127.0.0.1:4717. Pick any element from the catalog (or type a target) and watch the blast radius materialize.
Programmatic
import { analyzeImpact } from 'mx-impact';
const report = await analyzeImpact({
target: 'attr:Sales.Customer.Email',
projectPath: './MyApp.mpr',
transitive: true,
});
console.log(report.summary);Target syntax
<kind>:<qualified name>
entity:Module.Entity
attr:Module.Entity.Attribute
microflow:Module.MicroflowName
nanoflow:Module.NanoflowName
page:Module.PageName
enum:Module.EnumNameSeverity model
| Severity | Meaning | |----------------|-------------------------------------------------------------------------| | direct | Element references the target directly. Will break immediately. | | transitive | Reaches the target through one or more microflow/nanoflow calls. | | indirect | Same module or page flow; worth reviewing but may not break. |
Safety score
safetyScore = 100 − (5 × direct) − (2 × transitive) − (1 × indirect), clamped to [0, 100].
| Score | Badge | |---------|---------| | 80–100 | SAFE | | 50–79 | CAUTION | | 0–49 | RISKY |
CI integration
GitHub Actions:
- run: npx mx-impact impact entity:Sales.Customer ./app.mpr --format sarif --out impact.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: impact.sarifAzure DevOps: the SARIF output plugs directly into the SARIF viewer task Mendix Labs supports via MxCLI PR gates.
Development
git clone https://github.com/DHARSHANJ/mx-impact.git
cd mx-impact
npm install
MX_IMPACT_QUERY_MODE=stub npm start -- serve ./dummy.mpr
npm testMX_IMPACT_QUERY_MODE=stub skips real MxCLI calls and returns fixture data — useful for UI work and demos.
Roadmap
- [ ]
mx-impact propose— save refactor plans and apply them atomically - [ ] Claude-powered fix generation for each break
- [ ]
--breaks-if <change>to simulate specific type / rename / delete proposals - [ ] Git hook: block commits whose blast radius exceeds a threshold
- [ ] VS Code extension embedding the web UI
Relation to MX Visuals
MX Visuals is an excellent project explorer — it shows you the whole map of your Mendix app. mx-impact is complementary: it's a change tool that shows only the subgraph relevant to a proposed modification, with severity coloring and a safety score. Use MX Visuals to understand a project; use mx-impact to change one safely.
License
MIT — see LICENSE.
Disclaimer
mx-impact is an independent open-source project, not affiliated with Mendix or Siemens. Analysis quality depends on mxcli, which is itself alpha-quality software; always work against a copy of your project.
