chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/database.lib.php

Summary

Maintainability
A
0 mins
Test Coverage

The method Database::update() calls the typical debug function var_dump() which is mostly only used during development.
Open

                    var_dump($attributes);
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method Database::select() calls the typical debug function var_dump() which is mostly only used during development.
Open

            var_dump($sql);
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method Database::insert() calls the typical debug function var_dump() which is mostly only used during development.
Open

                var_dump($sql);
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method Database::update() calls the typical debug function var_dump() which is mostly only used during development.
Open

                    var_dump($whereConditions);
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method Database::update() calls the typical debug function var_dump() which is mostly only used during development.
Open

                    var_dump($sql);
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

The method select() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The class Database has a coupling between objects value of 19. Consider to reduce the number of dependencies under 13.
Open

class Database
{
    private static EntityManager $em;
    private static Connection $connection;

Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '201', column '23').
Open

        $object = new stdClass();
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '50', column '28').
Open

        $driverChain = new \Doctrine\Persistence\Mapping\Driver\MappingDriverChain();
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '39', column '33').
Open

        $annotationReader = new Doctrine\Common\Annotations\AnnotationReader();
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

Missing class import via use statement (line '46', column '38').
Open

        $timestampableListener = new Gedmo\Timestampable\TimestampableListener();
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

The method handleError uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            error_log($e->getMessage());
            api_not_allowed(false, get_lang('An error has occurred. Please contact your system administrator.'));
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method parse_conditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                            } else {
                                //by default DESC
                                $temp_value[] = ' `'.$element[0].'` DESC ';
                            }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method select uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $clean_columns = (string) $columns;
            }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method parse_conditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            $return_value .= ' LIMIT '.intval($limit_array[0]);
                        }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method parse_conditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            $value_array = self::escape_string($value_array);
                            $clean_values = [$value_array];
                        }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method select uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            if ('*' === $columns) {
                $clean_columns = '*';
            } else {
                $clean_columns = (string) $columns;
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method select uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $array = self::fetch_array($result);
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.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

The method select uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $array[] = $row;
                }
Severity: Minor
Found in public/main/inc/lib/database.lib.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 unused parameters such as '$option'.
Open

        string $option = 'ASSOC',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

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

The parameter $show_query is not named in camelCase.
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int
    {
        if (empty($attributes) || empty($table_name)) {
            return false;
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $type_result is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $show_query is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $table_name is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $where_conditions is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $table_name is not named in camelCase.
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int
    {
        if (empty($attributes) || empty($table_name)) {
            return false;
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseParameterName

Since: 0.2

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

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Missing function doc comment
Open

    public static function setManager(EntityManager $em)

Method name "Database::insert_id" is not in camel caps format
Open

    public static function insert_id(): int

Variable "show_query" is not in valid camel caps format
Open

            if ($show_query) {

Variable "type_result" is not in valid camel caps format
Open

        if ('count' === $type_result) {

Variable "condition_data" is not in valid camel caps format
Open

                    $limit_array = explode(',', $condition_data);

Variable "return_value" is not in valid camel caps format
Open

                            $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);

Variable "show_query" is not in valid camel caps format
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int

Missing function doc comment
Open

    public static function setConnection(Connection $connection)

Method name "Database::store_result" is not in camel caps format
Open

    public static function store_result(\Doctrine\DBAL\Result $result, $option = 'BOTH'): array

Variable "where_return" is not in valid camel caps format
Open

                        $return_value = " WHERE $where_return";

Variable "limit_array" is not in valid camel caps format
Open

                            $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);

Variable "return_value" is not in valid camel caps format
Open

                            $return_value .= ' LIMIT '.intval($limit_array[0]);

Method name "Database::fetch_row" is not in camel caps format
Open

    public static function fetch_row(\Doctrine\DBAL\Result $result): array

Method name "Database::num_rows" is not in camel caps format
Open

    public static function num_rows(\Doctrine\DBAL\Result $result): int

Variable "type_result" is not in valid camel caps format
Open

        if ('count' === $type_result) {

Variable "limit_array" is not in valid camel caps format
Open

                            $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]);

Method name "Database::affected_rows" is not in camel caps format
Open

    public static function affected_rows(\Doctrine\DBAL\Result $result): int

Variable "clean_columns" is not in valid camel caps format
Open

        $sql = "SELECT $clean_columns FROM $table_name $conditions";

Variable "temp_value" is not in valid camel caps format
Open

                            $return_value .= ' ORDER BY '.implode(', ', $temp_value);

Method name "Database::escape_string" is not in camel caps format
Open

    public static function escape_string(mixed $string): string

Variable "value_array" is not in valid camel caps format
Open

                    foreach ($condition_data as $condition => $value_array) {

Variable "clean_values" is not in valid camel caps format
Open

                        if (!empty($condition) && '' != $clean_values) {

Variable "where_return" is not in valid camel caps format
Open

                            $where_return .= $condition;

Variable "order_array" is not in valid camel caps format
Open

                        $order_array = self::escape_string($order_array);

Variable "order_array" is not in valid camel caps format
Open

                        $order_array = self::escape_string($order_array);

Variable "value_array" is not in valid camel caps format
Open

                            foreach ($value_array as $item) {

Variable "condition_data" is not in valid camel caps format
Open

                    $order_array = $condition_data;

Missing function doc comment
Open

    public static function getConnection(): Connection

Variable "clean_columns" is not in valid camel caps format
Open

            $clean_columns = implode(',', $columns);

Variable "type_result" is not in valid camel caps format
Open

        if ('count' === $type_result) {

Variable "condition_data" is not in valid camel caps format
Open

        foreach ($conditions as $type_condition => $condition_data) {

Method name "Database::get_course_table" is not in camel caps format
Open

    public static function get_course_table(string $table): string

Variable "table_name" is not in valid camel caps format
Open

        if (empty($attributes) || empty($table_name)) {

Variable "where_return" is not in valid camel caps format
Open

        $return_value = $where_return = '';

Variable "type_condition" is not in valid camel caps format
Open

            switch ($type_condition) {

Variable "value_array" is not in valid camel caps format
Open

                        if (is_array($value_array)) {

Variable "clean_values" is not in valid camel caps format
Open

                            $clean_values = [];

Variable "order_array" is not in valid camel caps format
Open

                    if (!empty($order_array)) {

Variable "condition_data" is not in valid camel caps format
Open

            if (false == $condition_data) {

Variable "return_value" is not in valid camel caps format
Open

                            $return_value .= ' ORDER BY '.implode(', ', $temp_value);

Missing function doc comment
Open

    public static function escapeField($field): string

Variable "clean_values" is not in valid camel caps format
Open

                                $clean_values[] = $item;

Method name "Database::fetch_array" is not in camel caps format
Open

    public static function fetch_array(\Doctrine\DBAL\Result $result): mixed

Variable "value_array" is not in valid camel caps format
Open

                            $value_array = self::escape_string($value_array);

Variable "clean_values" is not in valid camel caps format
Open

                            $clean_values = [$value_array];

Method name "Database::fetch_assoc" is not in camel caps format
Open

    public static function fetch_assoc(\Doctrine\DBAL\Result $result): array|bool

Variable "new_order_array" is not in valid camel caps format
Open

                        foreach ($new_order_array as $element) {

Method name "Database::parse_conditions" is not in camel caps format
Open

    public static function parse_conditions(array $conditions): string

Variable "return_value" is not in valid camel caps format
Open

        return $return_value;

Variable "value_array" is not in valid camel caps format
Open

                            $clean_values = [$value_array];

Missing function doc comment
Open

    public static function getManager(): EntityManager

Variable "type_result" is not in valid camel caps format
Open

        if ('all' === $type_result) {

Variable "condition_data" is not in valid camel caps format
Open

                    foreach ($condition_data as $condition => $value_array) {

Variable "clean_values" is not in valid camel caps format
Open

                            $condition = vsprintf($condition, $clean_values);

Variable "order_array" is not in valid camel caps format
Open

                    $order_array = $condition_data;

Variable "temp_value" is not in valid camel caps format
Open

                        if (!empty($temp_value)) {

Variable "where_conditions" is not in valid camel caps format
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int

Variable "show_query" is not in valid camel caps format
Open

        if ($show_query) {

Method name "Database::get_main_table" is not in camel caps format
Open

    public static function get_main_table(string $table): string

Method name "Database::count_rows" is not in camel caps format
Open

    public static function count_rows(string $table): int

Variable "table_name" is not in valid camel caps format
Open

        string $table_name,

Variable "type_result" is not in valid camel caps format
Open

        string $type_result = 'all',

Variable "clean_columns" is not in valid camel caps format
Open

                $clean_columns = (string) $columns;

Variable "return_value" is not in valid camel caps format
Open

                        $return_value = " WHERE $where_return";

Variable "temp_value" is not in valid camel caps format
Open

                        $temp_value = [];

Variable "temp_value" is not in valid camel caps format
Open

                                $temp_value[] = ' `'.$element[0].'` '.$order.' ';

Variable "where_return" is not in valid camel caps format
Open

        $where_return = self::parse_where_conditions($where_conditions);

Variable "where_conditions" is not in valid camel caps format
Open

        $where_return = self::parse_where_conditions($where_conditions);

Variable "table_name" is not in valid camel caps format
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int

Variable "clean_columns" is not in valid camel caps format
Open

                $clean_columns = '*';

Variable "return_value" is not in valid camel caps format
Open

        $return_value = $where_return = '';

Variable "limit_array" is not in valid camel caps format
Open

                    if (!empty($limit_array)) {

Variable "limit_array" is not in valid camel caps format
Open

                        if (count($limit_array) > 1) {

Method name "Database::parse_where_conditions" is not in camel caps format
Open

    public static function parse_where_conditions(array $conditions): string

Method name "Database::get_main_database" is not in camel caps format
Open

    public static function get_main_database(): bool|string|null

Method name "Database::fetch_object" is not in camel caps format
Open

    public static function fetch_object(\Doctrine\DBAL\Result $result): ?stdClass

Variable "clean_columns" is not in valid camel caps format
Open

            $clean_columns = ' count(*) count ';

Variable "table_name" is not in valid camel caps format
Open

        $sql = "SELECT $clean_columns FROM $table_name $conditions";

Variable "type_condition" is not in valid camel caps format
Open

            $type_condition = strtolower($type_condition);

Variable "temp_value" is not in valid camel caps format
Open

                                $temp_value[] = ' `'.$element[0].'` DESC ';

Variable "where_return" is not in valid camel caps format
Open

        $sql = "DELETE FROM $tableName $where_return ";

Variable "table_name" is not in valid camel caps format
Open

            $sql = 'INSERT INTO '.$table_name.' ('.implode(',', $params).')

Variable "type_condition" is not in valid camel caps format
Open

        foreach ($conditions as $type_condition => $condition_data) {

Variable "type_condition" is not in valid camel caps format
Open

            $type_condition = strtolower($type_condition);

Variable "value_array" is not in valid camel caps format
Open

                            $value_array = self::escape_string($value_array);

Variable "order_array" is not in valid camel caps format
Open

                        $new_order_array = explode(',', $order_array);

Missing class doc comment
Open

class Database

Variable "show_query" is not in valid camel caps format
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int

Variable "where_return" is not in valid camel caps format
Open

                    if (!empty($where_return)) {

Variable "new_order_array" is not in valid camel caps format
Open

                        $new_order_array = explode(',', $order_array);

Variable "limit_array" is not in valid camel caps format
Open

                    $limit_array = explode(',', $condition_data);

Variable "limit_array" is not in valid camel caps format
Open

                            $return_value .= ' LIMIT '.intval($limit_array[0]);

Missing function doc comment
Open

    public static function parse_where_conditions(array $conditions): string

The variable $clean_columns is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $condition_data is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_values is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_values is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $table_name is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $show_query is not named in camelCase.
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int
    {
        if (empty($attributes) || empty($table_name)) {
            return false;
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_columns is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $condition_data is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_condition is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_values is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $new_order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_conditions is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_columns is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_result is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_values is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $temp_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $show_query is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_columns is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_result is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $condition_data is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_condition is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_values is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_result is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $condition_data is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $new_order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $temp_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function delete(string $tableName, array $where_conditions, bool $show_query = false): int
    {
        $where_return = self::parse_where_conditions($where_conditions);
        $sql = "DELETE FROM $tableName $where_return ";
        if ($show_query) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $table_name is not named in camelCase.
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int
    {
        if (empty($attributes) || empty($table_name)) {
            return false;
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_condition is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $where_return is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $condition_data is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_result is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $type_condition is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $order_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $temp_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $return_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $table_name is not named in camelCase.
Open

    public static function insert(string $table_name, array $attributes, bool $show_query = false): bool|int
    {
        if (empty($attributes) || empty($table_name)) {
            return false;
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $clean_columns is not named in camelCase.
Open

    public static function select(
        string|array $columns,
        string $table_name,
        array $conditions = [],
        string $type_result = 'all',
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $value_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $temp_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $temp_value is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $limit_array is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method count_rows is not named in camelCase.
Open

    public static function count_rows(string $table): int
    {
        $result = self::query("SELECT COUNT(*) AS n FROM $table");

        return (int) $result->fetchOne();
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method affected_rows is not named in camelCase.
Open

    public static function affected_rows(\Doctrine\DBAL\Result $result): int
    {
        return $result->rowCount();
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method insert_id is not named in camelCase.
Open

    public static function insert_id(): int
    {
        return (int) self::getManager()->getConnection()->lastInsertId();
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method fetch_array is not named in camelCase.
Open

    public static function fetch_array(\Doctrine\DBAL\Result $result): mixed
    {
        $data = $result->fetchAssociative();

        if (empty($data)) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method fetch_assoc is not named in camelCase.
Open

    public static function fetch_assoc(\Doctrine\DBAL\Result $result): array|bool
    {
        return $result->fetchAssociative();
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method store_result is not named in camelCase.
Open

    public static function store_result(\Doctrine\DBAL\Result $result, $option = 'BOTH'): array
    {
        if ('NUM' === $option) {
            return $result->fetchAllNumeric();
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_main_table is not named in camelCase.
Open

    public static function get_main_table(string $table): string
    {
        return $table;
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method num_rows is not named in camelCase.
Open

    public static function num_rows(\Doctrine\DBAL\Result $result): int
    {
        return $result->rowCount();
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method parse_conditions is not named in camelCase.
Open

    public static function parse_conditions(array $conditions): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method parse_where_conditions is not named in camelCase.
Open

    public static function parse_where_conditions(array $conditions): string
    {
        return self::parse_conditions(['where' => $conditions]);
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method escape_string is not named in camelCase.
Open

    public static function escape_string(mixed $string): string
    {
        $string = self::getManager()->getConnection()->quote($string);
        // The quote method from PDO also adds quotes around the string, which
        // is not how the legacy mysql_real_escape_string() was used in
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method fetch_object is not named in camelCase.
Open

    public static function fetch_object(\Doctrine\DBAL\Result $result): ?stdClass
    {
        $data = $result->fetchAssociative();

        if (empty($data)) {
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method fetch_row is not named in camelCase.
Open

    public static function fetch_row(\Doctrine\DBAL\Result $result): array
    {
        $row = $result->fetchNumeric();

        return empty($row) ? [] : $row;
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_course_table is not named in camelCase.
Open

    public static function get_course_table(string $table): string
    {
        return DB_COURSE_PREFIX.$table;
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_main_database is not named in camelCase.
Open

    public static function get_main_database(): bool|string|null
    {
        return self::getManager()->getConnection()->getDatabase();
    }
Severity: Minor
Found in public/main/inc/lib/database.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status