Skip to main content
Retina categorizes all detected issues into specific categories to help you understand the nature and impact of each problem. Issues fall into two main groups: PHP standard issues and PocketMine-MP specific issues.

PHP standard issues

These categories cover general PHP programming errors and code quality issues that apply to any PHP project.

Undefined issues

Issues related to using code elements before they are defined.

undefined_variable

Variable used before definition

undefined_method

Method doesn’t exist

undefined_class

Class not found

undefined_constant

Constant not defined

undefined_function

Function doesn’t exist

undefined_property

Property doesn’t exist
Example:
echo $username; // undefined_variable: $username used before definition

$result = $object->nonexistentMethod(); // undefined_method

new \App\Models\MissingClass(); // undefined_class
You can exclude all undefined issues at once using the undefined preset. See Filtering for details.

Type issues

Issues related to type mismatches and type safety violations.

type_mismatch

Type doesn’t match expected type

return_type

Return type error

parameter_type

Parameter type error

null_safety

Potential null pointer issue
Example:
function getCount(): int {
    return "five"; // return_type: Expected int, got string
}

function processPlayer(Player $player): void {
    processPlayer("username"); // parameter_type: Expected Player, got string
}

$player = $server->getPlayerExact("notfound");
$player->sendMessage("hi"); // null_safety: $player might be null

Unused code

Code elements that are declared but never used.

unused_variable

Variable declared but never used

unused_parameter

Parameter never used

unused_import

Import statement not needed

dead_code

Unreachable code
Example:
use App\Models\UnusedClass; // unused_import

function calculate(int $x, int $y): int {
    $temp = $x * 2; // unused_variable: $temp is never used
    return $x + $y;
}

function process(string $name, bool $debug): void {
    // unused_parameter: $debug is never referenced
    echo $name;
}

return true;
echo "This will never run"; // dead_code: unreachable
You can exclude all unused code issues using the unused preset. See Filtering for details.

Syntax and structure

Issues related to PHP syntax errors and structural problems.

syntax_error

PHP syntax error

missing_return

Missing return statement

invalid_inheritance

Invalid class inheritance

interface_violation

Interface not properly implemented

abstract_violation

Abstract class violation

visibility_violation

Visibility modifier error
Example:
function getName(): string {
    // missing_return: No return statement
}

class MyClass extends FinalClass { // invalid_inheritance: Cannot extend final class
}

class Handler implements Listener {
    // interface_violation: Missing required method handleEvent()
}

Method and property access

Issues related to accessing methods and properties incorrectly.

static_call_error

Static method call error

instantiation_error

Cannot instantiate class

array_access_error

Invalid array access
Example:
MyClass::nonStaticMethod(); // static_call_error: Method is not static

$obj = new AbstractClass(); // instantiation_error: Cannot instantiate abstract class

$value = "string"[100]; // array_access_error: Invalid offset

PocketMine-MP specific issues

These categories are specific to PocketMine-MP plugin development and cover API usage, threading, and plugin structure.

Plugin structure

Issues related to plugin configuration and main class setup.

invalid_plugin_yml

plugin.yml has errors

main_class_mismatch

Main class doesn’t match plugin.yml

invalid_api_version

API version format invalid
Example:
# invalid_plugin_yml: Missing required field
name: MyPlugin
version: 1.0.0
# ERROR: 'main' field is required

# invalid_api_version: Wrong format
api: 5.0  # Should be 5.0.0
Source reference:
  • Detected by: PluginYmlAnalyzer (src/Analyzer/PluginYmlAnalyzer.php:14)
  • Main class validation: MainClassAnalyzer (src/Analyzer/MainClassAnalyzer.php:26)

Event handling

Issues related to event listeners and handlers.

invalid_event_handler

Event handler signature wrong

unregistered_listener

Listener not registered

invalid_event_priority

Event priority invalid

cancelled_event_access

Accessing cancelled event incorrectly
Example:
class MyListener implements Listener {
    private function onJoin(PlayerJoinEvent $event) {
        // invalid_event_handler: Must be public
    }
    
    /**
     * @priority INVALID
     */
    public function onQuit(PlayerQuitEvent $event) {
        // invalid_event_priority: Valid priorities are LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR
    }
}
Valid event priorities:
  • LOWEST
  • LOW
  • NORMAL
  • HIGH
  • HIGHEST
  • MONITOR
Source reference:
  • Detected by: EventHandlerAnalyzer (src/Analyzer/EventHandlerAnalyzer.php:13)

API deprecation

Issues related to using deprecated PocketMine-MP APIs.

deprecated_api

Using deprecated PocketMine-MP API
Example:
// deprecated_api: getLevel() deprecated since API 4.0.0
$level = $server->getLevel($name);
// Use: $world = $server->getWorldManager()->getWorldByName($name);

// deprecated_api: addTitle() deprecated since API 4.0.0
$player->addTitle("Title");
// Use: $player->sendTitle("Title");

// deprecated_api: sendPopup() deprecated since API 5.0.0
$player->sendPopup("Message");
// Use: $player->sendToastNotification("Message");
Source reference:
  • Detected by: DeprecatedApiAnalyzer
  • Tracks 74+ deprecated methods, 8+ deprecated classes
  • Covers API versions 3.x, 4.x, and 5.x

Threading and async

Issues related to AsyncTasks and thread safety.

async_task_misuse

AsyncTask used incorrectly

thread_safety

Thread safety violation
Example:
class MyTask extends AsyncTask {
    public function onRun(): void {
        $server = $this->getServer();
        // async_task_misuse & thread_safety: Thread-unsafe call to getServer()
        
        static $counter = 0;
        // thread_safety: Static variable in async context is thread-unsafe
        
        $data = $_SERVER['HTTP_HOST'];
        // thread_safety: Superglobal access in async context
    }
}
Thread safety violations can cause random crashes and data corruption. Always fix these issues before deploying your plugin.
Source reference:
  • Detected by: AsyncTaskAnalyzer (src/Analyzer/AsyncTaskAnalyzer.php:15)
  • Detected by: ThreadSafetyAnalyzer (src/Analyzer/ThreadSafetyAnalyzer.php:15)

Scheduler and tasks

Issues related to task scheduling.

scheduler_misuse

Scheduler used incorrectly
Example:
// scheduler_misuse: Invalid delay value
$scheduler->scheduleDelayedTask($task, -1);

// scheduler_misuse: Task scheduled after plugin disable

Configuration and resources

Issues related to config files and plugin resources.

config_misuse

Config handling error

resource_missing

Resource file not found
Example:
// config_misuse: No default value for missing key
$value = $config->get("missing_key"); // May return null

// resource_missing: Resource file doesn't exist
$this->saveResource("nonexistent.yml");

Commands and permissions

Issues related to command and permission definitions.

command_mismatch

Command definition mismatch

permission_mismatch

Permission definition mismatch
Example:
# command_mismatch: Command configuration must be a mapping
commands:
  mycommand: "invalid string value"

# permission_mismatch: Invalid default value
permissions:
  myplugin.admin:
    default: invalid  # Must be: op, notop, true, or false
Valid permission defaults:
  • op - Only operators
  • notop - Everyone except operators
  • true - Everyone
  • false - No one (must be granted explicitly)

Filtering by category

You can exclude specific categories from your analysis:
retina run --exclude-categories=unused_variable,unused_import
Or use category presets:
retina run --exclude-categories=unused,undefined
Available presets:
  • unused - All unused code issues
  • undefined - All undefined reference issues
  • pocketmine - All PocketMine-MP specific issues
See Filtering for complete details on filtering options.

Build docs developers (and LLMs) love