Showing 4,652 of 306,333 total issues
Function registerMailPreviewWidget
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
registerMailPreviewWidget: function (container) {
const self = this;
container.on('click', '.showMailBody', (e) => {
let row = $(e.currentTarget).closest('.js-mail-row'),
mailBody = row.find('.mailBody'),
Function calculateDiscount
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
calculateDiscount: function (_row, modal) {
const netPriceBeforeDiscount = App.Fields.Double.formatToDb(modal.find('.valueTotalPrice').text()),
discountsType = modal.find('.discountsType').val();
let valuePrices = netPriceBeforeDiscount,
globalDiscount = 0,
Method importInventory
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function importInventory()
{
if (1 !== $this->moduleInstance->type) {
return false;
}
Method createUserSharingPrivilegesfile
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function createUserSharingPrivilegesfile($userid)
{
\vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
require 'user_privileges/user_privileges_' . $userid . '.php';
$fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
Method loadJsConfig
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function loadJsConfig(\App\Request $request)
{
$jsEnv = [
'skinPath' => \Vtiger_Theme::getCurrentUserThemePath(),
'siteUrl' => \App\Layout::getPublicUrl('', true),
Method getConfirmResponse
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getConfirmResponse(\App\Request $request): array
{
$queries = [
'base' => $this->getConfirmQuery($request, 'u'),
];
Method createTimeZone
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createTimeZone($tzid, $from = 0, $to = 0)
{
if (!$from) {
$from = time();
}
Method process
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(App\Request $request)
{
$type = $request->getByType('type', 1);
$range = $request->getByType('range', 'DateRangeUserFormat');
if (!isset(App\Log::$owaspColumnMapping[$type])) {
File Module.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Automatic assignment module model class.
*
Method getSearchComments
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getSearchComments(int $parentId, $moduleName, string $searchValue, bool $isWidget, array $hierarchy = [], Vtiger_Paging_Model $pagingModel = null)
{
$fields = array_merge(array_keys(\App\Field::getModuleFieldInfosByPresence('ModComments')), ['id']);
$queryGenerator = new \App\QueryGenerator('ModComments');
$queryGenerator->setFields($fields);
Method setRelatedParent
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setRelatedParent(App\Request $request)
{
$filterFields = $request->getArray('filterFields', 'Text');
if (!($relationId = $request->isEmpty('relationId') ? 0 : $request->getInteger('relationId')) && $this->sourceField) {
$relationId = \App\Relation::getRelationId($this->moduleName, $this->sourceModule, $this->sourceField);
Method process
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(App\Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = 'Home';
$page = $request->getInteger('page');
File Reference.php
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/* +***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
Function checkReferencesField
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkReferencesField: function (container, clear) {
let thisInstance = this;
let activeProcess = false,
activeSubProcess = false;
if (!CONFIG.fieldsReferencesDependent) {
Function copyAddress
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
copyAddress: function (fromLabel, toLabel, relatedRecord, sourceModule) {
const thisInstance = this;
let formElement = this.getForm(),
status = false,
addressMapping = this.addressFieldsMapping,
Function zoomPreview
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
zoomPreview(hash) {
const self = this;
let fileInfo = this.getFileInfo(hash);
const titleTemplate = () => {
const titleObject = document.createElement('span');
Method getRelatedVariable
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getRelatedVariable($fieldType = false, $skipEmpty = false)
{
$cacheKey = "{$this->moduleName}|$fieldType|{$skipEmpty}";
if (isset(static::$relatedVariable[$cacheKey])) {
return static::$relatedVariable[$cacheKey];
Method getQueryInitUsers
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getQueryInitUsers($private = false, $status = false, $roles = false)
{
$entityData = \App\Module::getEntityInfo('Users');
$selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
// Including deleted vtiger_users for now.
Method import
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function import(): bool
{
$allChecked = false;
try {
if ($orders = $this->getOrdersFromApi()) {
Method activate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function activate(): bool
{
$importer = new \App\Db\Importers\Base();
$db = \App\Db::getInstance();
if (!$db->isTableExists(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)) {