src/Proxy/WordpressDatabase.php
Function query
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
public function query($query)
{
if (!$this->ready) {
$this->check_current_query = true;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method query
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function query($query)
{
if (!$this->ready) {
$this->check_current_query = true;
Function _do_query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function _do_query($query)
{
if (defined('SAVEQUERIES') && SAVEQUERIES) {
$this->timer_start();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method name "WordpressDatabase::_do_query" is not in camel caps format Open
Open
private function _do_query($query)
- Exclude checks
Method name "WordpressDatabase::db_connect" is not in camel caps format Open
Open
public function db_connect($allowBail = true)
- Exclude checks
Method name "WordpressDatabase::has_cap" is not in camel caps format Open
Open
public function has_cap($capability)
- Exclude checks
Method name "WordpressDatabase::check_connection" is not in camel caps format Open
Open
public function check_connection($allowBail = true)
- Exclude checks
Method name "WordpressDatabase::_real_escape" is not in camel caps format Open
Open
public function _real_escape($string)
- Exclude checks
Method name "WordpressDatabase::set_sql_mode" is not in camel caps format Open
Open
public function set_sql_mode($modes = [])
- Exclude checks
Method name "WordpressDatabase::db_version" is not in camel caps format Open
Open
public function db_version()
- Exclude checks