Installation¶
Requirements¶
- PHP 8.4 or higher
- Composer (any modern version)
Tip
Not sure which PHP version you have? Run php -v in your terminal.
Composer (recommended)¶
Install Qualimetrix as a development dependency in your project:
After installation, the qmx binary is available at:
PHAR¶
A standalone archive that runs without adding Qualimetrix to your project's dependencies. Download
qmx.phar from the latest release,
make it executable, and run it:
Keep the .phar suffix
Parallel analysis copies the whole archive into your temporary directory on every run when the
file it runs from is not named *.phar. Renaming it to qmx costs several megabytes of copying
per run.
Notes for PHAR use:
- HTML reports use the analysed project's
composer.jsonname, falling back to its directory name. Pass--format-opt=project-name=your/projectto override the label. - Releases published before this feature carry no
qmx.pharasset; the first release that does is the one whose changelog entry announces it.
Building it yourself
From a checkout of this repository, composer phar writes build/qmx.phar. It fetches its
build tool from GitHub, so it needs the GitHub CLI on PATH.
Docker¶
Run Qualimetrix in a container without installing PHP locally:
This mounts your current directory into the container and analyzes the src/ folder. The image sets XDG_CACHE_HOME=/cache. Without a /cache volume, AST entries disappear with the container. Mount a persistent volume per uid; a volume owned by another uid disables the implicit cache with a warning. Keep it outside /app. For runs with --user $(id -u), use a separate volume owned by that uid.
You can pass any CLI options after check:
# JSON output
docker run --rm -v $(pwd):/app qmx check src/ --format=json
# With baseline
docker run --rm -v $(pwd):/app qmx check src/ --baseline=baseline.json
Verifying Installation¶
You should see output like:
What's Next?¶
Head to the Quick Start guide to run your first analysis and set up integration with your workflow.