Showing 4,652 of 306,333 total issues
File Record.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. 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
File Module.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. 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
Function registerWarningsAlert
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerWarningsAlert: function () {
const alertsContainer = $('#systemWarningAletrs');
if (alertsContainer.length) {
app.showModalWindow(alertsContainer, function () {
alertsContainer.find('.warning').first().removeClass('d-none');
Function registerSplit
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSplit: function (container) {
var rightSplitMaxWidth = (400 / this.windowW) * 100;
var splitMinWidth = (25 / this.windowW) * 100;
var splitMaxWidth = 100 - splitMinWidth;
var listPreview = container.find('.js-detail-preview');
Function showConfirmModal
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
showConfirmModal: function (params) {
let confirmButtonLabel = 'JS_OK';
let rejectedButtonLabel = 'JS_CANCEL';
if (typeof params.confirmButtonLabel !== 'undefined') {
confirmButtonLabel = params.confirmButtonLabel;
Method afterLogin
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function afterLogin(App\Request $request): void
{
\App\Controller\Headers::generateCspToken();
if (\Config\Security::$loginSessionRegenerate) {
\App\Session::regenerateId(true); // to overcome session id reuse.
Method showEmailsList
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showEmailsList($srecord, $smodule, $config, $type, $filter = 'All')
{
if ('All' === $filter || 'Contacts' === $filter) {
$relatedId = (new \App\Db\Query())->select(['vtiger_contactdetails.contactid'])->from('vtiger_contactdetails')
->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')
Function changeWatching
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
changeWatching: function (instance) {
let value, module, state, className, user, record;
if (instance != undefined) {
instance = $(instance);
value = instance.data('value');
- 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 mergeOptionsObject
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
mergeOptionsObject: function mergeOptionsObject(to, from) {
if (typeof to === 'undefined') {
to = {};
}
for (let key in from) {
- 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 parseOptionsObject
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
parseOptionsObject: function parseOptionsObject(options, original, afterInit = false) {
let result = {};
for (let propertyName in options) {
let value = options[propertyName];
if (afterInit) {
- 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 selectCallbackCreateModal
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
selectCallbackCreateModal(modal, info) {
let startDate = info.start,
endDate = info.end;
if (info['allDay']) {
endDate.setDate(endDate.getDate() - 1);
- 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 showModalWindow
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
showModalWindow: function (data, url, cb, paramsObject = {}) {
if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
return false;
}
const thisInstance = this;
- 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 createFiles
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function createFiles(Field $entityField)
{
$targetpath = 'modules/' . $this->name;
if (!is_file($targetpath)) {
- 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 getModuleConverters
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
{
$converters = [];
if (null === $userId) {
$userId = \App\User::getCurrentUserId();
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
$html = '';
$moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
$pdf = $this->textParser->getParam('pdf');
- 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 htmlTruncate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function htmlTruncate(string $html, int $length = 255, string $ending = '...'): string
{
if (\strlen($html) <= $length) {
return $html;
}
- 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 createTimeZone
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function createTimeZone($tzid, $from = 0, $to = 0)
{
if (!$from) {
$from = time();
}
- 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 findRecordByEmail
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function findRecordByEmail($value, array $allowedModules = [], array $skipModules = [])
{
$db = \App\Db::getInstance();
$rows = $fields = [];
$dataReader = (new \App\Db\Query())->select(['vtiger_field.columnname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_field.tabid', 'vtiger_tab.name'])
- 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 getMissingSystemFields
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getMissingSystemFields(): array
{
$fields = $this->getFields();
$systemFields = \App\Field::SYSTEM_FIELDS;
$missingFields = [];
- 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 getCRMConversionRate
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getCRMConversionRate($from, $to, $date = '')
{
$mainCurrencyCode = \App\Fields\Currency::getDefault()['currency_code'];
$activeBankId = self::getActiveBankId();
$exchange = false;
- 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"