EclipseGc/PluginsAnnotation

View on GitHub

Showing 13 of 13 total issues

Function findPluginImplementations has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
// Clear the annotation loaders of any previous annotation classes.
AnnotationRegistry::reset();
// Register the namespaces of classes that can be used for annotations.
AnnotationRegistry::registerLoader('class_exists');
Severity: Minor
Found in src/Discovery/AnnotatedPluginDiscovery.php - About 3 hrs to fix

Method findPluginImplementations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
// Clear the annotation loaders of any previous annotation classes.
AnnotationRegistry::reset();
// Register the namespaces of classes that can be used for annotations.
AnnotationRegistry::registerLoader('class_exists');
Severity: Minor
Found in src/Discovery/AnnotatedPluginDiscovery.php - About 1 hr to fix

    Function extractNamespace has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    protected function extractNamespace(array $tokens) : string {
    $namespace = '';
    $found = FALSE;
    foreach ($tokens as $token) {
    if (is_array($token) && $token[0] == T_NAMESPACE) {
    Severity: Minor
    Found in src/Discovery/AnnotatedPluginDiscovery.php - About 55 mins to fix

    Missing class import via use statement (line '93', column '34').
    Open

    $reflector = new \ReflectionClass($definition);

    Avoid using static access to class '\Doctrine\Common\Annotations\AnnotationRegistry' in method 'findPluginImplementations'.
    Open

    AnnotationRegistry::reset();

    Avoid unused parameters such as '$class'.
    Open

    public function findFile($class) {

    Avoid unused local variables such as '$namespace'.
    Open

    foreach ($this->namespaces as $namespace => $directory) {

    Avoid using static access to class '\Doctrine\Common\Annotations\AnnotationRegistry' in method 'findPluginImplementations'.
    Open

    AnnotationRegistry::registerLoader('class_exists');

    The variable $plugin_directory is not named in camelCase.
    Open

    public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
    // Clear the annotation loaders of any previous annotation classes.
    AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.
    AnnotationRegistry::registerLoader('class_exists');

    The variable $plugin_directory is not named in camelCase.
    Open

    public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
    // Clear the annotation loaders of any previous annotation classes.
    AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.
    AnnotationRegistry::registerLoader('class_exists');

    The variable $plugin_directory is not named in camelCase.
    Open

    public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
    // Clear the annotation loaders of any previous annotation classes.
    AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.
    AnnotationRegistry::registerLoader('class_exists');

    The variable $file_contents is not named in camelCase.
    Open

    public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
    // Clear the annotation loaders of any previous annotation classes.
    AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.
    AnnotationRegistry::registerLoader('class_exists');

    The variable $file_contents is not named in camelCase.
    Open

    public function findPluginImplementations(PluginDefinitionInterface ...$definitions) : PluginDefinitionSet {
    // Clear the annotation loaders of any previous annotation classes.
    AnnotationRegistry::reset();
    // Register the namespaces of classes that can be used for annotations.
    AnnotationRegistry::registerLoader('class_exists');
    Severity
    Category
    Status
    Source
    Language