Showing 4,652 of 306,333 total issues
Function parseConditions
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
{
if (empty($conditions)) {
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 getAddressFieldValue
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function getAddressFieldValue(string $type, string $fieldNameCrm, string $fieldName)
{
$methodName = 'getCrm' . \ucfirst($fieldNameCrm);
if (!empty($fieldParsed = $this->getAddressDataByType($type))) {
if (\method_exists($this, $methodName)) {
- 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 baseModuleTools
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public static function baseModuleTools(): int
{
$i = 0;
$allUtility = $missing = $curentProfile2utility = [];
foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
- 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 addTables
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function addTables(Base $importer)
{
$this->logs .= "> start add tables ({$importer->dbType})\n";
$startMain = microtime(true);
foreach ($importer->tables as $tableName => $table) {
- 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 transferListSearchParamsToFilterCondition
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
{
if (empty($searchParams)) {
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 process
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
\App\Log::trace('Start ' . __METHOD__);
$qualifiedModule = $request->getModule(false);
$viewer = $this->getViewer($request);
- 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 getCalendarActivities
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function getCalendarActivities($mode, Vtiger_Paging_Model $pagingModel, $user, $recordId = false, $paramsMore = [])
{
$activities = [];
$query = new \App\Db\Query();
if (!$user) {
- 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 getExternalUrlForWidget
has a Cognitive Complexity of 34 (exceeds 5 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');
- 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 unfoldFlowed
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected static function unfoldFlowed(string $text, bool $delSp = false): string
{
$text = preg_split('/\r?\n/', $text);
$last = -1;
$qLevel = 0;
- 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 getWidgetTimeControl
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function getWidgetTimeControl($user, $date)
{
if (!$date) {
return ['show_chart' => 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 process
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$recordId = $request->getInteger('record');
- 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 showRelatedList
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function showRelatedList(App\Request $request)
{
$moduleName = $request->getModule();
$relatedModuleName = $request->getByType('relatedModule', 2);
$parentId = $request->getInteger('record');
- 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 send
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function send()
{
$encryptDataTransfer = \App\Config::api('ENCRYPT_DATA_TRANSFER') ? 1 : 0;
if (200 !== $this->status || 'data' !== $this->responseType) {
$encryptDataTransfer = 0;
- 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
Method __vtlibGetModulevarValue
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function __vtlibGetModulevarValue($module, $varname)
{
$mod_var_mapping = [
'Accounts' => [
'IsCustomModule' => false,
ModTracker_Record_Model
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class ModTracker_Record_Model extends Vtiger_Record_Model
{
const UPDATE = 0;
const DELETE = 1;
const CREATE = 2;
Method operationsAfterPicklistDelete
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
Function getValues
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
getValues: function () {
const thisInstance = this;
let fieldList = ['columnname', 'comparator', 'value', 'column_condition'],
filterContainer = this.getFilterContainer(),
conditionGroups = $('.conditionGroup', filterContainer),
Method getRelatedModuleSharingArray
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
{
$relatedModSharingPermission = [];
$modShareReadPermission = [];
$modShareWritePermission = [];
Method saveModulePermissions
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function saveModulePermissions($moduleModel, $permissions)
{
$db = \App\Db::getInstance();
$dbCommand = $db->createCommand();
$profileId = $this->getId();
Function record
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
protected function record($params, $isPermitted = true)
{
if (!isset($this->recordModel) || ($isPermitted && !Privilege::isPermitted($this->moduleName, 'DetailView', $this->record))) {
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"