Showing 129 of 720 total issues
Function bindResults
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function bindResults($stmt) {
$resultSet = [];
$metaData = $stmt->result_metadata();
$fieldsCounter = 0;
while ($field = $metaData->fetch_field()) {
- 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 getPrintableSQLValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function getPrintableSQLValue($type, $value) {
if (strpos($type, "varchar") === 0
|| strpos($type, "text") === 0
|| strpos($type, "longtext") === 0
|| strpos($type, "enum") === 0
- 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 curlRequestAsync
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function curlRequestAsync($url, $params, $type = self::POST, $timeout = 30) {
$postParams = [];
foreach ($params as $key => &$val) {
if (is_array($val)) {
$val = implode(',', $val);
- 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 start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function start() {
switch ($this->direction) {
case (self::TO_OUTPUT_STREAM):
OutputStream::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
Function secondsToTime
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function secondsToTime($inputSeconds, $format = self::HUMAN_FORMAT_DEFAULT) {
$secondsInAMinute = 60;
$secondsInAnHour = 60 * $secondsInAMinute;
$secondsInADay = 24 * $secondsInAnHour;
- 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 log
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function log($type, $called, $script, $line, $message) {
if (is_null($called)) {
$called = $_SERVER['SCRIPT_NAME'];
}
- 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 prepare
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function prepare($query, $conditions = null, $order = null, $offset = null, $count = null) {
if (empty($query)) {
throw new DBCoreException("Nothing to run, SQL query is not initialized");
}
$this->query = $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
Method sendNotification
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$email, $subject, $languageCode, $template,
array $params = null, $format = self::FORMAT_TEXT,
$replyTo = ""
Avoid deeply nested control flow statements. Open
if (!isset($array[$key]) || !is_array($array[$key])) {
break;
}
Function validateNotEmpty
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function validateNotEmpty($fieldName) {
$fieldValue = Request::getFieldValue($fieldName);
if (is_array($fieldValue)) {
foreach ($fieldValue as $value) {
$value = trim($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 selectDBObjectsFromStatement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function selectDBObjectsFromStatement($stmt, $className) {
if (is_object($className)) {
$className = get_class($className);
}
- 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 getEmails
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getEmails($delete = true, $number = null) {
$emails = [];
for ($i = 1; (is_null($number) ? true : $i <= $number); $i++) {
$message = $this->getMessage($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 getRedirectUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getRedirectUrl($url) {
$urlParts = @parse_url($url);
if (!$urlParts) {
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 sqlTypesString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function sqlTypesString($fieldsList, $idFieldName = "") {
$typesString = "";
foreach ($fieldsList as $fieldName => $fieldValue) {
if ($fieldName != $idFieldName) {
if (Tools::isDouble($fieldValue)) {
- 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 open
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function open($host = "localhost", $port = 110, $username = "", $password = "") {
$sock = fsockopen($host, $port);
if ($sock) {
fgets($sock, 1024);
- 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 send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function send($to, $subject, $message, $headers = [], $parameters = "") {
Method sendMail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function sendMail($email, $subject, $message, $format = self::FORMAT_TEXT, $replyTo = "") {
Method log
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function log($type, $called, $script, $line, $message) {
Method prepare
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function prepare($query, $conditions = null, $order = null, $offset = null, $count = null) {
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($url = "", $pagesNumber = 1, $currentPage = 1, $pagesOffset = 3, $template = "") {