Showing 4,652 of 306,333 total issues
Function validate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validate: function () {
var field = this.getElement();
var fieldData = field.data();
var fieldDateFormat = fieldData.dateFormat;
var fieldInfo = fieldData.fieldinfo;
Function modalView
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static modalView(params = {}) {
var aDeferred = $.Deferred();
let url = 'index.php?module=AppComponents&view=MediaModal';
if (params && Object.keys(params).length) {
url = app.convertObjectToUrl(params, url);
Function setPopoverPosition
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setPopoverPosition(popoverElement, container = $(window)) {
let popover = this.getBindedPopover(popoverElement);
if (!popover.length) {
return;
}
Function serializeFormData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.serializeFormData = function () {
for (let instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
}
const form = this,
Method getContextMessage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getContextMessage()
{
if (ROOT_DIRECTORY !== getcwd()) {
chdir(ROOT_DIRECTORY);
}
Method getDefaultCvId
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getDefaultCvId()
{
$cacheName = $this->moduleName . $this->user->getId();
if (Cache::has('GetDefaultCvId', $cacheName)) {
return Cache::get('GetDefaultCvId', $cacheName);
Method getParent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getParent(int $record, string $moduleName): ?array
{
if (0 === \App\ModuleHierarchy::getModuleLevel($moduleName)) {
return ['id' => $record, 'moduleName' => $moduleName];
}
Method parseConditions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function parseConditions(?array $conditions): array
{
if (empty($conditions)) {
return [];
}
Method checkCondition
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function checkCondition(array $rule, \Vtiger_Record_Model $recordModel): bool
{
[$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
if ($sourceFieldName) {
if ($recordModel->isEmpty($sourceFieldName)) {
Method getQueryRelatedField
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getQueryRelatedField($relatedInfo, ?\Vtiger_Field_Model $field = null)
{
if (!\is_array($relatedInfo)) {
[$fieldName, $relatedModule, $sourceFieldName] = array_pad(explode(':', $relatedInfo), 3, false);
$relatedInfo = [
Method getRecordNumberFromString
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getRecordNumberFromString(string $value, string $moduleName, bool $multi = false)
{
$moduleData = \App\Fields\RecordNumber::getInstance($moduleName);
$prefix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('prefix'), '/'));
$postfix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('postfix'), '/'));
Method getLibraryValues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getLibraryValues($name, $dir): array
{
$library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
$existJsonFiles = true;
foreach (self::$jsonFiles as $file) {
Method process
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function process(): string
{
$html = '';
$moduleName = 'Calendar';
if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
Method getConfirmQuery
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
{
$table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
$columns = [];
foreach ($request->getArray('columns') as $key => $value) {
Method fromArray
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function fromArray(array $data)
{
$name = $data['name'] ?? '';
$self = new static($name);
$self->label = \App\Purifier::purifyByType($data['label'] ?? '', \App\Purifier::TEXT);
Method getHtmlLink
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getHtmlLink(int $id, ?string $moduleName = null, ?int $length = null, bool $fullUrl = false): string
{
$state = self::getState($id);
if (null === $state) {
return '<i class="color-red-500" title="' . $id . '">' . Language::translate('LBL_RECORD_DOES_NOT_EXIST') . '</i>';
Method parseBusinessHoursToDays
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function parseBusinessHoursToDays(array $rows): array
{
$days = $holidays = [];
foreach ($rows as $row) {
foreach (explode(',', $row['working_days']) as $day) {
Method transferOwnership
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function transferOwnership($oldId, $newId)
{
$db = \App\Db::getInstance();
//Updating the smcreatorid,smownerid, modifiedby, smcreatorid in vtiger_crmentity
$db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
Method validate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate(?string $type = null): bool
{
$return = true;
try {
if ($type && $this->getShortMimeType(0) !== $type) {
Method init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function init()
{
$targets = [];
if (\App\Config::debug('LOG_TO_FILE')) {
$levels = \App\Config::debug('LOG_LEVELS');