Core 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
PluginYml analyzer
Validates yourplugin.yml configuration file for common errors and misconfigurations.
What it checks:
- Required fields:
name,version,main,api - Plugin name format (alphanumeric, hyphens, periods, underscores, spaces)
- Semantic versioning format
- Valid fully-qualified class name for main class
- API version format (X.Y.Z)
- Command definitions structure
- Permission definitions and default values
- Dependency declarations (depend, softdepend, loadbefore)
- Load timing values (STARTUP, POSTWORLD)
MainClass analyzer
Verifies that your main class exists, is properly structured, and extends the required PocketMine-MP base class. What it checks:- Main class file exists at expected path (src/namespace/path)
- Class FQCN matches plugin.yml declaration
- Class is not abstract
- Class extends
PluginBaseor implementsPlugininterface - Lifecycle methods (onLoad, onEnable, onDisable) have correct visibility
PhpFile analyzer
Performs general PHP syntax and structure validation across all your plugin files. What it checks:- PHP syntax errors
- File structure and organization
- Basic code quality issues
This analyzer works in conjunction with the PHPStan analyzer for comprehensive static analysis.
EventHandler analyzer
Validates event handler methods to ensure they follow PocketMine-MP event handling conventions. What it checks:- Event handlers are public (not private or protected)
- Event handlers are not static
- Event handlers accept exactly one parameter (the event object)
- Event priority annotations are valid (LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR)
- MONITOR priority handlers have warnings about state modification
- Proper use of
@handleCancelledannotation
PocketMine-MP specific analyzers
Listener
Checks listener registration
Command
Validates command implementations
Permission
Checks permission definitions
AsyncTask
Detects AsyncTask misuse
Listener analyzer
Checks that event listeners are properly registered with the server. What it checks:- Listener classes implement the
Listenerinterface - Listeners are registered via
PluginManager->registerEvents() - Event handler methods exist for registered listeners
Command analyzer
Validates command implementations and their configuration. What it checks:- Commands declared in plugin.yml have corresponding implementations
- Command classes extend
CommandorPluginCommand - Command execute methods have correct signatures
Permission analyzer
Checks permission definitions and usage throughout your plugin. What it checks:- Permissions defined in plugin.yml have valid structure
- Permission default values are valid (op, notop, true, false)
- Permission checks in code reference defined permissions
AsyncTask analyzer
Detects common mistakes when using AsyncTasks that can lead to crashes or thread safety issues. What it checks:- AsyncTask classes implement required
onRun()method onRun()method is public- Thread-unsafe method calls in
onRun()(getServer, getPlugin, getPlayer, getWorld, getLevel) - Proper visibility of
onCompletion()method - Correct usage of
storeLocal()andfetchLocal()for data passing
Resource and configuration analyzers
Scheduler
Validates scheduler usage
Config
Checks config file handling
Resource
Validates resource file access
DeprecatedApi
Finds deprecated PocketMine-MP API usage
Scheduler analyzer
Validates proper use of the PocketMine-MP task scheduler. What it checks:- Tasks are scheduled correctly using scheduler methods
- Task timing values are valid
- Proper use of delayed, repeating, and delayed-repeating tasks
Config analyzer
Checks configuration file handling for common errors. What it checks:- Config files are loaded correctly
- Config keys are accessed safely
- Default values are provided for missing keys
Resource analyzer
Validates access to plugin resource files. What it checks:- Resource files referenced in code actually exist
- Resources are accessed using correct methods
- Resource paths are valid
DeprecatedApi analyzer
Finds usage of deprecated PocketMine-MP APIs and suggests modern alternatives. What it checks:- Deprecated method calls (74+ deprecated methods tracked)
- Deprecated class usage (8+ deprecated classes)
- Deprecated constants
- API version compatibility
Level → World migration (API 4.0.0)
Level → World migration (API 4.0.0)
Player methods (API 4.0.0+)
Player methods (API 4.0.0+)
AsyncTask data storage (API 5.0.0)
AsyncTask data storage (API 5.0.0)
The analyzer tracks deprecated APIs from PocketMine-MP API 3.x, 4.x, and 5.x to help you maintain compatibility.
Advanced analyzers
ThreadSafety
Detects thread safety violations
PHPStan
Runs PHPStan analysis
ThreadSafety analyzer
Detects code patterns that violate thread safety in PocketMine-MP’s multi-threaded environment. What it checks:- Access to superglobals (_GET, $_POST, etc.) in async context
- Static variable declarations in async methods
- Static property access in async context
- Use of
globalkeyword (impacts testability and thread safety)
PHPStan analyzer
Integrates with PHPStan for comprehensive static analysis of your PHP code. What it checks:- Type errors and mismatches
- Undefined variables, methods, and properties
- Return type violations
- Parameter type errors
- Dead code detection
- And many more PHPStan checks
This analyzer requires PHPStan to be installed. It provides the most comprehensive code analysis beyond PocketMine-MP specific checks.
Disabling analyzers
You can disable specific analyzers using command-line options or configuration:retina.yml