Skip to main content

What is Retina?

Retina is an open-source CLI-based static analyzer designed specifically for PocketMine-MP plugins. It scans your plugin code and identifies errors, deprecated API usage, thread safety issues, and other problems before you run it—helping you catch bugs early in development.

Key features

Comprehensive analysis

Detects PHP standard issues, PocketMine-MP specific problems, and thread safety violations across your entire codebase.

Multiple report formats

Generate reports in Markdown, JSON, HTML, or plain text—perfect for both human review and CI/CD integration.

Configurable strictness

Adjust analysis levels from 1-9 to match your project’s needs, from quick checks to rigorous validation.

Flexible filtering

Exclude specific categories, analyzers, or severity levels to focus on what matters most to your project.

What Retina detects

PHP standard issues

  • Type safety: Undefined variables, methods, classes, constants, functions, and properties
  • Type mismatches: Parameter types, return types, and type compatibility errors
  • Code quality: Unused variables, parameters, imports, dead code, and syntax errors
  • Inheritance problems: Invalid inheritance, interface violations, abstract class issues
  • Safety: Null pointer issues, array access errors, static call problems

PocketMine-MP specific issues

  • Plugin structure: Invalid plugin.yml, main class mismatches, API version format errors
  • Event handling: Invalid event handler signatures, unregistered listeners, priority errors
  • API usage: Deprecated PocketMine-MP API detection, thread safety violations
  • Resources: AsyncTask misuse, scheduler problems, config handling errors
  • Definitions: Permission mismatches, command definition issues, missing resource files

Available analyzers

Retina includes 14 specialized analyzers:
  • PluginYml: Validates plugin.yml structure and required fields
  • MainClass: Checks main class exists and extends PluginBase
  • PhpFile: General PHP syntax and structure validation
  • EventHandler: Validates event handler methods
  • Listener: Checks listener registration
  • Command: Validates command implementations
  • Permission: Checks permission definitions
  • AsyncTask: Detects AsyncTask misuse
  • Scheduler: Validates scheduler usage
  • ThreadSafety: Detects thread safety violations
  • Config: Checks config file handling
  • Resource: Validates resource file access
  • DeprecatedApi: Finds deprecated PocketMine-MP API usage
  • PHPStan: Runs PHPStan analysis

Who should use Retina?

Plugin developers

Catch bugs before testing and ensure your code follows PocketMine-MP best practices.

Team leads

Maintain code quality across your team with automated checks and configurable standards.

CI/CD pipelines

Integrate Retina into your build process with JSON output and machine-readable reports.

Severity levels

Retina categorizes issues by severity to help you prioritize fixes:
  • error: Critical issues that will cause crashes or runtime failures
  • warning: Problems that should be fixed to prevent unexpected behavior
  • info: Suggestions for improvement and best practices
  • hint: Minor style or optimization suggestions
You can filter reports by severity level using --exclude-severities to focus on critical issues first.

Next steps

Installation

Install Retina on macOS, Linux, or Windows

Quick start

Run your first scan in minutes

Build docs developers (and LLMs) love