Repository navigation
Description
Summary
On a large Mendix 10.24.13 project (MPR v2, 59 modules, about 1,700 flows), mxcli report architecture lists 200 documents as unused with 0 to verify. 24 of them are in use. I found them by scanning the unit files in mprcontents/ for the qualified name of each document: a document whose name occurs in another live unit is referenced, whatever the catalog says.
Each false positive comes from one of the reference kinds below, which have no row in refs. All of them reproduce on v0.34.0 and on nightly-20261203-91281266f.
Names are changed; the project is a client's.
Reference kinds without a refs row
| # | Reference | What the catalog has | Effect |
|---|---|---|---|
| 1 | Navigation menu item that calls a nanoflow | navigation_menu_items.ActionType = 'Forms$CallNanoflowClientAction', TargetMicroflow empty, no refs row. DESCRIBE NAVIGATION prints call nanoflow Mod.ACT_Open correctly. |
Nanoflow listed as unused. (#1579 fixed this for microflows.) |
| 2 | Items of a menu document (show page, call microflow) |
The menu is in menus, but nothing in refs has the menu as source. DESCRIBE MENU prints the items correctly. |
Pages opened only from a menu document are listed as unused. |
| 3 | Everything inside a template grid (Forms$TemplateGrid > Forms$TemplateGridContents) |
The grid itself is in widgets; its content is not walked. No widgets, no refs, and DESCRIBE PAGE omits the content. |
Missed in this project: action buttons with a microflow or nanoflow action, a data view with a microflow source, a snippet call, an image with an on-click nanoflow. Widget counts are short as well (for example 1,113 Forms$DivContainer in the unit files against 1,090 in widgets). |
| 4 | Microflow called from an import mapping (find Mod.Entity by Mod.GetIt(...), value conversion Mod.Convert(x)) |
The call is in the mapping's source text; there is no IMPORT_MAPPING -> MICROFLOW row. |
Microflow listed as unused. |
| 5 | The error microflow of disallow concurrent execution | DESCRIBE MICROFLOW prints disallow concurrent execution error microflow Mod.X; no refs row. |
Microflow listed as unused. |
| 6 | Constants | refs has no row with TargetType = 'CONSTANT' at all. Uses seen: @Mod.Const in expressions, a form-data part of a REST call, the service URL of a consumed OData service, the thread count of a task queue. A constant used in a form-data part does not appear in DESCRIBE MICROFLOW either. |
"Which constants are unused" and "who reads this constant" cannot be answered. |
| 7 | Import or export mapping used by a published REST operation | No row from the operation to the mapping. | Mapping looks unused. |
A smaller one: an entity named inside a string argument of a Java action call ('Alias=Mod.Entity;...') is listed as unused, not verify. That is a string, not a reference, but the guide says names in text are marked verify.
How to reproduce
For each row, one document is enough:
- A navigation profile with a menu item whose on-click is
call nanoflow. - A menu document with an item that shows a page; no other reference to that page.
- A page with a template grid whose content holds an action button that calls a microflow.
- An import mapping with
find ... by <microflow>. - A microflow with "Disallow concurrent execution" and an error microflow.
- A microflow that reads a constant; a task queue whose threads come from a constant.
- A published REST operation with an import mapping.
Then:
mxcli -p app.mpr -c "REFRESH CATALOG FULL"
mxcli report architecture -p app.mpr --format json -o arch.json # data.unused
select * from refs where TargetName = 'Mod.TheDocument'; -- no rowsSuggestion
Besides adding the rows, a safety net for the unused list would catch the next gap as well: before a document is reported as unused, look for its qualified name in the other units' raw BSON, and mark it verify when it occurs. Cross-document references are stored by qualified name, so this is cheap and complete for references inside the model. On this project the scan of 4,536 units for 320 names took about 6 seconds in Python.
Environment
- mxcli
v0.34.0(2026-11-27) andnightly-20261203-91281266f - Mendix 10.24.13, MPR v2
- Linux amd64
Activity
fix(report architecture): a document another document names is not "u…
fix(catalog): record refs from menu documents, nanoflow menu items an…
fix(catalog): record template grid content, mapping microflows, publi…