Showing 7,873 of 7,873 total issues
Avoid deeply nested control flow statements. Open
Open
if ($x->ecmaStrictMode)
throw $this->t->newSyntaxError('Illegal trailing ,');
Function _unpack
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function _unpack(& $xpdo, $from, $to) {
$resources = false;
if ($xpdo->getOption(xPDOTransport::ARCHIVE_WITH, null, 0) != xPDOTransport::ARCHIVE_WITH_PCLZIP && class_exists('ZipArchive', true) && $xpdo->loadClass('compression.xPDOZip', XPDO_CORE_PATH, true, true)) {
$archive = new xPDOZip($xpdo, $from);
if ($archive) {
- 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
Avoid deeply nested control flow statements. Open
Open
if (!isset ($relatedObjects[$rAlias]))
$relatedObjects[$rAlias] = array ();
Method log
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function log($level, $msg, $target= '', $def= '', $file= '', $line= '') {
Avoid deeply nested control flow statements. Open
Open
for ($i = $top['where']; $i <= $c; ++$i)
$chrs = substr_replace($chrs, ' ', $i, 1);
Avoid deeply nested control flow statements. Open
Open
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
}
Avoid deeply nested control flow statements. Open
Open
if (!isset ($relatedObjects[$rAlias]))
$relatedObjects[$rAlias] = array ();
Avoid deeply nested control flow statements. Open
Open
if (reset($stk) == SERVICES_JSON_IN_ARR) {
// we are in an array, so just push an element onto the stack
array_push($arr, $this->decode($slice));
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
Method _log
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function _log($level, $msg, $target= '', $def= '', $file= '', $line= '') {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct(xPDO &$xpdo, $dsn, $username= '', $password= '', $options= array(), $driverOptions= array()) {
Avoid deeply nested control flow statements. Open
Open
if (!empty($expression)) {
if (!isset($aggregateNode['criteria'])) $aggregateNode['criteria'] = array();
if (!isset($aggregateNode['criteria'][$criteriaTarget])) $aggregateNode['criteria'][$criteriaTarget] = array();
$aggregateNode['criteria'][$criteriaTarget] = array_merge($aggregateNode['criteria'][$criteriaTarget], (array) $expression);
}
Avoid deeply nested control flow statements. Open
Open
if ($payload !== false) {
$payload = unserialize($payload);
if (is_array($payload) && isset($payload['expires']) && (empty($payload['expires']) || time() < $payload['expires'])) {
if (array_key_exists('content', $payload)) {
$value= $payload['content'];
Avoid deeply nested control flow statements. Open
Open
if ($descendantClass && isset($this->map[$descendantClass]['indexes'])) {
$indices= array_merge($indices, array_diff_key($this->map[$descendantClass]['indexes'], $indices));
}
Avoid deeply nested control flow statements. Open
Open
if (is_dir($path)) {
$suboptions = array_merge($options, array('deleteTop' => !$this->getOption('skipDirs', $options, false)));
if ($subresult= $this->deleteTree($path, $suboptions)) {
$result= array_merge($result, $subresult);
}
Avoid deeply nested control flow statements. Open
Open
while ($key= next($exploded)) {
$sigKey[]= $key;
}
Function delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function delete($key, $options= array()) {
$deleted= false;
if ($this->getOption('multiple_object_delete', $options, true)) {
$cacheKey= $this->getCacheKey($key, array_merge($options, array('cache_ext' => '')));
if (file_exists($cacheKey) && is_dir($cacheKey)) {
- 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
Avoid deeply nested control flow statements. Open
Open
if (empty($sigClass)) $sigClass = $signature->getTableClass();
Avoid deeply nested control flow statements. Open
Open
if (empty($sigKey)) {
while ($key= next($exploded)) {
$sigKey[]= $key;
}
}
Avoid deeply nested control flow statements. Open
Open
if ($signature instanceof xPDOQuery) {
$signature->construct();
if (empty($sigClass)) $sigClass= $signature->getTableClass();
}
Avoid deeply nested control flow statements. Open
Open
if (!empty($expression)) {
if (!isset($compositeNode['criteria'])) $compositeNode['criteria'] = array();
if (!isset($compositeNode['criteria'][$criteriaTarget])) $compositeNode['criteria'][$criteriaTarget] = array();
$compositeNode['criteria'][$criteriaTarget] = array_merge($compositeNode['criteria'][$criteriaTarget], (array) $expression);
}