Showing 4,652 of 306,333 total issues
Consider simplifying this complex logical expression. Open
Open
if (($arrInput = \explode(' ', $input, 2)) && 2 === \count($arrInput)) {
$userModel = User::getUserModel($userId ?? User::getCurrentUserId());
[$dateInput, $timeInput] = $arrInput;
[$y, $m, $d] = Fields\Date::explode($dateInput, $userModel->getDetail('date_format'));
if ('12' === $userModel->getDetail('hour_format')) {
Consider simplifying this complex logical expression. Open
Open
if (
$fieldModel->isViewable()
&& !($fieldType && $fieldModel->getFieldDataType() !== $fieldType)
&& (!$relRecord || ($relRecord && !$relRecord->isEmpty($fieldModel->getName())))
) {
Consider simplifying this complex logical expression. Open
Open
if (!empty($currency) && !empty($currencyData) && $baseCurrency['id'] !== $currency && $inventory->isField('tax') && $inventory->isField('taxmode') && $inventory->isField('currency')) {
$RATE = $baseCurrency['conversion_rate'] / $currencyData['conversion_rate'];
$html .= '<table class="table-currency-s-two-lang" style="border-collapse:collapse;width:100%;">
<thead>
<tr>
Consider simplifying this complex logical expression. Open
Open
if (!empty($currency) && !empty($rate) && $baseCurrency['id'] !== $currency && $inventory->isField('tax') && $inventory->isField('taxmode') && $inventory->isField('currency')) {
$html .= '<table class="table-currency-summary" style="border-collapse:collapse;width:100%;border:1px solid #ddd;">
<thead>
<tr>
<th colspan="2" style="padding:0px 4px;text-align:center;">
Consider simplifying this complex logical expression. Open
Open
if (!$sourceFieldName || !$this->textParser->recordModel || empty($sourceRecordId = $this->textParser->recordModel->get($sourceFieldName))
|| !\App\Record::isExists($sourceRecordId) || !($recordModel = \Vtiger_Record_Model::getInstanceById($sourceRecordId)) || !$recordModel->isViewable()
) {
return [];
}
Consider simplifying this complex logical expression. Open
Open
if ($fromIp && $byIp && $fromIp !== $byIp && ((!$fromDomain && !$byDomain) || $fromDomain !== $byDomain)) {
$row['ip'] = $fromIp;
$row['key'] = $key;
$row['from'] = $received->getFromName();
$row['by'] = $received->getByName();
Consider simplifying this complex logical expression. Open
Open
if (!$this->error && ($code = $client->getStatusCode())) {
$content = $client->getResponseBody();
$this->success = 204 === $code || (\in_array($code, [200, 201]) && $content && (new Config())->setToken(\App\Json::decode($content)));
} elseif (409 === $client->getStatusCode() && false !== stripos($this->error, 'app')) {
throw new \App\Exceptions\AppException('ERR_RECREATE_APP_ACCESS');
Consider simplifying this complex logical expression. Open
Open
if (($active && isset($users[$id]) && 'Active' == $users[$id]['status'] && !$users[$id]['deleted']) || (!$active && isset($users[$id]))) {
$isExists = true;
}
Consider simplifying this complex logical expression. Open
Open
if (((3 == $actionId || 4 == $actionId) && 0 != $role->get('previewrelatedrecord')) || ((0 == $actionId || 1 == $actionId) && 0 != $role->get('editrelatedrecord'))) {
$parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
if ($parentRecord && Record::isExists($parentRecord)) {
$recordMetaData = \vtlib\Functions::getCRMRecordMetadata($parentRecord);
$permissionsRoleForRelatedField = $role->get('permissionsrelatedfield');
Consider simplifying this complex logical expression. Open
Open
if ((!empty($firstItem) && !empty($firstItemModuleModal = \Vtiger_Field_Model::getInstance($firstItem, \Vtiger_Module_Model::getInstance($sourceModule))) && $firstItemModuleModal->isActiveField() && $fieldModel->isActiveField()) && (11 == $firstItemModuleModal->getUIType()) && (1 == $fieldModel->getUIType())) {
unset($fieldName);
} else {
$blockIdFieldMap[$fieldModel->getBlockId()][$fieldName] = $fieldModel;
if (!$fieldModel->isActiveField()) {
Consider simplifying this complex logical expression. Open
Open
if (('Users' === $moduleName && $record === \App\User::getCurrentUserRealId()) || ('Users' !== $moduleName && !empty($record) && \App\Record::isExists($record) && \App\Privilege::isPermitted($moduleName, 'DetailView', $record))) {
$recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
$eventHandler = new App\EventHandler();
$eventHandler->setRecordModel($recordModel)->setModuleName($moduleName)->setParams($return);
$eventHandler->trigger('MailComposeParamBefore');
Consider simplifying this complex logical expression. Open
Open
if (isset($text[$last]) && $line && !$qLevel
&& '-- ' !== $text[$last]
&& isset($text[$last][\strlen($text[$last]) - 1]) && ' ' === $text[$last][\strlen($text[$last]) - 1]
) {
if ($delSp) {
Consider simplifying this complex logical expression. Open
Open
if ($recordModel->isEditable() && $this->getModule()->isPermitted('DetailView') && \App\Privilege::isPermitted($moduleName, 'ActivityComplete', $recordId) && \App\Privilege::isPermitted($moduleName, 'ActivityCancel', $recordId) && \App\Privilege::isPermitted($moduleName, 'ActivityPostponed', $recordId) && \in_array($recordModel->get('activitystatus'), Calendar_Module_Model::getComponentActivityStateLabel('current'))) {
$linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
'linktype' => 'DETAIL_VIEW_BASIC',
'linklabel' => 'LBL_SET_RECORD_STATUS',
'linkurl' => '#',
Consider simplifying this complex logical expression. Open
Open
if (isset($relations['Products']) || isset($relations['Services']) || isset($relations['OSSOutsourcedServices']) || isset($relations['Assets']) || isset($relations['OSSSoldServices']) || isset($relations['OutsourcedProducts'])) {
$relatedLinks[] = [
'linktype' => 'DETAILVIEWTAB',
'linklabel' => 'LBL_RECORD_SUMMARY_PRODUCTS_SERVICES',
'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showRelatedProductsServices&requestMode=summary',
Consider simplifying this complex logical expression. Open
Open
if (!empty($sl) && \App\Record::isExists($sl)) {
$relatedId = $sl;
} elseif (!empty($subprocess) && \App\Record::isExists($subprocess)) {
$relatedId = $subprocess;
} elseif (!empty($process) && \App\Record::isExists($process)) {
Consider simplifying this complex logical expression. Open
Open
if (isset($relations['Products']) || isset($relations['Services']) || isset($relations['OSSOutsourcedServices']) || isset($relations['Assets']) || isset($relations['OSSSoldServices']) || isset($relations['OutsourcedProducts'])) {
$relatedLinks[] = [
'linktype' => 'DETAILVIEWTAB',
'linklabel' => 'LBL_RECORD_SUMMARY_PRODUCTS_SERVICES',
'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showRelatedProductsServices&requestMode=summary',
Consider simplifying this complex logical expression. Open
Open
if ((empty($item['name']) && empty($item['baseContent'])) && (empty($item['key']) || empty($item['name']) || empty($item['size']) || 50 !== App\TextUtils::getTextLength($item['key']))) {
throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $this->getFieldModel()->getName() . '||' . $this->getFieldModel()->getModuleName() . '||' . \App\Json::encode($value), 406);
}
Consider simplifying this complex logical expression. Open
Open
if (empty($widgetData[$key])
|| ('all' !== $widgetData[$key] && !isset($accessibleUsers[$widgetData[$key]]) && !isset($accessibleGroups[$widgetData[$key]]))
|| ('all' === $widgetData[$key] && !\in_array($widgetData[$key], $available))) {
$defaultValue = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, false, $defaultValue);
$widgetData[$key] = empty($defaultValue) ? \App\User::getCurrentUserId() : $defaultValue;
Consider simplifying this complex logical expression. Open
Open
if (($url = $recordModel->get($fieldName)) &&
0 === strpos($url, $meeting->get('url')) &&
($expFieldName = $fieldModel->getFieldParams()['exp'] ?? '') &&
$recordModel->getField($expFieldName) &&
($recordModel->isNew() || false !== $recordModel->getPreviousValue($expFieldName))
Consider simplifying this complex logical expression. Open
Open
if (null !== $value && (1 === $value || '1' === $value || 'on' === strtolower($value) || 'yes' === strtolower($value) || true === $value)) {
return App\Language::translate('LBL_YES', $this->getFieldModel()->getModuleName());
}