Skip to content
Open source · Apache-2.0

Catch slow Python before it merges.

PLEx finds quadratic loops, N+1 queries, blocking I/O, and risky regexes with AST and IR analysis, flags complexity regressions against your base branch, and rewrites the safe ones for you.

Explore the live report
  • Static by default — never executes your code
  • Baseline-aware PR gating
  • SARIF, check runs, and sticky comments
src/shop/orders.py
Built-in rules
47
Automated fixers
38
Report formats
6
Languages parsed
6
Code executed by default
0 lines
Interactive example

See exactly what PLEx sees.

Every finding below is real engine output from the demo project. Pick a pattern, read the diagnosis, then apply the fixer to see the rewrite it would make.

How it works

From source to verdict in one static pass.

A conservative pipeline built for CI: deterministic, cacheable, and quiet unless something actually changed.

  1. 01

    Discover

    Include/exclude globs, .gitignore, and changed-only mode scope the files that matter.

  2. 02

    Parse to IR

    Python AST plus a language-agnostic IR; optional JS/TS, Java, Kotlin, and Go parsers.

  3. 03

    Signals & rules

    Loop depth, recursion, and sorts feed complexity hints; rules flag I/O, allocation, and regex risks.

  4. 04

    Score

    Each function gets a risk score, confidence, and severity — tunable per path and per rule.

  5. 05

    Compare

    Head is diffed against the base ref or a stored baseline to surface regressions only.

  6. 06

    Report & gate

    JSON, Markdown, SARIF, HTML, and check runs, with a gate policy that sets the exit code.

Built for pull requests

Review complexity like you review tests.

PLEx compares every changed function with its base version. When find_vip_orders gains a nested loop, the PR gets a sticky comment, a check-run annotation, and a failing gate if your policy says so.

  • Changed-only analysisScan just the files and functions a diff touches.
  • Baselines & budgetsRisk-delta budgets, per-path rules, and strict / balanced / relaxed presets.
  • Native CI surfacesStep summaries, SARIF code scanning, annotations, Slack and Teams payloads.
Open the pull request view
Rule catalog

47 rules. Conservative by design.

Stable rules are graduated for CI enforcement; experimental heuristics stay opt-in. Filter by what you care about.

Integrations

Runs where your code already goes.

CLI-first, so it fits any CI. First-class wiring for GitHub, pre-commit, and your editor.


          

Open the full report explorer.

Filter findings, step through code with inline diagnostics, tune the CI gate and watch the verdict change, inspect fix diffs, and export JSON or SARIF. You can also drop in your own plex.json; it's parsed in your browser and never uploaded.

Launch the demo