Showing 45 of 125 total issues
Function update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function update(string $table = null, $keyValue, ...$whereConditions)
{
if (!\is_array($keyValue) || empty($table)) {
return $this->clearPrepare();
}
- 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
Function query_prepared
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function query_prepared(string $query, array $param = null)
{
$stmt = $this->dbh->prepare($query);
if (!$stmt instanceof \SQLite3Stmt) {
if ($this->isTransactional)
- 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
Function query
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function query(string $query, bool $use_prepare = false)
{
$param = [];
if ($use_prepare) {
$param = $this->prepareValues();
- 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 dbSelect
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dbSelect($name = '', $charset = '')
{
$name = empty($name) ? $this->database->getName() : $name;
try {
// Try to connect to the database
Function store_cache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function store_cache(string $query, bool $is_insert = false)
{
// The would be cache file for this query
$cache_file = $this->cacheDir . \_DS . \md5($query);
- 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
Function query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function query(string $query, bool $use_prepare = false)
{
$param = [];
if ($use_prepare)
$param = $this->prepareValues();
- 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
Function initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function initialize(?string $vendor = null, ?array $setting = null, ?string $tag = null): ezQueryInterface
{
if (isset(self::$instances[$vendor]) && empty($setting) && empty($tag))
return self::$instances[$vendor];
- 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
Function alter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function alter(string $table = null, ...$alteringSchema)
{
if (empty($table) || empty($alteringSchema))
return false;
- 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
Function query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function query(string $query, bool $use_prepare = false)
{
$param = [];
if ($use_prepare)
$param = $this->prepareValues();
- 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
Function processQueryResult
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processQueryResult(string $query, $result = null)
{
$this->shortcutUsed = false;
if (!empty($result))
- 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
Function vendor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function vendor(DatabaseInterface $db = null)
{
$type = null;
$instance = empty($db) || !is_object($db) ? getInstance() : $db;
if ($instance instanceof DatabaseInterface) {
- 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
Consider simplifying this complex logical expression. Open
if ($joinSet || $skipWhere || $groupBySet || $havingSet || $orderBySet || $limitSet || $unionSet) {
$where = $args_by;
$skipWhere = true;
}
Function __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $driver = '', array $arguments = null)
{
$sql = \strtolower($driver);
if (!\array_key_exists($sql, \VENDOR) || empty($arguments)) {
throw new Exception(\MISSING_CONFIGURATION);
- 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
Function retrieveConditions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function retrieveConditions($whereConditions)
{
$whereConditions = $this->flattenWhereConditions($whereConditions);
$whereKey = [];
$whereValue = [];
- 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
Function current
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function current($mode = self::RESULT_AS_OBJECT)
{
$return_val = null;
if (!\in_array($mode, $this->_checkTypes)) {
throw new \Exception(\sprintf('$mode is not in %s1 or %s2', self::RESULT_AS_OBJECT, self::RESULT_AS_ARRAY));
- 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
Function processConditions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function processConditions($column, $condition, $value, $valueOrCombine, $extraCombine)
{
if (!\in_array($condition, \_BOOLEAN_OPERATORS))
return $this->clearPrepare();
- 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
Function query_prepared
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function query_prepared(string $query, array $param = null, $isSelect = false)
{
$stmt = $this->dbh->prepare($query);
$result = false;
if ($stmt && $stmt->execute(\array_values($param))) {
- 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 create_certificate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $privatekeyFile = 'certificate.key',
string $certificateFile = 'certificate.crt',
string $signingFile = 'certificate.csr',
// string $caCertificate = null,
string $ssl_path = null,
Function __call
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __call($type, $args)
{
$vendor = self::vendor();
if (empty($vendor))
return false;
- 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
Function joining
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function joining(
String $type = \_INNER,
string $leftTable = null,
string $rightTable = null,
string $leftColumn = null,
- 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"