hauntd/yii2-vote

View on GitHub

Showing 122 of 122 total issues

Avoid assigning values to variables in if clauses and the like (line '21', column '46').
Open

    public function getModule()
    {
        if (Yii::$app->hasModule('vote') && ($module = Yii::$app->getModule('vote')) instanceof Module) {
            return $module;
        }
Severity: Minor
Found in traits/ModuleTrait.php by phpmd

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'getUserValue'.
Open

            return ArrayHelper::getValue($this->voteAttributes, ["{$name}UserValue"]);
Severity: Minor
Found in behaviors/VoteBehavior.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

Avoid using static access to class '\Yii' in method 'checkModel'.
Open

            $this->addError('entity', Yii::t('vote', 'Guests are not allowed for this voting.'));
Severity: Minor
Found in models/VoteForm.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

Adjoining classes: .vote .vote-btn.vote-active.vote-down
Open

.vote .vote-btn.vote-active.vote-down {
Severity: Minor
Found in assets/static/vote.css by csslint

Adjoining classes: .vote-toggle.vote-toggle-like .vote-btn.vote-active .vote-icon
Open

.vote-toggle.vote-toggle-like .vote-btn.vote-active .vote-icon {
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

  from {
Severity: Minor
Found in assets/static/vote.css by csslint

Expected (<filter-function-list> | none) but found 'alpha(opacity=100)'.</filter-function-list>
Open

    filter: alpha(opacity=100);
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.vote .vote-btn {
Severity: Minor
Found in assets/static/vote.css by csslint

Adjoining classes: .vote .vote-btn.vote-active i.glyphicon
Open

.vote .vote-btn.vote-active i.glyphicon {
Severity: Minor
Found in assets/static/vote.css by csslint

Duplicate property '-o-transition' found.
Open

  -o-transition: opacity 0.15s ease;
Severity: Minor
Found in assets/static/vote.css by csslint

Expected (<filter-function-list> | none) but found 'alpha(opacity=0)'.</filter-function-list>
Open

  filter: alpha(opacity=0);
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.vote .vote-loader span,
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

  to {
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.hide-text {
Severity: Minor
Found in assets/static/vote.css by csslint

Adjoining classes: .vote.vote-visible-buttons .vote-btn
Open

.vote.vote-visible-buttons .vote-btn {
Severity: Minor
Found in assets/static/vote.css by csslint

Duplicate property '-o-transition' found.
Open

  -o-transition: opacity 0.2s ease;
Severity: Minor
Found in assets/static/vote.css by csslint

Adjoining classes: .vote-toggle.vote-toggle-like .vote-btn.vote-active .vote-icon
Open

.vote-toggle.vote-toggle-like .vote-btn.vote-active .vote-icon {
Severity: Minor
Found in assets/static/vote.css by csslint

Expected (<filter-function-list> | none) but found 'alpha(opacity=100)'.</filter-function-list>
Open

    filter: alpha(opacity=100);
Severity: Minor
Found in assets/static/vote.css by csslint

Expected (<filter-function-list> | none) but found 'alpha(opacity=100)'.</filter-function-list>
Open

  filter: alpha(opacity=100);
Severity: Minor
Found in assets/static/vote.css by csslint

Rule doesn't have all its properties in alphabetical order.
Open

.vote .vote-btn i.glyphicon {
Severity: Minor
Found in assets/static/vote.css by csslint
Severity
Category
Status
Source
Language