Showing 129 of 720 total issues
Function getValueByComplexName
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function getValueByComplexName($array, $complexName) {
if (!is_array($complexName)) {
$complexName = self::parseComplexName($complexName);
}
- 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 getBrowserInfo
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getBrowserInfo() {
$browserFullName = $browserShortName = $browserVersion = null;
$userAgent = self::getUserAgent();
if (empty($userAgent)) {
Method checkParameterTypes
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function checkParameterTypes($params, $types) {
if (count($params) != strlen($types)) {
throw new DBCoreException(
"Number of types is not equal parameters number"
);
Method go
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function go($debug = false) {
switch ($this->dbQuery->getType()) {
case (DBQueryType::SELECT):
$this->dbQuery->query = "SELECT * FROM " . static::TABLE_NAME;
break;
Function __construct
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($type = "", $name = "", $value = null) {
if (!(bool)preg_match("#^[a-zA-Z][a-zA-Z0-9_]*$#", $name)) {
throw new DBFieldException("Can't create DBField object: invalid field name '" . $name . "'");
}
$this->name = $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
Method curlRequestAsync
has 47 lines of code (exceeds 25 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);
Function filterBouncedEmails
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function filterBouncedEmails($emailData) {
$emails = [];
if (isset($emailData[0])) {
if (is_array($emailData[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 showQueryDebugInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function showQueryDebugInfo($query = "", $types = "", array $params = []) {
OutputStream::start();
if (!empty($query)) {
if (empty($types) && empty($params)) {
OutputStream::message(OutputStream::MSG_INFO, "Q: " . $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 start
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function start($name = "", array $iniSettings = [], $useCookie = false,
$lifetime = null, $path = null, $domain = null, $secure = null, $httponly = null)
{
if (!empty($iniSettings)) {
foreach ($iniSettings as $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
Method getBouncedEmails
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBouncedEmails($delete = true, $number = null) {
$emails = [];
for ($i = 1; (is_null($number) ? true : $i <= $number); $i++) {
$message = $this->getMessage($i);
Method __call
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call($methodName, $methodParams) {
/*
* Selects DBObject record by some field value.
*
* @param <mixed> Value of the field
Method log
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function log($type, $message, $format = "\[Y-m-d H:i:s\]", $time = null) {
$msgType = null;
switch ($type) {
case (self::LOG_INFO):
$msgType = OutputStream::MSG_INFO;
Function _get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function _get($ip, $type, $provider) {
if (!filter_var($ip, FILTER_VALIDATE_IP)) {
throw new LocationDetectorException("Invalid IP address.");
}
- 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 initQuery
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function initQuery($queryType, $conditions = [], $fields = []) {
$this->dbQuery = new DBPreparedQuery();
$this->dbQuery->setType($queryType);
- 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 getFieldValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getFieldValue($fieldName, $source = null) {
$value = null;
try {
switch ($source) {
- 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 __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($type = "", $name = "", $value = null) {
if (!(bool)preg_match("#^[a-zA-Z][a-zA-Z0-9_]*$#", $name)) {
throw new DBFieldException("Can't create DBField object: invalid field name '" . $name . "'");
}
$this->name = $name;
Method setFieldsValues
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setFieldsValues($valuesList) {
if (is_array($valuesList)) {
$count = 0;
foreach ($this->fieldsList as $fieldName => &$fieldValue) {
if (isset($valuesList[$fieldName])) {
Method friendlyErrorType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function friendlyErrorType($type) {
switch($type) {
case E_ERROR: // 1
return 'E_ERROR';
case E_WARNING: // 2
Method getFieldValue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFieldValue($fieldName, $source = null) {
$value = null;
try {
switch ($source) {
Method setValueWithComplexName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setValueWithComplexName(&$array, $complexName, $value, $rewrite = false) {
if (!is_array($complexName)) {
$complexName = self::parseComplexName($complexName);
}