Showing 4,652 of 306,333 total issues
Function getNumberFields
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getNumberFields(?string $searchModuleName = null): array
{
$cacheKey = $searchModuleName ?? '-';
if (isset($this->numberFieldsCache[$cacheKey])) {
return $this->numberFieldsCache[$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
Function getEmailsFields
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getEmailsFields(?string $searchModuleName = null): array
{
$cacheKey = $searchModuleName ?? '-';
if (isset($this->emailsFieldsCache[$cacheKey])) {
return $this->emailsFieldsCache[$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
Function verifyDkim
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function verifyDkim(): array
{
if (isset($this->dkimCache)) {
return $this->dkimCache;
}
- 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 getBoards
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getBoards(string $moduleName, bool $privileges = false): array
{
if (!\App\Cache::has('KanbanGetBoards', $moduleName)) {
$dataReader = (new \App\Db\Query())->from('s_#__kanban_boards')
->where(['tabid' => \App\Module::getModuleId($moduleName)])
- 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 validateNotIn
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function validateNotIn(string $name, array $row, string $sapi)
{
unset($name);
if (isset($row[$sapi])) {
$value = $row[$sapi];
- 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 getNextBusinessDay
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function getNextBusinessDay(\DateTime &$date, array $days): ?array
{
$tempDay = (int) $date->format('N') + 1;
$counter = 1;
$result = 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 getContent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getContent($trim = false)
{
if (!$trim) {
return $this->content;
}
- 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 getValuesToSave
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getValuesToSave(): array
{
$forSave = [];
$tableName = $this->getTableName();
if (!$this->getId()) {
- 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 getUserLabel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getUserLabel($id)
{
if (isset(self::$userLabelCache[$id])) {
return self::$userLabelCache[$id];
}
- 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 getAllProviders
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllProviders(): array
{
if (self::$providersCache) {
return self::$providersCache;
}
- 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 getPicklistValueImage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getPicklistValueImage($templateId, $moduleName, $treeId)
{
$value = ['name' => ''];
$rows = self::getValuesById((int) $templateId);
if (empty($rows[$treeId])) {
- 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 getOptions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getOptions(): array
{
$caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
$options = [
'headers' => [
- 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 getAccessibleGroups
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
{
$cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
if (!\App\Cache::has('getAccessibleGroups', $cacheKey)) {
$currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
- 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 isExists
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function isExists(int $id, bool $active = true): bool
{
$cacheKey = $active ? 'UserIsExists' : 'UserIsExistsInactive';
if (Cache::has($cacheKey, $id)) {
return Cache::get($cacheKey, $id);
- 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 getActiveAdminId
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getActiveAdminId()
{
$key = '';
$cacheName = 'ActiveAdminId';
if (Cache::has($cacheName, $key)) {
- 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 varExport
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function varExport($variable)
{
if (\is_array($variable)) {
$toImplode = [];
if (static::isAssoc($variable)) {
- 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 loadFiles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function loadFiles($path = false)
{
$dir = new \DirectoryIterator($path ?: $this->path);
foreach ($dir as $fileinfo) {
if ('dir' !== $fileinfo->getType() && 'php' === $fileinfo->getExtension()) {
- 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 getCurrentUserActivityReminderInSeconds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getCurrentUserActivityReminderInSeconds()
{
$activityReminder = $this->reminder_interval;
$activityReminderInSeconds = '';
if ('None' != $activityReminder) {
- 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 getHeadLocks
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getHeadLocks()
{
$return = '';
foreach ($this->getLocks() as $lock) {
switch ($lock) {
- 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 profileField
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function profileField(): int
{
\App\Log::trace('Entering ' . __METHOD__);
$i = 0;
$profileIds = \vtlib\Profile::getAllIds();
- 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"