Showing 4,652 of 306,333 total issues
Method getTreeEntries
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTreeEntries()
{
$relModuleName = $this->getRelatedModuleModel()->getName();
$relationModelInstance = $this->getRelationModel();
$template = $this->getTreeViewModel()->getTemplate();
Method updateUploadFiles
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateUploadFiles(array $value, Vtiger_Record_Model $recordModel)
{
$previousValue = $recordModel->get($this->getFieldModel()->getName());
$previousValue = ($previousValue && !\App\Json::isEmpty($previousValue)) ? \App\Fields\File::parse(\App\Json::decode($previousValue)) : [];
$value = \App\Fields\File::parse($value);
Method checkUserPermissions
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function checkUserPermissions()
{
\App\Log::trace('Entering ' . __METHOD__ . '() method ...');
$permissions = $this->get('permissions');
if (empty($permissions)) {
Method getAutoCompleteField
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAutoCompleteField($recordModel): array
{
$fields = [];
$fieldsReferenceList = [];
$excludedModules = ['Users'];
Method getQuery
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getQuery(App\Request $request)
{
$cvId = $request->isEmpty('viewname') ? '' : $request->getByType('viewname', 2);
$moduleName = $request->getByType('module', 'Alnum');
if (!empty($cvId) && 'undefined' === $cvId && 'Users' !== $request->getByType('source_module', 2)) {
Method getModalLinks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getModalLinks(Vtiger_Record_Model $recordModel)
{
$links = Vtiger_Link_Model::getAllByType($recordModel->getModule()->getId(), ['QUICK_DETAIL_MODAL_HEADER'])['QUICK_DETAIL_MODAL_HEADER'] ?? [];
if ($recordModel->isEditable()) {
$links[] = Vtiger_Link_Model::getInstanceFromValues([
Method showModuleBasicView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function showModuleBasicView(App\Request $request)
{
$recordId = $request->getInteger('record');
$moduleName = $request->getModule();
$recordModel = $this->record->getRecord();
Method process
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(App\Request $request)
{
if ($mode = $request->getMode()) {
$this->invokeExposedMethod($mode, $request);
return;
Method getListRecord
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getListRecord($module, array $columnList, $limit)
{
$moduleList = [];
$recordList = [];
if (!$module) {
Method process
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(App\Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
Method getRecords
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getRecords(\App\QueryGenerator $mainQueryGenerator, int $parentId, string $type = 'child'): void
{
if (0 === $this->limit || isset($this->recursion[$parentId][$type])) {
return;
}
Method get
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get(): array
{
$file = $pdfFiles = $increment = [];
$recordId = $this->controller->request->getInteger('record');
foreach ($this->controller->request->getArray('templates', 'Integer') as $templateId) {
Consider simplifying this complex logical expression. Open
Open
if ($itemPropertyModel && isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {
$this->validateValue($name, $this->{$name});
$forSave[$itemPropertyModel->getTableName()][$itemPropertyModel->getColumnName()] = $this->{$name};
} elseif (isset($this->{$name}) && ($this->getId() || (!$this->getId() && '' !== $this->{$name}))) {
$this->validateValue($name, $this->{$name});
Consider simplifying this complex logical expression. Open
Open
if ($request->isEmpty('record', true)
|| (!$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule()))
|| !$recordModel->isPermitted('WorkflowTrigger')
|| !$recordModel->isPermitted('DetailView')
|| (!$recordModel->isPermitted('EditView') || ($recordModel->isPermitted('EditView') && !$recordModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && !$recordModel->isBlocked()))) {
Consider simplifying this complex logical expression. Open
Open
if ($request->isEmpty('record', true)
|| (!$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule()))
|| !$recordModel->isPermitted('WorkflowTrigger')
|| !$recordModel->isPermitted('DetailView')
|| (!$recordModel->isPermitted('EditView') || ($recordModel->isPermitted('EditView') && !$recordModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && !$recordModel->isBlocked()))) {
Function registerInactiveFieldsEvent
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerInactiveFieldsEvent: function () {
var thisInstance = this;
var contents = this.container.find('.contents');
contents.on('click', '.js-inactive-fields-btn', function (e) {
let currentTarget = $(e.currentTarget);
Function saveCustomRule
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
saveCustomRule: function (form, e) {
const thisInstance = this;
let data = form.serializeFormData();
if (typeof data === 'undefined') {
data = {};
Function callBackFunction
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callBackFunction = function (data) {
data.find('.addBlockModal').removeClass('d-none').show();
App.Fields.Picklist.showSelect2ElementView(data.find('select'));
let form = data.find('.addCustomBlockForm');
thisInstance.setBlocksListArray(form);
Function registerVaribleToParsers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerVaribleToParsers: function (container) {
container.find('.configButton').on('click', function (e) {
container.find('.js-toggle-hide .js-base-element').each(function (n, e) {
var currentElement = $(e);
if (currentElement.hasClass('d-none')) {
Function registerLoadData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerLoadData: function () {
const thisInstance = this;
this.getContainer().on('change', '.js-base-user', function (e) {
let selectElement = jQuery(e.currentTarget),
panel = selectElement.closest('.js-panel-item'),