Showing 4,652 of 306,333 total issues
Function validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validate: function () {
var response = this._super();
if (response != true) {
return response;
} 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 registerChangeEvents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerChangeEvents: function (container) {
container.find('.js-status-change').on('click', function () {
let elements = $(this).closest('tr').find('.js-visibility');
if (elements.length) {
if (this.checked) {
- 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 registerEnableFilterOption
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerEnableFilterOption: function () {
jQuery('[name="conditionstype"]').on('change', function (e) {
var advanceFilterContainer = jQuery('#advanceFilterContainer');
var currentRadioButtonElement = jQuery(e.currentTarget);
if (currentRadioButtonElement.hasClass('recreate')) {
- 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 getUi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getUi: function () {
var html = '<select class="select2" data-value="value" name="' + this.getName() + '">';
var pickListValues = this.getPickListValues();
var selectedOption = this.getValue();
for (var optGroup in pickListValues) {
- 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 registerChangeVal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerChangeVal: function (content) {
content.find('.configField').on('change', function (e) {
var target = $(e.currentTarget);
var val;
if (target.attr('type') === 'checkbox') {
- 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 addComment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addComment: function (currentTarget, data) {
const self = this;
let mode = currentTarget.data('mode'),
closestAddCommentBlock = currentTarget.closest('.js-add-comment-block'),
commentTextAreaElement = closestAddCommentBlock.find('.js-comment-content'),
- 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 registerInviteEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerInviteEvent: function (editViewForm) {
this.registerRow(editViewForm);
let participantsContent = editViewForm.find('.js-participants-content');
let participantsSearch = editViewForm.find('.js-participants-search');
$.widget('custom.ivAutocomplete', $.ui.autocomplete, {
- 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 submitSearchForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
submitSearchForm(detailContentsHolder) {
let searchTextDom = detailContentsHolder.find('.js-comment-search'),
widgetContainer = searchTextDom.closest('[data-name="ModComments"]'),
progressIndicatorElement = $.progressIndicator();
if (searchTextDom.data('container') === 'widget' && !searchTextDom.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 showCalendarPopoverLinkInSidebar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
showCalendarPopoverLinkInSidebar(e) {
let href = e.currentTarget.href;
const hrefObject = app.convertUrlToObject(href);
if (hrefObject.module !== 'Calendar' || (hrefObject.view !== 'Edit' && hrefObject.view !== 'Detail')) {
return true;
- 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 executeFunctions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
executeFunctions: function (instance) {
if (instance.execute) {
let func = instance.execute;
for (let i in func) {
let funcName = func[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 checkVisibilityBlocks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
checkVisibilityBlocks: function () {
this.getForm()
.find('.js-toggle-panel')
.each(function (index, block) {
let currentBlock = $(block);
- 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 registerKeyboardShortcutsEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerKeyboardShortcutsEvent: function (container) {
document.addEventListener('keydown', (event) => {
if (event.shiftKey && event.ctrlKey && event.code === 'KeyD') {
container.find('.js-duplicate-btn').trigger('click');
}
- 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 sendMailWindow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
sendMailWindow: function (url, popup, postData) {
if (popup) {
let width = screen.width - 15;
let height = screen.height - 150;
let left = 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 getUi
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getUi: function () {
var html = '<select class="select2" name="' + this.getName() + '">';
var pickListValues = this.getPickListValues();
var selectedOption = this.getValue();
for (var optGroup in pickListValues) {
- 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 saveAjax
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
saveAjax: function (params, progressIndicator = false) {
const aDeferred = $.Deferred();
if (typeof params === 'undefined' || $.isEmptyObject(params)) {
aDeferred.reject();
return aDeferred.promise();
- 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 readSelectedIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
readSelectedIds: function (decode) {
let cvId = this.getCurrentCvId();
let selectedIdsElement = $('#selectedIds');
if (selectedIdsElement.length <= 0) {
return '';
- 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 registerReminders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerReminders: function () {
let activityReminder = (parseInt(app.getMainParams('activityReminder')) || 0) * 1000;
if (activityReminder != 0 && $('.remindersNotice.autoRefreshing').length) {
Vtiger_Index_Js.requestReminder();
window.reminder = setInterval(function () {
- 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 registerAutoCompleteFields
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
registerAutoCompleteFields: function (container) {
let thisInstance = this;
let formElement = container.closest('form');
container.find('input.autoComplete').autocomplete({
delay: '600',
- 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 loadWidget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadWidget: function (widgetContainer) {
const self = this;
let urlParams = widgetContainer.data('url');
let mode = widgetContainer.data('mode');
let moduleName = app.getModuleName();
- 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 loadCalendarData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loadCalendarData: function () {
this.fullCalendar.removeAllEvents();
const start_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeStart),
end_date = App.Fields.Date.dateToUserFormat(this.fullCalendar.view.activeEnd),
parent = this.getContainer();
- 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"