September 3

ozh wants to merge aurasql into master

Remove ezSQL, use PDO

Current Status:

Analysed View on GitHub
Not so good...

This pull request quality could be better.

  • +1 Issues
  • - Duplication
  • -29 Complexity
  • - Coverage
includes/YOURLS/Database/Options.php
The 'get_all_options()' method which returns a boolean should be named 'is...()' or 'has...()'
public function get_all_options() {

The method get uses an else expression. Else is never necessary and you can simplify the code to work without else.
} else {

Avoid variables with short names like $do. Configured minimum length is 3.
$do = $this->ydb->fetchAffected($sql, $bind);

includes/YOURLS/Database/YDB.php
The class YDB has 14 non-getter- and setter-methods. Consider refactoring YDB to keep number of methods under 10.
class YDB extends ExtendedPdo {

The 'get_emulate_state()' method which returns a boolean should be named 'is...()' or 'has...()'
public function get_emulate_state() {

The method connect_to_DB() contains an exit expression.
die();

includes/functions.php
Avoid excessively long variable names like $new_url_already_there. Keep variable name length under 20.
$new_url_already_there = intval($ydb->fetchValue("SELECT COUNT(keyword) FROM `$table` WHERE `url` = :url;", array('url' => $url)));

More
includes/class-mysql.php
The method yourls_set_DB_driver uses an else expression. Else is never necessary and you can simplify the code to work without else.
} else {

The function yourls_db_dead() contains an exit expression.
die();

includes/functions.php
Avoid excessively long variable names like $new_url_already_there. Keep variable name length under 20.
$new_url_already_there = intval($ydb->get_var("SELECT COUNT(keyword) FROM `$table` WHERE `url` = '$url';"));

Avoid variables with short names like $ua. Configured minimum length is 3.
$ua = yourls_escape( yourls_get_user_agent() );

Avoid variables with short names like $ip. Configured minimum length is 3.
$ip = yourls_escape( yourls_get_IP() );

The method yourls_get_option uses an else expression. Else is never necessary and you can simplify the code to work without else.
} else { // option does not exist, so we must cache its non-existence

More
Status
Author
Commit
Message
Created
Issues

Loading...

Loading...

Loading...

Loading...