Showing 4,652 of 306,333 total issues
Method getModules
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getModules(): array
{
$cacheName = 'InterestsConflict::getModules';
if (\App\Cache::has($cacheName, '')) {
return \App\Cache::get($cacheName, '');
Method vtwsConvertlead
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function vtwsConvertlead($entityvalues, Users_Record_Model $user)
{
\App\Log::trace('Start ' . __METHOD__);
if (empty($entityvalues['assignedTo'])) {
$entityvalues['assignedTo'] = $user->id;
Method getExternalUrlForWidget
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
{
if (\is_object($record)) {
$body = $record->get('content');
$subject = $record->get('subject');
Method getDetailViewRelatedLinks
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDetailViewRelatedLinks()
{
$recordModel = $this->getRecord();
$parentModuleModel = $this->getModule();
$this->getWidgets();
File Edit.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
File Record.php
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Record basic file.
*
* @package App
File Privileges.php
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
Function importInventory
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function importInventory()
{
if (1 !== $this->moduleInstance->type) {
return 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 vtwsPopulateConvertLeadEntities
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function vtwsPopulateConvertLeadEntities($entityvalue, $entity, Vtiger_Record_Model $recordModel, $leadinfo)
{
$targetModuleModel = Vtiger_Module_Model::getInstance($entityvalue['name']);
$entityName = $entityvalue['name'];
$dataReader = (new \App\Db\Query())->from('vtiger_convertleadmapping')->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 getDisplayValueByType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function getDisplayValueByType($value, \Vtiger_Record_Model $recordModel, \Vtiger_Field_Model $fieldModel, $params)
{
switch ($fieldModel->getFieldDataType()) {
case 'boolean':
$value = (1 === $value) ? 'LBL_YES' : 'LBL_NO';
- 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 getErrors
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function getErrors(string $type, bool $returnMore = false): array
{
$result = [];
foreach (static::get($type, true) as $param => $data) {
if (!$data['status'] && (empty($data['mode']) || 'showErrors' === $data['mode']) && empty($data['noParameter'])) {
- 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 getHistoryByType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getHistoryByType(string $roomType = 'global', ?int $messageId = null)
{
$columnMessage = static::COLUMN_NAME['message'][$roomType];
$columnRoomName = static::COLUMN_NAME['room_name'][$roomType];
$roomNameId = 'global' === $roomType || 'private' === $roomType ? static::COLUMN_NAME['room'][$roomType] : $columnMessage;
- 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 getRulesForServiceContracts
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function getRulesForServiceContracts(int $serviceContractId, \Vtiger_Record_Model $recordModel): array
{
$times = $businessHours = [];
foreach (self::getSlaPolicyForServiceContracts($serviceContractId, $recordModel->getModule()->getId()) as $row) {
switch ($row['policy_type']) {
- 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 loadInventory
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function loadInventory(): void
{
$inventory = $this->getInventory();
if (!$this->recordModel->isNew()) {
$oldInventory = $this->recordModel->getInventoryData();
- 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 generatePicklists
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
private static function generatePicklists()
{
$css = '';
foreach (Fields\Picklist::getModules() as $module) {
$fields = static::getPicklistFieldsByModule($module['tabname']);
- 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 afterLogin
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function afterLogin(App\Request $request): void
{
\App\Controller\Headers::generateCspToken();
if (\Config\Security::$loginSessionRegenerate) {
\App\Session::regenerateId(true); // to overcome session id reuse.
- 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 22 (exceeds 5 allowed). Consider refactoring. Open
public function getDisplayValue($name)
{
$value = $this->get($name);
switch ($name) {
case 'server_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 parseToDisplay
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function parseToDisplay(array $menus): array
{
$userPrivilegesModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
$data = [];
foreach ($menus as $key => $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 save
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
$db = App\Db::getInstance();
$roleId = $this->getId();
$mode = 'edit';
- 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 mailScan
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function mailScan($mbox, array $account, string $folder, int $scan_id, int $countEmails)
{
$break = false;
$lastScanUid = self::getUidFolder($account['user_id'], $folder);
\App\Log::beginProfile(__METHOD__ . '|imap_msgno', 'Mail|IMAP');
- 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"