YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getUi has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        getUi: function () {
            let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
                dateSpecificConditions = this.get('dateSpecificConditions'),
                html,
                element;
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js - About 55 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 inactiveFieldsValidation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        inactiveFieldsValidation: function () {
            let editFieldList = this.container.find('.js-edit-field-list').data('value');
            let form = this.container.find('form');
            for (let fieldName in editFieldList) {
                let fieldInfo = editFieldList[fieldName];
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/ChangesJsonModal.js - About 55 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 registerPopUpSaveEvent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        registerPopUpSaveEvent: function (data, fieldUiHolder) {
            jQuery('[name="saveButton"]', data).on('click', function (e) {
                var valueType = jQuery('.textType', data).val();

                fieldUiHolder.find('[name="valuetype"]').val(valueType);
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js - About 55 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 getInstanceByModuleName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        getInstanceByModuleName: function (moduleName) {
            if (typeof moduleName === 'undefined') {
                moduleName = app.getModuleName();
            }
            let parentModule = app.getParentModuleName(),
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 55 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 massUpdatePagination has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        massUpdatePagination(urlParams = []) {
            const self = this,
                listViewPageDiv = this.getListViewContainer();
            let paginationObject = listViewPageDiv.find('.js-pagination-list'),
                totalCount = paginationObject.data('totalCount'),
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/List.js - About 55 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 refreshWidget has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        refreshWidget: function refreshWidget() {
            let thisInstance = this;
            let parent = this.getContainer();
            let element = parent.find('.js-widget-refresh');
            let url = element.data('url');
Severity: Minor
Found in public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js - About 55 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 setBrowserHistoryOptions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    setBrowserHistoryOptions() {
        const historyParams = app.getMainParams('historyParams', true);
        let options = {};
        if (historyParams && (historyParams.length || Object.keys(historyParams).length)) {
            let s = App.Fields.Date.getDateInstance(historyParams.start);
Severity: Minor
Found in public_html/layouts/resources/Calendar.js - About 55 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 register has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        register(parentElement, registerForAddon, customParams, className = 'dateField') {
            if (typeof parentElement === 'undefined') {
                parentElement = $('body');
            } else {
                parentElement = $(parentElement);
Severity: Minor
Found in public_html/layouts/resources/Fields.js - About 55 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 registerDetailView has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        registerDetailView: function (container) {
            this.container = container;
            var coordinates = container.find('#coordinates').val();
            coordinates = JSON.parse(coordinates);
            var startCoordinate = [0, 0];
Severity: Minor
Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function () {
            let response = this._super();
            if (response === true) {
                let fieldValue = this.getFieldValue();
                let doubleRegex = /(^[-+]?\d+)(\.\d+)?$/;
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 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 exportCustomViews has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportCustomViews(ModuleBasic $moduleInstance)
    {
        $customViewDataReader = (new \App\Db\Query())->from('vtiger_customview')->where(['entitytype' => $moduleInstance->name])
            ->createCommand()->query();
        if (!$customViewDataReader->count()) {
Severity: Minor
Found in vtlib/Vtiger/PackageExport.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

        validate: function () {
            let fieldValue = this.getFieldValue(),
                groupSeperator = CONFIG.currencyGroupingSeparator,
                integerRegex = new RegExp('(^[-+]?[\\d\\' + groupSeperator + ']+)$', 'g');
            if (!fieldValue.match(integerRegex)) {
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

        validate() {
            let fieldValue = this.getFieldValue();
            if (fieldValue === '') {
                return true;
            }
Severity: Minor
Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 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 invokeValidation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        invokeValidation: function (field, rules, k, options) {
            //If validation engine already maked the field as error
            // we dont want to proceed
            if (typeof options !== 'undefined') {
                if (options.isError === true) {
Severity: Minor
Found in public_html/layouts/resources/validator/BaseValidator.js - About 55 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 parseMigration has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseMigration($modulenode)
    {
        if (empty($this->_migrations)) {
            $this->_migrations = [];
            if (!empty($modulenode->migrations)
Severity: Minor
Found in vtlib/Vtiger/PackageUpdate.php - About 55 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 autoLoad has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function autoLoad($className)
    {
        $parts = explode('_', $className);
        $noOfParts = \count($parts);
        if ($noOfParts > 2) {
Severity: Minor
Found in include/Loader.php - About 55 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 check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function check(array $items, array $params): bool
    {
        $condition = $params['condition'] ?? '';
        $b = false;
        foreach ($params['rules'] as $rule) {
Severity: Minor
Found in app/Automatic/RulesPicklist.php - About 55 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 check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function check(array $items, array $params): bool
    {
        $condition = $params['condition'] ?? '';
        $returnVal = false;
        foreach ($params['rules'] as $rule) {
Severity: Minor
Found in app/Automatic/Rules.php - About 55 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 purifyHtml has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function purifyHtml(string $input, $loop = true): string
    {
        if (empty($input)) {
            return $input;
        }
Severity: Minor
Found in app/Purifier.php - About 55 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 deactivate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deactivate(string $moduleName, string $fieldName): bool
    {
        $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
            return false;
Severity: Minor
Found in app/RecordStatus.php - About 55 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