Showing 129 of 720 total issues
Function __construct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($tpl) {
if (!empty($tpl)) {
if (is_string($tpl)) {
$this->_tpl = $tpl;
} elseif (Tools::isInstanceOf($tpl, new Route)) {
- 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 http_redirect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function http_redirect($url, $params = array(), $session = false) {
$paramsString = "";
foreach ($params as $key => $value) {
$paramsString .= "&" . $key . "=" . $value;
}
- 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 login
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function login($login, $password) {
$user = self::_select(['email' => $login])->limit(1)->go();
if ($user) {
if ($user->isActivated()) {
if ($user->password == self::passwordEncode($password)) {
- 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 displayTableFieldsList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function displayTableFieldsList($tableName) {
print("<pre>");
if (!empty($tableName)) {
$fieldsList = self::getTableFieldsList($tableName);
if (!empty($fieldsList)) {
- 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 getType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getType($fieldValue) {
if (is_null($fieldValue)) { // Type is not principled for NULL
return "i";
} elseif (Tools::isInteger($fieldValue)) {
return "i";
- 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 http_chunked_decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function http_chunked_decode($chunk) {
$pos = 0;
$len = strlen($chunk);
$dechunk = 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"
Further reading
Function getTableFieldsList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getTableFieldsList($tableName) {
if (!empty($tableName)) {
$query = "SHOW FULL COLUMNS FROM " . $tableName;
$stmt = self::doSelectQuery($query);
if ($stmt !== 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 castFieldValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function castFieldValue($fieldName, $type) {
global $_FIELDS;
if (isset($_FIELDS[$fieldName])) {
switch ($type) {
- 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 doQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function doQuery($query, $types = "", $params = []) {
if (!Tools::isInstanceOf($query, new DBPreparedQuery())) {
$dbQuery = new DBPreparedQuery($query, $types, $params);
} else {
$dbQuery = $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"