Showing 4,652 of 306,333 total issues
Function getFieldInstanceByName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstanceByName(string $name, string $label = ''): Vtiger_Field_Model
{
$moduleName = $this->getModule()->getName(true);
$labels = $this->getModule()->getFormFields();
$label = $label ?: ($labels[$name]['label'] ?? '');
- 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 getPicklistValuesForRole
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getPicklistValuesForRole($roleIdList, $groupMode = 'INTERSECTION')
{
if (!$this->isRoleBased()) {
$fieldModel = new Vtiger_Field_Model();
return $fieldModel->getPicklistValues();
- 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 getFormatLoginHistory
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFormatLoginHistory(array $row): array
{
foreach ($row as $key => $value) {
switch ($key) {
case 'time':
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$sSingleOrderTabId = \App\Module::getModuleId('SSingleOrders');
$fInvoiceTabId = \App\Module::getModuleId('FInvoice');
$productCategoryId = \App\Module::getModuleId('ProductCategory');
- 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 getConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function getConfig($type = false)
{
\App\Log::trace('Start ' . __METHOD__ . " | Type: $type");
$cache = Vtiger_Cache::get('SalesProcesses', false === $type ? 'all' : $type);
if ($cache) {
- 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 getFieldInstanceByName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$moduleName = $this->getModule()->getName(true);
$fields = $this->getModule()->getFormFields();
$params = ['label' => 'LBL_' . \strtoupper($name), 'fieldvalue' => $this->get($name) ?? $fields[$name]['default'] ?? '', 'typeofdata' => 'V'];
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request): void
{
try {
$recordModel = Settings_Companies_Record_Model::getInstance();
$fields = $recordModel->getModule()->getFormFields();
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$recordId = $request->getInteger('id');
$pdfModel = Vtiger_PDF_Model::getInstanceById($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 getSameLevelRoles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getSameLevelRoles()
{
if (!isset($this->children)) {
$parentRoles = \App\PrivilegeUtil::getParentRole($this->getId());
$currentRoleDepth = $this->getDepth();
- 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 getEditFieldsModel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getEditFieldsModel()
{
$moduleName = $this->getModule()->getName(true);
$mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
$fieldModels = [];
- 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 importWorkflow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function importWorkflow(array $data)
{
$db = App\Db::getInstance();
$dbCommand = App\Db::getInstance()->createCommand();
$dbCommand->insert($this->getBaseTable(), $data['fields'])->execute();
- 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 setTileLayer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function setTileLayer(App\Request $request): void
{
$value = $request->getByType('vale', 'Text');
$oldValue = \App\Config::module('OpenStreetMap', 'tileLayerServer');
$all = \App\Config::module('OpenStreetMap', 'tileLayerServers');
- 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 removeMenu
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function removeMenu($ids)
{
$db = \App\Db::getInstance();
if (!\is_array($ids)) {
$ids = [$ids];
- 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 update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function update(App\Request $request): void
{
$db = \App\Db::getInstance('admin');
$requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
$response = new Vtiger_Response();
- 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 deleteDir
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function deleteDir($dir)
{
$fd = opendir($dir);
if (!$fd) {
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 getQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getQuery(App\Request $request): App\Db\Query
{
$columns = [];
foreach ($request->getArray('columns') as $key => $value) {
$columns[$key] = $value['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 getValuesToSave
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getValuesToSave(array $data): array
{
if (!$this->getId()) {
$forSave[$this->getModule()->baseTable] = [];
}
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
public function getDisplayValue(string $key): string
{
$value = $this->get($key);
if ('working_days' === $key) {
$days = explode(',', trim($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 findAndBind
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function findAndBind()
{
$mailId = $this->mail->getMailCrmId();
$recordId = 0;
if ($mailId) {
- 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 setFolderList
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function setFolderList($user, $foldersByType)
{
$dbCommand = \App\Db::getInstance()->createCommand();
$oldFoldersByType = (new \App\Db\Query())->select(['type', 'folder'])->from('vtiger_ossmailscanner_folders_uid')->where(['user_id' => $user])->createCommand()->queryAllByGroup(2);
foreach (self::$mainFolders as $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"