Showing 4,652 of 306,333 total issues
Function addTimeControl
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
addTimeControl: function (params) {
let aDeferred = jQuery.Deferred();
let referenceModuleName = 'OSSTimeControl';
let parentId = params.recordId;
let parentModule = 'HelpDesk';
- 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 __create
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function __create($blockInstance)
{
$db = \App\Db::getInstance();
$this->block = $blockInstance;
$moduleInstance = $this->getModuleInstance();
- 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 unzip
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function unzip($toDir, bool $close = true)
{
if (\is_string($toDir)) {
$toDir = [$toDir];
}
- 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 computeLabels
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function computeLabels($moduleName, $ids, $search = false): ?array
{
if (empty($moduleName) || empty($ids)) {
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 db
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private static function db(): array
{
$benchmarkCountGroup = 20;
$insertCountGroup = 5;
$updateCountGroup = 5;
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function save($mapping)
{
$db = \App\Db::getInstance();
$deleteMappingsList = $updateMappingsList = $createMappingsList = [];
foreach ($mapping as $mappingDetails) {
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
$moduleModel = Vtiger_Module_Model::getInstance($this->textParser->moduleName);
$fields = $moduleModel->getFields();
$ids = $this->textParser->getParam('pdf')->getVariable('recordsId');
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
\App\Log::trace('Start SendReminder');
$dataReader = (new \App\Db\Query())->select([
'vtiger_crmentity.smownerid',
- 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 reviewChanges
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function reviewChanges()
{
$db = \App\Db::getInstance();
$recordsList = $this->getRecords();
if (!empty($recordsList)) {
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function uploadTempFile(array $files, int $recordId, ?string $hash = null)
{
$db = \App\Db::getInstance();
$attach = [];
$type = 'image';
- 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 getImage
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getImage()
{
$image = [];
if (!$this->isEmpty('imagename') && \App\Json::isJson($this->get('imagename')) && !\App\Json::isEmpty($this->get('imagename'))) {
$image = \App\Json::decode($this->get('imagename'));
- 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 getStructure
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure()
{
if (!empty($this->structuredValues)) {
return $this->structuredValues;
}
- 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 getRelationField
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getRelationField()
{
if ($this->has('RelationField')) {
return $this->get('RelationField');
}
- 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 getOwners
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getOwners(App\Request $request): void
{
if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
}
- 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 getRelatedListPageCount
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedListPageCount(App\Request $request)
{
$moduleName = $request->getModule();
$relatedModuleName = $request->getArray('relatedModule', 'Alnum');
$firstRelatedModuleName = current($relatedModuleName);
- 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 entityAfterSave
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function entityAfterSave(App\EventHandler $eventHandler): void
{
$typeAddressToUpdate = [];
$recordModel = $eventHandler->getRecordModel();
if (!$recordModel->isNew()) {
- 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 getRecordFromRow
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function getRecordFromRow(array $row): array
{
$record = ['recordLabel' => \App\Record::getLabel($row['id'])];
if ($this->fields) {
$moduleModel = reset($this->fields)->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 initEditView
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
initEditView: function () {
function toggleEditViewTableRow(e) {
var target = jQuery(e.currentTarget);
var container = jQuery('[data-togglecontent="' + target.data('togglehandler') + '"]');
var closestTrElement = container.closest('tr');
Method process
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
Method evaluate
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function evaluate($condition, Vtiger_Record_Model $recordModel)
{
$expr = \App\Json::decode($condition);
$finalResult = true;
if (\is_array($expr)) {