Asymptix/Framework

View on GitHub

Showing 720 of 720 total issues

Avoid using static access to class '\Asymptix\core\Tools' in method 'checkParameterTypes'.
Open

                        if (!Tools::isDoubleString($value)) {
Severity: Minor
Found in framework/db/DBPreparedQuery.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 method sqlTypesString uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $typesString.= "s";
                }
Severity: Minor
Found in framework/db/DBPreparedQuery.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class 'Asymptix\db\DBField' in method 'sqlSingleTypeString'.
Open

        $type = DBField::castType($type);
Severity: Minor
Found in framework/db/DBPreparedQuery.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 method sqlPushValues uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $condition = $fieldName;
                $localParams = $fieldValue;

                $chunks[] = $condition;
Severity: Minor
Found in framework/db/DBPreparedQuery.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class '\Asymptix\core\OutputStream' in method 'showQueryDebugInfo'.
Open

                    OutputStream::message(OutputStream::MSG_ERROR, "Number of types is not equal parameters number.");
Severity: Minor
Found in framework/db/DBQuery.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 'Asymptix\db\DBField' in method '__construct'.
Open

                                        . DBField::sqlValue($this->field->type, $value);
Severity: Minor
Found in framework/db/DBQueryCondition.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 'Asymptix\db\DBCore' in method 'selectDBObjectsByField'.
Open

                $dbObjects = DBCore::selectDBObjectsFromStatement($stmt, get_class($this->dbObject));
Severity: Minor
Found in framework/db/DBSelector.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 'Asymptix\db\DBCore' in method 'count'.
Open

        return DBCore::selectSingleValue($query);
Severity: Minor
Found in framework/db/DBSelector.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 '\Asymptix\core\Validator' in method '__construct'.
Open

        if (!Validator::isEmail($fromEmail)) {
Severity: Minor
Found in framework/mail/Email.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 method removeClass uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $key = array_search($className, $this->class);
            if ($key !== false) {
                unset($this->class[$key]);
            }
Severity: Minor
Found in framework/ui/UIComponent.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class 'Asymptix\db\DBCore' in method 'saveRemovementFlag'.
Open

        return DBCore::doUpdateQuery(
            "UPDATE " . static::TABLE_NAME . "
                SET removed = ?
             WHERE " . static::ID_FIELD_NAME . " = ?
             LIMIT 1",
Severity: Minor
Found in framework/db/DBObject.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 'Asymptix\db\DBField' in method '__construct'.
Open

                    $this->preparedData = [DBField::sqlValue($this->field->type, $value)];
Severity: Minor
Found in framework/db/DBQueryCondition.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 method upperCaseWords uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return mb_convert_case($str, MB_CASE_TITLE);
        }
Severity: Minor
Found in framework/helpers/StringHelper.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class '\Asymptix\core\Content' in method 'send'.
Open

            $message = Content::render($tplPath, $tplVars);
Severity: Minor
Found in framework/mail/Email.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 unused local variables such as '$_EMAIL'.
Open

        $_EMAIL = $params;
Severity: Minor
Found in framework/mail/Email.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid using static access to class '\Asymptix\core\Tools' in method 'updateDBObject'.
Open

        if (Tools::isInteger($fieldsList[$idFieldName])) {
Severity: Minor
Found in framework/db/DBCore.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 '\Asymptix\core\Tools' in method 'selectSingleRecord'.
Open

        if (!Tools::isInstanceOf($query, new DBPreparedQuery())) {
Severity: Minor
Found in framework/db/DBCore.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 'Asymptix\db\DBCore' in method 'save'.
Open

            $insertionId = DBCore::insertDBObject($this, false, $debug);
Severity: Minor
Found in framework/db/DBObject.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 '\Asymptix\core\OutputStream' in method 'showQueryDebugInfo'.
Open

                    OutputStream::message(OutputStream::MSG_INFO, "A: [" . implode(", ", $params) . "]");
Severity: Minor
Found in framework/db/DBQuery.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 'Asymptix\db\DBField' in method '__construct'.
Open

                    $this->preparedData = [DBField::sqlValue($this->field->type, $value)];
Severity: Minor
Found in framework/db/DBQueryCondition.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

Severity
Category
Status
Source
Language