Skip to content

Performance & complexity anti-pattern lint rules (PERF series) #671

Description

@ako

Summary

Add a PERF lint-rule series detecting performance/complexity anti-patterns on top of the catalog + graph data. Proposal: docs/11-proposals/PROPOSAL_performance_complexity_lint.md.

Use cases:

  1. Retrieve without an index — XPath/database retrieve filtering on an unindexed attribute.
  2. Too much data in memory / NPE overuse — unbounded retrieves into loops; non-persistable-entity overuse.
  3. Runtime processing that belongs in the DB — looping/aggregating in a microflow what OQL or bulk DML / EXECUTE DATABASE QUERY could do set-based.
  4. Overly complex documents — high cyclomatic complexity, oversized microflows, complexity hotspots.

Feasibility (assessed against current catalog)

  • Ready now: complexity (microflows.Complexity/ActivityCount), NPE counts (entities.EntityType).
  • Mostly ready: activity-pattern rules (loop+retrieve, aggregate-in-loop, change-in-loop, nested-loop join) via the activities table — some already documented prose-only in the patterns-data-processing skill.
  • Needs new data: retrieve-without-index needs an entity_indexes catalog table (SDK parses indexes; not cataloged) and, for exact constraint→attribute resolution, the expression type checker (Expression type checking for mxcli check (microflows + nanoflows) #580). Best-effort interim via string-matching xpath_expressions.

Delivery

mxcli lint rules + a "Performance & complexity" category in mxcli report + Starlark builtins (teams tune thresholds). Phased: ship-now (complexity/NPE/activity-pattern) → index tier (entity_indexes + best-effort PERF001) → precise tier (after #580).

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions