YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                case 'Y':
                    if (
                        prefix.indexOf('{{YY}}') === -1 &&
                        prefix.indexOf('{{YYYY}}') === -1 &&
                        postfix.indexOf('{{YY}}') === -1 &&
public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 202..218
public_html/layouts/basic/modules/Settings/RecordNumbering/resources/Index.js on lines 219..235

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                app.showConfirmModal({
                    title: app.vtranslate('JS_DELETE_CONFIRMATION'),
                    confirmedCallback: () => {
                        let progress = jQuery.progressIndicator();
                        AppConnector.request({
public_html/layouts/basic/modules/Settings/WebserviceApps/resources/WebserviceApps.js on lines 29..43

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                app.showConfirmModal({
                    title: app.vtranslate('JS_DELETE_CONFIRMATION'),
                    confirmedCallback: () => {
                        let progress = jQuery.progressIndicator();
                        AppConnector.request({
public_html/layouts/basic/modules/Settings/Notifications/resources/Notifications.js on lines 82..96

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 144.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function loadJoin has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadJoin()
    {
        $tableJoin = [];
        $moduleTableIndexList = $this->entityModel->tab_name_index;
        $baseTable = $this->entityModel->table_name;
Severity: Minor
Found in app/QueryGenerator.php - About 5 hrs 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 get has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $limit = 100;
        $relationModuleName = $this->controller->request->getByType('param', 'Alnum');
        $relationId = false;
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RecordRelatedList.php - About 5 hrs 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

File CustomView.js has 391 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*+***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
Severity: Minor
Found in public_html/layouts/basic/modules/CustomView/resources/CustomView.js - About 5 hrs to fix

    Function registerSummaryViewContainerEvents has 134 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerSummaryViewContainerEvents: function (summaryViewContainer) {
                let thisInstance = this;
                this.registerEventForActivityWidget();
                this.registerChangeFilterForWidget();
                this.registerAddingInventoryRecords();
    Severity: Major
    Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 5 hrs to fix

      Method getFieldInstanceByName has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getFieldInstanceByName($name)
          {
              $moduleName = $this->getName(true);
              $params = ['uitype' => 7, 'column' => $name, 'name' => $name,  'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main'];
              switch ($name) {
      Severity: Major
      Found in modules/Settings/ConfigEditor/models/Module.php - About 5 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (!empty($tag[1])) {
                        if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $tag[1])) {
                            // if tag is a closing tag
                        } elseif (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $tag[1], $tagName)) {
                            $pos = array_search(strtolower($tagName[1]), $openTags);
        Severity: Major
        Found in app/TextUtils.php and 1 other location - About 5 hrs to fix
        app/TextUtils.php on lines 90..103

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 190.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (!empty($tag[1])) {
                        if (preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $tag[1])) {
                            // if tag is a closing tag
                        } elseif (preg_match('/^<\s*\/([^\s]+?)\s*>$/s', $tag[1], $tagName)) {
                            $pos = array_search(strtolower($tagName[1]), $openTags);
        Severity: Major
        Found in app/TextUtils.php and 1 other location - About 5 hrs to fix
        app/TextUtils.php on lines 143..156

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 190.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                getAccountHierarchyResponseData: function (params) {
                    var thisInstance = this;
                    var aDeferred = jQuery.Deferred();
        
                    //Check in the cache
        public_html/layouts/basic/modules/IStorages/resources/Detail.js on lines 13..28
        public_html/layouts/basic/modules/MultiCompany/resources/Detail.js on lines 13..28

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                getHierarchyResponseData: function (params) {
                    var thisInstance = this;
                    var aDeferred = jQuery.Deferred();
        
                    //Check in the cache
        public_html/layouts/basic/modules/Accounts/resources/Detail.js on lines 21..36
        public_html/layouts/basic/modules/IStorages/resources/Detail.js on lines 13..28

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                getHierarchyResponseData: function (params) {
                    var thisInstance = this;
                    var aDeferred = jQuery.Deferred();
        
                    //Check in the cache
        public_html/layouts/basic/modules/Accounts/resources/Detail.js on lines 21..36
        public_html/layouts/basic/modules/MultiCompany/resources/Detail.js on lines 13..28

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        $.each(data, function (id, value) {
                            if (value.a > 0) {
                                listViewContentDiv
                                    .find('tr[data-id="' + id + '"] .unreviewed .badge.all')
                                    .text(value.a)
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/List.js and 1 other location - About 5 hrs to fix
        public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js on lines 777..792

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                        $.each(data, function (id, value) {
                            if (value.a > 0) {
                                relatedContent
                                    .find('tr[data-id="' + id + '"] .unreviewed .badge.all')
                                    .text(value.a)
        public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1838..1853

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Method process has 132 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function process(App\Request $request)
            {
                if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                    header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
                }
        Severity: Major
        Found in include/main/WebUI.php - About 5 hrs to fix

          Method getFieldInstanceByName has 132 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getFieldInstanceByName($name)
              {
                  $params = [];
                  $qualifiedModuleName = 'Settings:Picklist';
                  $tableName = $this->getTableName();
          Severity: Major
          Found in app/Fields/Picklist/Item.php - About 5 hrs to fix

            Function exportRelatedLists has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

                public function exportRelatedLists(ModuleBasic $moduleInstance)
                {
                    if (!$moduleInstance->isentitytype) {
                        return;
                    }
            Severity: Minor
            Found in vtlib/Vtiger/PackageExport.php - About 5 hrs 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 purifyMultiDimensionArray has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

                private function purifyMultiDimensionArray($values, $template)
                {
                    if (\is_array($template)) {
                        foreach ($values as $firstKey => $value) {
                            if (\is_array($value)) {
            Severity: Minor
            Found in app/Request.php - About 5 hrs 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 getSender has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getSender(): array
                {
                    if (isset($this->senderCache)) {
                        return $this->senderCache;
                    }
            Severity: Minor
            Found in app/Mail/Rbl.php - About 5 hrs 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