Showing 4,652 of 306,333 total issues
Function addForeignKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addForeignKey(Base $importer)
{
if (!isset($importer->foreignKey)) {
return;
}
- 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 getMembers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getMembers()
{
if (false === static::$membersCache) {
$members = [];
$owner = new \App\Fields\Owner();
- 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 flatten
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function flatten(array $array, float $depth = INF): array
{
$result = [];
foreach ($array as $item) {
if (\is_array($item)) {
- 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 getCompaniesByName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getCompaniesByName(string $companyName): void
{
try {
$response = \App\RequestHttp::getClient(['auth' => [$this->username, $this->password]])
->post($this->url . 'search', ['json' => ['name' => $companyName]]);
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function search(): array
{
if (!$this->isActive()) {
return [];
}
- 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 getQueryToUsersByGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getQueryToUsersByGroup(int $groupId, bool $recursive = true, int $depth = 0): Db\Query
{
++$depth;
$query = (new \App\Db\Query())->select(['userid'])->from('vtiger_users2group')->where(['groupid' => $groupId])
->union(
- 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 hasModuleActionPermission
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function hasModuleActionPermission($mixed, $action)
{
if (!is_a($action, 'Vtiger_Action_Model')) {
$action = Vtiger_Action_Model::getInstance($action);
}
- 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 removeRoleToPicklist
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function removeRoleToPicklist($fields): void
{
\App\Log::trace('Entering ' . __METHOD__);
$db = \App\Db::getInstance();
$schema = $db->getSchema();
- 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 isActive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isActive($userId = null)
{
$isActive = false;
if (empty($userId)) {
$userId = \App\User::getCurrentUserRealId();
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function search(): array
{
if (!$this->isActive()) {
return [];
}
- 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 getUserByMember
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getUserByMember($member)
{
if (Cache::has('getUserByMember', $member)) {
return Cache::get('getUserByMember', $member);
}
- 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 verifyPasswordChange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function verifyPasswordChange(App\User $userModel): void
{
$passConfig = \Settings_Password_Record_Model::getUserPassConfig();
$time = (int) $passConfig['change_time'];
if (1 === (int) $userModel->getDetail('force_password_change')) {
- 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 __getParentEmployees
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __getParentEmployees($id, &$parentAccounts, &$encounteredAccounts)
{
$parentId = (new App\Db\Query())
->select(['parentid'])
->from('vtiger_ossemployees')
- 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 checkLibrary
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function checkLibrary($name)
{
if (App\Cache::has('checkLibrary', $name)) {
return App\Cache::get('checkLibrary', $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 getEmployeeHierarchy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getEmployeeHierarchy()
{
$focus = CRMEntity::getInstance($this->getModuleName());
$hierarchy = $focus->getEmployeeHierarchy($this->getId());
foreach ($hierarchy['entries'] as $employeeId => $employeeInfo) {
- 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 addSystemField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addSystemField(string $sysName, int $blockId, array $params = []): void
{
$missingSystemFields = $this->getMissingSystemFields();
if (empty($missingSystemFields[$sysName])) {
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- 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 checkPermission
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function checkPermission(App\Request $request)
{
if ('TOTP_OFF' === App\Config::security('USER_AUTHY_MODE')) {
throw new \App\Exceptions\NoPermitted('ERR_PERMISSION_DENIED', 403);
}
- 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 getData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getData(App\Request $request)
{
$moduleName = $request->getModule();
$groupId = $request->getInteger('groupID');
$groupMembers = Settings_Groups_Member_Model::getAllByTypeForGroup($groupId);
- 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 loadFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadFilter(App\Request $request, array $filter, App\Db\Query &$query)
{
foreach ($filter as $key => $value) {
if ($request->has($key) && '' !== $request->getRaw($key)) {
switch ($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 isAddCustomFieldEnabled
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isAddCustomFieldEnabled()
{
$actionNotSupportedModules = ['calendar', 'events', 'faq', 'helpdesk'];
$blocksEliminatedArray = ['calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_RELATED_TO', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_INFORMATION'],
'helpdesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
- 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"