IssueReporter
Reads the reports of ten static analysis tools into one model, merges them into a single report and renders it as Markdown, HTML, ANSI text, JSON, XML or SARIF.
What it does
IssueReporter is a PHP library, and a command line tool, for static code analysis reports. It reads the files your tools already produce, normalises them into one in-memory model (Report and Issue), optionally transforms the issues, and renders the result in any supported output format.
It is most useful at the end of a pipeline, where several tools have each written their own artifact. It reads PHP_CodeSniffer, Checkstyle, JUnit, GitLab, SonarQube, SARIF, LSP and Emacs reports into a single tree (the run, its parts, the issues), merges reports of different formats into one document, and writes the result as Markdown, HTML, ANSI text, JSON, XML or SARIF.
Install
composer require tuchsoft/issue-reporterPHP 8.0 or newer, with ext-dom, ext-simplexml and ext-libxml.
Usage
# PHP_CodeSniffer JSON in, a readable Markdown report out
bin/console convert phpcs:phpcs.json --to infomd -o report.md
# merge two reports of different formats into one SARIF file
bin/console convert checkstyle:checkstyle.xml raw:junit.json --to sarif --pretty -o merged.sarif
# anything on STDIN, anything on STDOUT, diagnostics on STDERR
cat report.json | bin/console convert - --from raw --to emacs
# describe a whole complex run in a single JSON recipe
bin/console convert --config recipe.jsonEvery format exposes its own options, generically (--pretty) and prefixed with the format name (--phpcs-pretty) when one stage needs a different value. bin/console list-format and list-transformer print the full list.
What it returns
One Report tree: the root is the run, its children are its parts (a plugin, a package, a configuration), the leaves are the issues with their code, severity, message, file, line, column, help and reference. The tree is what makes a merged report readable instead of a flat list of a thousand lines, and it is what the Markdown, HTML and ANSI renderers print as a table per file.
What is in 1.0.1
This is the first public release, on Packagist and on GitHub. It carries ten input formats, thirteen output formats, the merge tree, the transformer pipeline (messagereplacer, for Mustache messages filled from the issue's own extra data), the JSON recipe mode for complex runs, and runtime registration of your own formats and transformers. The library and the CLI are the same code: bin/console is a thin command layer over the model.
The full story, including what the library does not do, is in our release article.
What it does not do
It is not a linter. It never looks at your code and it does not fix anything: it reads what your tools found and reshapes it. Options are global to a run, per-stage overrides are on the roadmap, and the codeclimate format is not supported yet.
Built for AI assistants too
This site works with AI assistants as well as with people. Every article, plugin and page of documentation is published in a machine-readable form, and an assistant can search our content, check which Moodle version a site is running, contact our team, or request a free temporary Moodle 5.3 platform. The full list is at llms.txt, and the same index as a page at llms.html.