Showing 4,652 of 306,333 total issues
Method getCVModelFromRequest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCVModelFromRequest(App\Request $request)
{
$cvId = $request->getInteger('record');
if (!empty($cvId)) {
$customViewModel = CustomView_Record_Model::getInstanceById($cvId);
Method getListViewDisplayValue
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
{
$values = \App\Fields\SharedOwner::getById($record);
if (empty($values)) {
return '';
Method getDisplayValue
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
{
$isAdmin = \App\User::getCurrentUserModel()->isAdmin();
if (empty($value)) {
return '';
Method getActivities
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getActivities(App\Request $request)
{
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
if (!$userPrivilegesModel->hasModulePermission('Calendar')) {
throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Method getQuery
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQuery(App\Request $request): App\Db\Query
{
$moduleName = $request->getModule();
$sourceModule = $request->getByType('sourceModule', 2);
if ($sourceModule) {
Method getParent
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
{
\App\Log::trace('Entering getParent(' . $id . ') method ...');
if ($depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
\App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Method read
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function read()
{
$defaultCharset = App\Config::main('default_charset');
$this->createTable();
Method process
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$moduleName = 'Home';
$page = $request->getInteger('page');
Method getTicketsByUser
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTicketsByUser($time)
{
$moduleName = 'HelpDesk';
$ticketStatus = Settings_SupportProcesses_Module_Model::getTicketStatusNotModify();
$listViewUrl = Vtiger_Module_Model::getInstance($moduleName)->getListViewUrl();
Function checkPrefix
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
checkPrefix() {
let sequenceExists = false;
const editViewForm = this.getForm();
const value = editViewForm.find('[name="reset_sequence"]').val();
const prefix = editViewForm.find('[name="prefix"]').val();
- 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 registerSplit
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
registerSplit: function (container) {
let rightSplitMaxWidth = (400 / this.windowW) * 100;
const splitSizes = this.getSplitSizes();
app.moduleCacheSet('gutterRelatedMidPosition', splitSizes);
let split = Split([this.list[0], this.preview[0]], {
- 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 setDefaultEndTime
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
setDefaultEndTime: function (container) {
const self = this;
if (container.find('.js-autofill').is(':checked')) {
self.getFreeTime(container);
} else {
- 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 pageJumpHandler
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
pageJumpHandler: function (e) {
let aDeferred = jQuery.Deferred();
let thisInstance = this;
if (e.which == 13) {
let element = jQuery(e.currentTarget);
- 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 mapAddressDetails
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
mapAddressDetails: function (result, container) {
for (let key in result) {
if (key.indexOf('addresslevel') != -1) {
if (container.find('[name="' + key + '"]').length != 0) {
container.find('[name="' + key + '"]').val(result['data'][key]);
- 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 calculateDiscount
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. 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,
- 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 convertOptionsToJSONArray
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
convertOptionsToJSONArray: function (objName, targetObjName) {
let obj = jQuery(objName);
let arr = [];
if (typeof obj !== 'undefined' && obj[0] != '') {
for (let i = 0; i < obj[0].length; ++i) {
- 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 loadFieldSpecificUi
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
loadFieldSpecificUi: function (fieldSelect) {
const selectedOption = fieldSelect.find('option:selected');
const row = fieldSelect.closest('div.js-conditions-row');
const fieldUiHolder = row.find('.fieldUiHolder');
const conditionSelectElement = row.find('select[name="comparator"]');
- 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 setCalendarBasicOptions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
setCalendarBasicOptions() {
let eventLimit = app.getMainParams('eventLimit'),
userView = app.getMainParams('activity_view'),
defaultView = app.moduleCacheGet('defaultView'),
userTimeFormat = CONFIG.hourFormat;
- 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 setMarkers
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
setMarkers: function (data) {
var thisInstance = this;
var markerArray = [];
var container = this.container;
var map = this.mapInstance;
- 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 playNotificationSound
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
playNotificationSound({ getters }, { roomList, firstFetch }) {
if (getters.isSoundNotification) {
let areNewMessagesForRoom = (roomType, room) => roomList[roomType][room].cnt_new_message > getters.data.roomList[roomType][room].cnt_new_message
if (firstFetch) {
areNewMessagesForRoom = (roomType, room) => roomList[roomType][room].cnt_new_message >= getters.data.roomList[roomType][room].cnt_new_message
- 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"