Firesphere/silverstripe-solr-search

View on GitHub
src/Admins/SearchAdmin.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid unused private fields such as '$menu_icon_class'.
Invalid

    private static $menu_icon_class = 'font-icon-search';
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$menu_title'.
Wontfix

    private static $menu_title = 'Search';
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$managed_models'.
Open

    private static $managed_models = [
        SearchSynonym::class,
        SolrLog::class,
        DirtyClass::class,
    ];
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid unused private fields such as '$url_segment'.
Invalid

    private static $url_segment = 'searchadmin';
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

UnusedPrivateField

Since: 0.2

Detects when a private field is declared and/or assigned a value, but not used.

Example

class Something
{
    private static $FOO = 2; // Unused
    private $i = 5; // Unused
    private $j = 6;
    public function addOne()
    {
        return $this->j++;
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatefield

Avoid using static access to class '\SilverStripe\View\Requirements' in method 'init'.
Invalid

        Requirements::css('firesphere/solr-search:client/dist/main.css');
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The property $menu_icon_class is not named in camelCase.
Invalid

class SearchAdmin extends ModelAdmin
{
    /**
     * @var array Models managed by this admin
     */
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $managed_models is not named in camelCase.
Invalid

class SearchAdmin extends ModelAdmin
{
    /**
     * @var array Models managed by this admin
     */
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $menu_title is not named in camelCase.
Invalid

class SearchAdmin extends ModelAdmin
{
    /**
     * @var array Models managed by this admin
     */
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $url_segment is not named in camelCase.
Invalid

class SearchAdmin extends ModelAdmin
{
    /**
     * @var array Models managed by this admin
     */
Severity: Minor
Found in src/Admins/SearchAdmin.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

There are no issues that match your filters.

Category
Status