Your first scan
Let’s scan your first PocketMine-MP plugin with Retina. This guide assumes you’ve already installed Retina.Navigate to your plugin directory
Open a terminal and change to your plugin’s root directory:
Your plugin directory should contain a
plugin.yml file. Retina will exit with an error if it doesn’t find one.Run your first scan
Execute the scan command:Retina will:
- Validate your
plugin.ymlfile - Analyze all PHP files in your plugin
- Check for errors, deprecated API usage, and thread safety issues
- Display a summary in your terminal
- Generate a
retina-report.mdfile
Configure your project
For ongoing use, create a configuration file to customize Retina’s behavior:Initialize configuration
Create a This creates a
retina.yml configuration file:retina.yml file in your plugin directory with default settings.Customize settings
Edit
retina.yml to match your project’s needs:retina.yml
Configuration file settings can be overridden by command-line options. CLI flags take precedence.
Common workflows
Quick console-only scan
For rapid feedback without generating a file:Generate HTML report for sharing
Create an interactive web-based report:Strict analysis for production
Run a rigorous scan before releasing:Focus on critical issues only
Exclude minor issues to focus on errors and warnings:Ignore unused code warnings
Exclude all unused variable/import/parameter warnings:Simple report for CI/CD
Generate a minimal report without code snippets:Understanding command options
Retina’srun command supports numerous options for customization:
Output options
Output format:
md, json, txt, or htmlCustom output file path
Print to console only, don’t create a file
Generate simplified report without code snippets
Analysis options
Analysis strictness level (1-9, higher = stricter)
Disable progress output during scanning
Filtering options
Comma-separated list of issue categories to exclude. Use presets:
unused, undefined, pocketmineComma-separated list of analyzers to disable
Comma-separated list of severity levels to exclude
Report formats explained
Retina supports four report formats, each suited for different use cases:Markdown (default)
Best for: Code review, documentationHuman-readable format with:
- Code snippets with syntax highlighting
- Severity badges
- Actionable suggestions
- Easy to read in GitHub, VS Code, or any Markdown viewer
JSON
Best for: CI/CD integration, automationMachine-readable format with:
- Structured issue data
- Easy parsing in scripts
- Integration with other tools
- Perfect for build pipelines
HTML
Best for: Sharing, presentationsInteractive web-based report with:
- Filtering and search
- Sortable tables
- Click-to-expand details
- Professional appearance
Plain text
Best for: Console output, logsSimple text format with:
- No formatting or colors
- Easy to grep/search
- Compatible with any text viewer
- Lightweight output
Category presets
Retina provides convenient presets to exclude multiple related categories at once:unused preset
unused preset
Excludes all unused code warnings:
unused_variableunused_parameterunused_import
undefined preset
undefined preset
Excludes all undefined reference warnings:
undefined_variableundefined_methodundefined_classundefined_constantundefined_functionundefined_property
pocketmine preset
pocketmine preset
Excludes all PocketMine-MP specific categories:
invalid_event_handlerunregistered_listenerinvalid_plugin_ymldeprecated_apiasync_task_misusethread_safety- And more…
You can combine presets and individual categories:
--exclude-categories unused,deprecated_apiTips and best practices
Start with level 6
Start with level 6
The default strictness level of 6 provides a good balance. Start here and adjust:
- Lower levels (1-5): Faster scans, fewer false positives, misses some issues
- Higher levels (7-9): More thorough, slower, may report minor issues
Use configuration files for teams
Use configuration files for teams
Commit This ensures consistent code quality across your team.
retina.yml to your repository so all team members use the same settings:retina.yml
Integrate with CI/CD
Integrate with CI/CD
Add Retina to your continuous integration pipeline:
.github/workflows/analyze.yml
Focus on errors first
Focus on errors first
When starting with a legacy codebase, focus on critical issues:Fix errors, then warnings, then gradually include info and hints.
Use simple reports for large codebases
Use simple reports for large codebases
For plugins with many files, simple reports are faster and easier to navigate:Simple reports show only:
- File path and line number
- Category and severity
- Error message
Next steps
Command reference
Detailed documentation for all Retina commands
Configuration guide
Learn about all configuration options
Issue categories
Complete list of detectable issue categories
Analyzers
Deep dive into Retina’s 14 analyzers