YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function setDefaultGlobalTax has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        setDefaultGlobalTax: function () {
            let thisInstance = this;
            let parentRow = thisInstance.getInventoryItemsContainer();
            let taxDefaultValue = thisInstance
                .getInventorySummaryTaxesContainer()
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 35 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 registerChangeDiscount has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        registerChangeDiscount: function () {
            this.form.on('click', '.js-change-discount', (e) => {
                let parentRow;
                const element = $(e.currentTarget);
                let params = {
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Inventory.js - About 35 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 findOption has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        findOption(selectElement, searchValue, type = 'value') {
            let foundOption = false;
            const selectValues = this.getSelectOptions(selectElement);
            const getFieldValueFromText = () => Object.keys(selectValues).find((key) => selectValues[key] === searchValue);
            const valueExists = () => selectValues.hasOwnProperty(searchValue);
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 35 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 registerUnlock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        registerUnlock: function (container) {
            let form = container.find('.js-filter-form');
            App.Fields.Date.registerRange(form);
            let table = $('#js-unlock-table');
            if (table.hasClass('dataTable')) {
Severity: Minor
Found in public_html/layouts/basic/components/InterestsConflict.js - About 35 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 registerConfirmations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        registerConfirmations: function (container) {
            let form = container.find('.js-filter-form');
            App.Fields.Date.registerRange(form);
            let table = $('#js-confirm-table');
            if (table.hasClass('dataTable')) {
Severity: Minor
Found in public_html/layouts/basic/components/InterestsConflict.js - About 35 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 init has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        init(customParams) {
            $('.input-group-text', this.container.closest('.dateTime')).on('click', function (e) {
                $(e.currentTarget).closest('.dateTime').find('input.dateTimePickerField').get(0).focus();
            });
            let dateFormat = CONFIG.dateFormat.toUpperCase();
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 35 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 filterFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        filterFiles(files) {
            let valid = [],
                error = [];
            if (files.length + this.files.length > this.options.limit) {
                error.push({ error: { text: `${app.vtranslate('JS_FILE_LIMIT')} [${this.options.limit}]` } });
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 35 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 __delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __delete()
    {
        Profile::deleteForField($this);
        $db = \App\Db::getInstance();
        $db->createCommand()->delete('vtiger_field', ['fieldid' => $this->id])->execute();
Severity: Minor
Found in vtlib/Vtiger/FieldBasic.php - About 35 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 constructor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    constructor(element) {
        const thisInstance = this;
        this.elements = {};
        this.options = {
            showCarousel: true
Severity: Minor
Found in public_html/layouts/resources/fields/MultiImage.js - About 35 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 setNewRooms has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    setNewRooms({ commit, getters }, roomList) {
        let newRooms = []
        for (let roomType in roomList) {
            for (let room in roomList[roomType]) {
                if (!getters.data.roomList[roomType][room]) {
Severity: Minor
Found in public_html/src/layouts/basic/modules/Chat/store/actions.js - About 35 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 validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function () {
            let response = this._super();
            if (response !== true) {
                return response;
            }
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 35 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 registerRecordActionsEvents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    registerRecordActionsEvents: function (container) {
        container.on('click', '.js-action-confirm', function (event) {
            event.stopPropagation();
            let target = $(this),
                sourceView = target.data('sourceView'),
Severity: Minor
Found in public_html/layouts/resources/app.js - About 35 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 setFilesHash has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    setFilesHash(files) {
        const addedFiles = [];
        for (let i = 0, len = files.length; i < len; i++) {
            const file = files[i];
            if (typeof file.hash === 'undefined') {
Severity: Minor
Found in public_html/layouts/resources/fields/MultiImage.js - About 35 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 validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        validate() {
            const fieldInstance = this.getElement();
            const selectElementValue = fieldInstance.val();
            if (Array.isArray(selectElementValue)) {
                for (let value of selectElementValue) {
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 35 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 updateRelatedLists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateRelatedLists($modulenode, $moduleInstance)
    {
        $moduleInstance->unsetAllRelatedList();
        if (!empty($modulenode->relatedlists) && !empty($modulenode->relatedlists->relatedlist)) {
            foreach ($modulenode->relatedlists->relatedlist as $relatedlistnode) {
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 35 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 importCustomView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function importCustomView($modulenode, $moduleInstance, $customviewnode)
    {
        $filterInstance = new Filter();
        $filterInstance->name = $customviewnode->viewname;
        $filterInstance->isdefault = $customviewnode->setdefault;
Severity: Minor
Found in vtlib/Vtiger/PackageImport.php - About 35 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 testDeleteNewField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function testDeleteNewField($type, $param, $suffix = '')
    {
        $key = $type . $suffix;
        $fieldInstance = \Settings_LayoutEditor_Field_Model::getInstance(self::$fieldsId[$key]);
        $uitype = $fieldInstance->getUIType();
Severity: Minor
Found in tests/Settings/ModuleManager.php - About 35 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 importRelatedLists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function importRelatedLists($modulenode, $moduleInstance)
    {
        if (!empty($modulenode->relatedlists) && !empty($modulenode->relatedlists->relatedlist)) {
            foreach ($modulenode->relatedlists->relatedlist as $relatedlistnode) {
                $this->importRelatedlist($modulenode, $moduleInstance, $relatedlistnode);
Severity: Minor
Found in vtlib/Vtiger/PackageImport.php - About 35 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 initUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function initUpdate($moduleInstance, $zipfile, $overwrite)
    {
        $module = $this->getModuleNameFromZip($zipfile);
        if (!$moduleInstance || $moduleInstance->name != $module) {
            \App\Log::trace('Module name mismatch!', __METHOD__);
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 35 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 recurseCopy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recurseCopy($src, $dest)
    {
        $rootDir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
        if (!file_exists($rootDir . $src)) {
            return 0;
Severity: Minor
Found in vtlib/Vtiger/Functions.php - About 35 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