Skip to main content
Retina supports multiple output formats to fit different use cases, from human-readable reports to machine-parseable formats for CI/CD integration.

Available formats

Retina provides four main report formats:
Human-readable format with rich formatting, code snippets, and suggestions. Best for manual review and documentation.Extension: .mdUse when:
  • Reviewing issues manually
  • Sharing reports in documentation
  • Creating GitHub issues or pull request comments

Using report formats

Command line

Specify the format using the -f or --format option:
retina run -f md

Configuration file

Set the default format in retina.yml:
reportFormat: md  # Options: md, json, txt, html
Command line options always override the configuration file setting.

Format details

Markdown format

The Markdown format provides a comprehensive, human-readable report:
1

Plugin information

Displays plugin name, version, scan path, date, and duration.
2

Summary statistics

Shows files scanned, files with issues, and total issue count with category breakdown.
3

Detailed issues

Lists all issues grouped by file with:
  • Severity icon and level
  • Category and line number
  • Descriptive message
  • Code snippets (if available)
  • Suggestions for fixes
Example output:
# Retina Scan Report

## Plugin Information

| Property | Value |
|----------|-------|
| **Name** | MyPlugin |
| **Version** | 1.0.0 |
| **Path** | `/path/to/plugin` |

## Summary

- **Files Scanned:** 15
- **Files with Issues:** 3
- **Total Issues:** 7

### Issues by Category

| Category | Count |
|----------|-------|
| undefined_variable | 3 |
| deprecated_api | 2 |
| thread_safety | 2 |

## Issues by File

### `src/Main.php`

- ⚠️ **Deprecated API** (Line 45): Using deprecated method Server::getOnlinePlayers()
  - 💡 *Suggestion:* Use Server::getOnlinePlayersArray() instead
  ```php
  $players = $this->getServer()->getOnlinePlayers();

### JSON format

The JSON format provides structured data ideal for automation:

**Structure:**

```json
{
  "pluginInfo": {
    "name": "MyPlugin",
    "version": "1.0.0",
    "path": "/path/to/plugin"
  },
  "scanInfo": {
    "date": "2026-03-04 10:30:45",
    "duration": 2.34,
    "filesScanned": 15,
    "filesWithIssues": 3
  },
  "summary": {
    "totalIssues": 7,
    "byCategory": {
      "undefined_variable": 3,
      "deprecated_api": 2,
      "thread_safety": 2
    },
    "bySeverity": {
      "error": 3,
      "warning": 4
    }
  },
  "issues": [
    {
      "file": "src/Main.php",
      "line": 45,
      "category": "deprecated_api",
      "severity": "warning",
      "message": "Using deprecated method Server::getOnlinePlayers()",
      "suggestion": "Use Server::getOnlinePlayersArray() instead",
      "snippet": "$players = $this->getServer()->getOnlinePlayers();"
    }
  ]
}
JSON reports use pretty printing by default. The output is formatted with indentation for readability.

Text format

The text format provides plain, console-friendly output: Example output:
======================================================================
                     RETINA SCAN REPORT
======================================================================

PLUGIN INFORMATION
----------------------------------------------------------------------
  Name:          MyPlugin
  Version:       1.0.0
  Path:          /path/to/plugin
  Scan Date:     2026-03-04 10:30:45
  Scan Duration: 2.34 seconds

SUMMARY
----------------------------------------------------------------------
  Files Scanned:     15
  Files with Issues: 3
  Total Issues:      7

ISSUES BY CATEGORY
----------------------------------------------------------------------
  undefined_variable:                 3
  deprecated_api:                     2
  thread_safety:                      2

DETAILED ISSUES
======================================================================

FILE: src/Main.php
----------------------------------------------------------------------
  [1] WARNING - Deprecated API
      Line 45: Using deprecated method Server::getOnlinePlayers()
      Suggestion: Use Server::getOnlinePlayersArray() instead
      Code:
        $players = $this->getServer()->getOnlinePlayers();

HTML format

The HTML format creates an interactive, self-contained web page: Features:
  • Dark theme optimized for readability
  • Statistics cards with visual hierarchy
  • Category badges with issue counts
  • Color-coded severity levels
  • Syntax-highlighted code snippets
  • Collapsible issue groups
  • Responsive design
Visual elements:
  • Error - Red highlighting
  • Warning - Yellow highlighting
  • Info - Blue highlighting
  • Hint - Purple highlighting
HTML reports are completely self-contained with embedded CSS. No external dependencies required.

Simple reports

All formats support a simplified mode that shows only essential information:
1

Enable simple mode

Use the -s or --simple flag:
retina run -f json -s
Or configure in retina.yml:
simpleReport: true
2

What's excluded

Simple reports omit:
  • Code snippets
  • Fix suggestions
  • Detailed formatting
  • Extended metadata
3

What's included

Simple reports show:
  • File path
  • Line number
  • Category
  • Severity
  • Message
Simple Markdown example:
# Retina Scan Report (Simple)

## Summary

- **Files Scanned:** 15
- **Total Issues:** 7

### Issues by Category

- **undefined_variable:** 3
- **deprecated_api:** 2

## Issues

### src/Main.php (2)

- [WARNING] Deprecated API (Line 45): Using deprecated method
- [ERROR] Undefined Variable (Line 67): Variable $data is undefined
Simple reports are ideal for CI/CD environments where performance and file size matter, but they provide less context for debugging issues.

Output options

Custom output path

Specify where to save the report:
retina run -f html -o reports/analysis.html
Default paths:
  • Markdown: retina-report.md
  • JSON: retina-report.json
  • Text: retina-report.txt
  • HTML: retina-report.html

Console-only output

Print results to console without creating a file:
retina run -c
This is useful for quick checks or when you want to pipe output to other tools:
retina run -f txt -c | grep "ERROR"

Format selection guide

Recommended: Markdown or HTMLDuring active development, use formats that provide rich context:
retina run -f md
The code snippets and suggestions help you quickly understand and fix issues.

See also

Build docs developers (and LLMs) love