Showing 4,652 of 306,333 total issues
Function process
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$fields = Settings_MailIntegration_ConfigForm_Model::getFields($request->getModule(false));
$field = $request->getByType('updateField');
if (!isset($fields[$field])) {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$response = new Vtiger_Response();
$result = ['success' => false, 'message' => \App\Language::translate('LBL_UPLOAD_ERROR', $request->getModule(false))];
if (!empty($_FILES['imported_list'])) {
- 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 duplicate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function duplicate(App\Request $request)
{
$response = new Vtiger_Response();
$moduleName = $request->getModule(false);
$result = true;
- 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 expression
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function expression()
{
$la1 = $this->la(1);
$la2 = $this->la(2);
if ($this->checkSymbol($la1, 'if')) {
- 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 getPrivileges
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getPrivileges($userId)
{
$recordId = false;
if (!empty($this->get('sourceRecord'))) {
$recordId = $this->get('sourceRecord');
- 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 getValuesFromSource
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getValuesFromSource(App\Request $request, $moduleName = false)
{
$data = parent::getValuesFromSource($request, $moduleName);
$sourceModule = $request->getByType('sourceModule', 2);
if ($sourceModule && $request->has('sourceRecord')) {
- 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 getEntityCount
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getEntityCount(): array
{
$colors = \App\Fields\Picklist::getColors('activitytype', false);
$currentUser = Users_Record_Model::getCurrentUserModel();
$startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
- 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 getRelatedFields
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedFields(Vtiger_Record_Model $recordModel): array
{
$phones = [];
$relatedId = $recordModel->get('related_to') ?: $recordModel->getField('related_to')->get('fieldvalue');
$fieldModel = $this->getFieldModel();
- 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 getFieldInstances
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstances()
{
$fieldInstances = [];
if ($this->isCreate() || $this->isUpdate() || $this->isTransferEdit()) {
$dataReader = (new \App\Db\Query())->from('vtiger_modtracker_detail')->where(['id' => $this->get('id')])->createCommand()->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 getApiDisplayValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getApiDisplayValue($value, Vtiger_Record_Model $recordModel, array $params = [])
{
$return = [];
if ($recordModel && !empty($value)) {
if ('I' === $recordModel->getValueByField('filelocationtype')) {
- 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 getRoomsMessages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getRoomsMessages(App\Request $request)
{
$result = [];
$roomList = \App\Chat::getRoomsByUser();
$areNewEntries = false;
- 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 detail
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function detail(App\Request $request)
{
$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
if ('PLL_PRESENTATION' === $recordModel->get('knowledgebase_view')) {
$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 transfer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function transfer(int $relatedRecordId, int $fromRecordId, int $toRecordId): bool
{
$result = $this->updateDB($toRecordId, ['crmid' => $fromRecordId, 'ossmailviewid' => $relatedRecordId]);
if ($result && $parentId = \Users_Privileges_Model::getParentRecord($toRecordId)) {
$parentIdFromRecordId = \Users_Privileges_Model::getParentRecord($fromRecordId);
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
if (empty($value) || (!\is_array($value) && \App\Json::isEmpty($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 getReferenceList
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getReferenceList()
{
if (isset($this->referenceList)) {
return $this->referenceList;
}
- 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 getListViewMassActions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getListViewMassActions($linkParams)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleModel = $this->getModule();
$links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
- 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 getCustomHeaderFields
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getCustomHeaderFields()
{
$moduleName = $this->getModuleName();
$path = 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'headerfields';
if (!is_dir($path)) {
- 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 getRelatedModuleRecordIds
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedModuleRecordIds(App\Request $request, $recordIds, $relModData)
{
$basicModule = $request->getModule();
$parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);
$relatedIds = [];
- 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 getStructure
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure()
{
if (!empty($this->structuredValues)) {
return $this->structuredValues;
}
- 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 getFields
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getFields($type = false)
{
$fields = $this->get('fields');
if (!$fields) {
$fields = [];
- 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"