Showing 4,652 of 306,333 total issues
Function getMainParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getMainParams: function (param, json) {
if (param in CONFIG) {
return CONFIG[param];
}
if (app.cacheParams[param] === undefined) {
- 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 toggleRightPanel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toggleRightPanel({ commit, getters }, newValue) {
if (getters.mobileMode) {
commit('setRightPanelMobile', newValue !== undefined ? newValue : !getters['rightPanelMobile'])
} else {
commit('setRightPanel', newValue !== undefined ? newValue : !getters['rightPanel'])
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
validate: function (dependentFieldList) {
var field = this.getElement();
var fieldLabel = field.data('fieldinfo').label;
var status = field.val();
var contextFormElem = field.closest('form');
- 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 getCurrentUserEntityFieldNameDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues)
{
if (false === strpos($fieldsName, ',')) {
return $fieldValues[$fieldsName];
}
- 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 updateFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateFields($blocknode, $blockInstance, $moduleInstance)
{
if (empty($blocknode->fields) || empty($blocknode->fields->field)) {
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 initForModule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function initForModule(ModuleBasic $moduleInstance)
{
$db = \App\Db::getInstance();
$actionids = (new \App\Db\Query())->select(['actionid'])->from('vtiger_actionmapping')
->where(['actionname' => ['Save', 'EditView', 'Delete', 'index', 'DetailView', 'CreateView']])
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function initialize($valuemap)
{
foreach ($valuemap as $key => $value) {
if (!empty($value) && ('linkurl' == $key || 'linkicon' == $key)) {
$this->{$key} = \App\Purifier::decodeHtml($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 importModule
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function importModule()
{
$moduleName = (string) $this->_modulexml->name;
$tabLabel = $this->_modulexml->label;
$tabVersion = $this->_modulexml->version;
- 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 updateCustomViews
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateCustomViews($modulenode, $moduleInstance)
{
if (empty($modulenode->customviews) || empty($modulenode->customviews->customview)) {
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 testLoadFiles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function testLoadFiles()
{
static::assertTrue(\App\Installer\Languages::download('pl-PL'), 'Error while downloading the language "pl-PL"');
$parser = new \Seld\JsonLint\JsonParser();
foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'languages', \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $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 getInstance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance($value, $module = false)
{
$tabId = is_numeric($module) ? $module : \App\Module::getModuleId($module);
$cacheName = $value . '|' . $tabId;
if (\App\Cache::has('BlockInstance', $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 testBanks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function testBanks()
{
$dataReader = (new \App\Db\Query())->select(['id', 'currency_code'])
->from('vtiger_currency_info')
->where(['currency_status' => 'Active', 'deleted' => 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 deleteIcons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteIcons()
{
\App\Log::trace('Start', __METHOD__);
$iconSize = ['', 48, 64, 128];
$layouts = array_keys(\App\Layout::getAllLayouts());
- 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 testAddPicklistColorColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function testAddPicklistColorColumn()
{
$db = \App\Db::getInstance();
$tableSchema = $db->getSchema()->getTableSchema('vtiger_contract_priority', true);
$this->assertNotEmpty($tableSchema, 'Table vtiger_contract_priority not exists');
- 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 testGetRelatedVariable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function testGetRelatedVariable()
{
$arr = self::$parserCleanModule->getRelatedVariable();
$this->assertIsArray($arr, 'Expected array type');
$this->assertNotEmpty($arr, 'Expected any related variables 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 getListViewFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getListViewFields(): array
{
$headerFields = [];
foreach ($this->getFields() as $fieldName) {
if ($model = $this->getModuleField($fieldName)) {
- 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 getLast
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getLast(int $record, ?int $userId = null): ?array
{
if (null === $userId) {
$userId = \App\User::getCurrentUserRealId();
}
- 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 export
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function export()
{
$text = implode("\n", array_map([$this, 'formatMessage'], $this->messages));
if (false === ($fp = fopen($this->logFile, 'a'))) {
throw new InvalidConfigException("Unable to append to log file: {$this->logFile}");
- 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 addToQueueWhenParentHasBeenModified
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addToQueueWhenParentHasBeenModified(\Vtiger_Record_Model $recordModel)
{
if (!empty($this->targetColumnParentId) && false !== ($previousValue = $recordModel->getPreviousValue($this->targetColumnParentId))) {
if (!empty($previousValue)) {
$this->addToQueueSubordinateModule($previousValue);
- 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 getStates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getStates(string $moduleName, int $state = null)
{
$fieldName = static::getFieldName($moduleName);
$primaryKey = Fields\Picklist::getPickListId($fieldName);
$values = [];
- 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"