Showing 4,652 of 306,333 total issues
Function registerFormSubmitEvent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerFormSubmitEvent: function (form) {
var thisInstance = this;
var lockSave = true;
if (app.getRecordId()) {
form.on(Vtiger_Edit_Js.recordPreSave, function (e) {
Function showSidebarEvent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
showSidebarEvent(params) {
const self = this,
aDeferred = $.Deferred();
const progressInstance = $.progressIndicator({ blockInfo: { enabled: true } });
if (typeof params == 'number') {
Function registerUsersEvents
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerUsersEvents: function (modalContainer) {
modalContainer.find('.js-ic-canceled-btn').click(function (e) {
let btn = $(e.currentTarget);
let tr = btn.closest('tr');
let icon = tr.find('.js-change-icon');
Function deleteRecord
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
deleteRecord: function (container) {
var thisInstance = this;
var recordId = container.find('#recordId').val();
app.showConfirmModal({
text: app.vtranslate('LBL_DELETE_CONFIRMATION'),
Function setFieldOptions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setFieldOptions: function (fieldName, options) {
const fieldElement = this.getForm().find(`[name="${fieldName}"]`),
fieldInfo = fieldElement.data('fieldinfo');
if (fieldElement.is('select') && fieldInfo) {
const val = fieldElement.val() ?? '',
Function loadConditions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadConditions: function (fieldSelect) {
var row = fieldSelect.closest('div.js-conditions-row');
var conditionSelectElement = row.find('select[name="comparator"]');
var conditionSelected = conditionSelectElement.val();
var fieldSelected = fieldSelect.find('option:selected');
Function markNotifications
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
markNotifications: function (id) {
let aDeferred = $.Deferred();
let thisInstance = this;
let params = {
module: 'Notification',
Function registerStep1
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerStep1() {
let chartType = $('select[name="chartType"]', this.container);
let moduleElement = $('select[name="module"]', this.container);
App.Fields.Picklist.showSelect2ElementView(moduleElement, {
placeholder: app.vtranslate('JS_SELECT_MODULE')
Function registerLastRelationsEvent
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerLastRelationsEvent: function () {
let ids = [],
listViewContentDiv = this.getListViewContentContainer(),
isTimeLineActive = listViewContentDiv.find('.timeLineIconList').length;
listViewContentDiv.find('tr.listViewEntries').each(function () {
Function getDateInstance
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getDateInstance: function (dateTime, dateFormat = CONFIG.dateFormat) {
let dateTimeComponents = dateTime.split(' '),
dateComponent = dateTimeComponents[0],
timeComponent = dateTimeComponents[1],
seconds = '00',
Function readImageAsBase64
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readImageAsBase64() {
const aDeferred = jQuery.Deferred();
let fileI = self.getContentElement('tab-source', 'file'),
n = null;
try {
Function showPopoverElementView
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
showPopoverElementView: function (selectElement = $('.js-popover-tooltip'), params = {}) {
let defaultParams = {
trigger: 'manual',
manualTriggerDelay: 500,
placement: 'auto',
Method transformFieldTypeOfData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function transformFieldTypeOfData($table_name, $column_name, $type_of_data)
{
$field = $table_name . ':' . $column_name;
//Add the field details in this array if you want to change the advance filter field details
Method create
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function create()
{
$db = \App\Db::getInstance();
$db->createCommand()->insert('vtiger_profile', [
'profilename' => $this->name,
Method setNoRolePicklistValues
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setNoRolePicklistValues($values)
{
$db = \App\Db::getInstance();
$pickListNameIDs = ['recurring_frequency', 'payment_duration'];
$picklistTable = 'vtiger_' . $this->name;
Method testAddRole
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testAddRole()
{
$recordModel = new \Settings_Roles_Record_Model();
$parentRole = \Settings_Roles_Record_Model::getInstanceById('H2');
$this->assertNotNull($parentRole);
Method update
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update($moduleInstance, $zipfile, $overwrite = true)
{
$module = $this->getModuleNameFromZip($zipfile);
if (null !== $module) {
$zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
Method testAddMultiImage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testAddMultiImage(): void
{
$recordModel = \Vtiger_Record_Model::getInstanceById(\Tests\Base\C_RecordActions::createProductRecord(false)->getId(), 'Products');
$attach = [];
foreach (self::$files as $i => $name) {
Method vtwsSaveLeadRelations
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function vtwsSaveLeadRelations($leadId, $relatedId, $setype)
{
$db = \App\Db::getInstance();
$dataReader = (new App\Db\Query())->from('vtiger_crmentityrel')->where(['crmid' => $leadId])
->createCommand()->query();
Method createUserPrivilegesFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function createUserPrivilegesFile($userId)
{
$file = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges' . \DIRECTORY_SEPARATOR . "user_privileges_$userId.php";
$user = [];
$userInstance = \CRMEntity::getInstance('Users');