YetiForceCompany/YetiForceCRM

View on GitHub

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 {

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) {

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')) {
Severity: Minor
Found in public_html/layouts/basic/modules/Settings/Workflows/resources/Edit2.js - About 25 mins to fix

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) {

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') {

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'),
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 mins to fix

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, {
Severity: Minor
Found in public_html/layouts/basic/modules/Calendar/resources/Edit.js - About 25 mins to fix

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()) {
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 mins to fix

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;
Severity: Minor
Found in public_html/layouts/basic/modules/Calendar/resources/CalendarView.js - About 25 mins to fix

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];
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/ListSearch.js - About 25 mins to fix

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);
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 25 mins to fix

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');
                }
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 25 mins to fix

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;
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Vtiger.js - About 25 mins to fix

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) {
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js - About 25 mins to fix

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();
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 25 mins to fix

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 '';
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/List.js - About 25 mins to fix

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 () {
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Vtiger.js - About 25 mins to fix

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',
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 25 mins to fix

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();
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/DashBoard.js - About 25 mins to fix

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();
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language