Showing 4,652 of 306,333 total issues
Function getValuesToSave
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getValuesToSave(array $data): array
{
$forSave = [];
if (!$this->getId()) {
$forSave[$this->getModule()->baseTable][$this->getModule()->baseIndex] = \App\Db::getInstance('admin')->getUniqueId('vtiger_users');
- 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 executeActions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function executeActions($account, OSSMail_Mail_Model $mail, $folder, $params = false)
{
\App\Log::trace('Start execute actions: ' . $account['username'], 'MailScanner');
$actions = [];
- 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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function validate(array $data): array
{
if (isset($data['id'])) {
$data['id'] = \App\Purifier::purifyByType($data['id'], 'Integer');
}
- 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 getExternalUrl
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
{
$url = 'mailto:';
$request = new App\Request([]);
if ($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 getFieldInfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInfo(): array
{
$this->loadFieldInfo();
//Change the default search operator
if ('date_start' == $this->get('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 updateReminderPostpone
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function updateReminderPostpone(string $time)
{
switch ($time) {
case '15m':
$datatime = date('Y-m-d H:i:s', strtotime('+15 min'));
- 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 process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$currentUserId = \App\User::getCurrentUserId();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
- 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 compare
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function compare(App\Request $request): array
{
$this->parseCsv->heading = false;
$this->parseCsv->auto($this->path);
$this->storage = $request->getInteger('storage');
- 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 recordCreate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function recordCreate($cal)
{
\App\Log::trace(__METHOD__ . ' | Start Cal ID' . $cal['id']);
$calendar = \App\Integrations\Dav\Calendar::loadFromContent($cal['calendardata']);
foreach ($calendar->getRecordInstance() as $recordModel) {
- 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 recordUpdate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function recordUpdate(Vtiger_Record_Model $record, $cal)
{
\App\Log::trace(__METHOD__ . ' | Start Cal ID:' . $cal['crmid']);
$calendar = \App\Integrations\Dav\Calendar::loadFromContent($cal['calendardata'], $record, $cal['uid']);
foreach ($calendar->getRecordInstance() as $recordModel) {
- 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 getModulesAndCount
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getModulesAndCount(Vtiger_Record_Model $parentRecordModel)
{
$modules = [];
foreach (self::MODULES as $moduleName) {
$count = 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 reviewChanges
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function reviewChanges(App\Request $request)
{
$moduleName = $request->getModule();
$sourceModule = $request->getByType('sourceModule', 2);
$request->set('module', $sourceModule);
- 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 findEmailInRelated
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function findEmailInRelated(Vtiger_Record_Model $recordModel): string
{
$relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, 'Contacts');
$query = $relationListView->getRelationQuery();
$tabIndex = $relationListView->getRelatedModuleModel()->getEntityInstance()->tab_name_index;
- 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 getFilePath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getFilePath(): string
{
$path = '';
if ($fileDetails = $this->getFileDetails()) {
$fileName = $fileDetails['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 checkPermissionByRoom
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function checkPermissionByRoom(App\Request $request): void
{
switch ($request->getByType('roomType')) {
case 'crm':
$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkPermission(App\Request $request)
{
$sourceModule = $request->getByType('sourceModule', 2);
$records = $request->getArray('recordsId', 'Integer');
if ($sourceModule) {
- 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 process
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleName = $request->getModule();
$documentIdsList = $this->getRecordsListFromRequest($request);
if (!empty($documentIdsList)) {
- 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 getEditViewDisplayValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getEditViewDisplayValue($value, $recordModel = false)
{
$value = \App\Json::decode($value);
$id = false;
if ($recordModel) {
- 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 getDisplayValue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
{
if (empty($value)) {
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 getPicklistValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getPicklistValues()
{
$params = $this->getFieldModel()->getFieldParams();
$condition = ['and',
['<>', 'vtiger_field.presence', 1],
- 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"