Showing 4,652 of 306,333 total issues
Function saveAttachments
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function saveAttachments()
{
$userId = $this->getAccountOwner();
$useTime = $this->get('date');
$files = $this->get('files');
- 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 getAll
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function getAll($moduleName = '', bool $fromFile = true)
{
$currentUser = \App\User::getCurrentUserModel();
$cacheName = "{$moduleName}_{$currentUser->getId()}_{$fromFile}";
if (App\Cache::has('getAllFilters', $cacheName)) {
- 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 getProductsServices
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getProductsServices(App\Request $request, Vtiger_Viewer $viewer)
{
$fromModule = $request->getByType('fromModule', 'Text');
$record = $request->getInteger('record');
$mod = current($request->getArray('mod', 'Alnum'));
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$sourceModuleName = $request->getByType('source_module', \App\Purifier::ALNUM);
$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 updateCard
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function updateCard($moduleName, $record, $card)
{
\App\Log::trace(__METHOD__ . ' | Start CRM ID:' . $record['crmid']);
$vcard = Sabre\VObject\Reader::read($card['carddata']);
$vcard->PRODID = self::PRODID;
- 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 createCard
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function createCard($moduleName, $record)
{
\App\Log::trace(__METHOD__ . ' | Start CRM ID:' . $record['crmid']);
$vcard = new Sabre\VObject\Component\VCard();
- 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 getLastRelation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function getLastRelation($sourceIds, $sourceModule)
{
$colors = Vtiger_HistoryRelation_Widget::$colors;
if (!\is_array($sourceIds)) {
$sourceIds = [$sourceIds];
- 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 getDetailViewLinks
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getDetailViewLinks(array $linkParams): array
{
$recordModel = $this->getRecord();
$linkModelList = parent::getDetailViewLinks($linkParams);
unset($linkModelList['DETAIL_VIEW_ADDITIONAL']);
- 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 entityBeforeSave
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function entityBeforeSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
if (($probability = $recordModel->getField('probability')) && $probability->isActiveField()) {
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 setMessagesResult
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function setMessagesResult(App\Request $request)
{
if ($request->has('roomType') && $request->has('recordId')) {
$roomType = $request->getByType('roomType');
$recordId = $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 validate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = 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 entityBeforeSave
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function entityBeforeSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
$meeting = \App\MeetingService::getInstance();
if ($meeting->isActive()) {
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
$hashValue = \is_array($value) ? implode('|', $value) : $value;
if (isset($this->validate[$hashValue]) || 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 getDbConditionBuilderValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getDbConditionBuilderValue($value, string $operator)
{
$values = [];
if (!\is_array($value)) {
$value = $value ? explode('##', $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 getValueFromImport
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getValueFromImport($value, $defaultValue = null)
{
if ('' === $value && null !== $defaultValue) {
$value = $defaultValue;
}
- 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 uploadTempFile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function uploadTempFile(array $files, int $recordId)
{
$db = \App\Db::getInstance();
$attach = [];
$maxSize = $this->getFieldInfo()['maxFileSize'];
- 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 getQueryFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryFields()
{
if ($this->has('QueryFields')) {
return $this->get('QueryFields');
}
- 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 loadRowData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function loadRowData(int $recordId, array $params = []): array
{
$recordModel = Vtiger_Record_Model::getInstanceById($recordId);
$recordModuleName = $recordModel->getModuleName();
$data = [
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function checkPermission(App\Request $request)
{
$moduleName = $request->getModule();
if ($request->isEmpty('record', true)) {
$this->record = Vtiger_Record_Model::getCleanInstance($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 exportData
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function exportData()
{
$headers = $this->getHeaders();
$addInventoryData = $this->fullData && $this->moduleInstance->isInventory();
- 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"