YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

    public function getHierarchy($id, $getRawData = false, $getLinks = true)
    {
        $listviewHeader = [];
        $listviewEntries = [];
        $listColumns = App\Config::module('Competition', 'COLUMNS_IN_HIERARCHY');
Severity: Major
Found in modules/Competition/Competition.php and 2 other locations - About 1 day to fix
modules/Contacts/Contacts.php on lines 100..123
modules/MultiCompany/MultiCompany.php on lines 79..101

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 270.

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

    public function getHierarchy($id, $getRawData = false, $getLinks = true)
    {
        $listviewHeader = [];
        $listviewEntries = [];
        $listColumns = App\Config::module('MultiCompany', 'COLUMNS_IN_HIERARCHY');
Severity: Major
Found in modules/MultiCompany/MultiCompany.php and 2 other locations - About 1 day to fix
modules/Competition/Competition.php on lines 186..208
modules/Contacts/Contacts.php on lines 100..123

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 270.

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

Chat has 63 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Chat
{
    /**
     * Information about allowed types of rooms.
     */
Severity: Major
Found in app/Chat.php - About 1 day to fix

    Function isPermitted has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function isPermitted(string $moduleName, $actionName = null, $record = false, $userId = false)
        {
            if (!$userId) {
                $user = \App\User::getCurrentUserModel();
            } else {
    Severity: Minor
    Found in api/webservice/WebservicePremium/Privilege.php - About 1 day 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

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

                jQuery('[name="currency_grouping_separator"]', form).on('change', function (e) {
                    let element = jQuery(e.currentTarget);
                    let selectedValue = element.val();
                    let decimalSeparatorValue = jQuery('[name="currency_decimal_separator"]', form).data('selectedValue');
                    if (decimalSeparatorValue == selectedValue) {
    Severity: Major
    Found in public_html/layouts/basic/modules/Users/resources/Edit.js and 1 other location - About 1 day to fix
    public_html/layouts/basic/modules/Users/resources/Edit.js on lines 20..38

    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 216.

    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

                jQuery('[name="currency_decimal_separator"]', form).on('change', function (e) {
                    let element = jQuery(e.currentTarget);
                    let selectedValue = element.val();
                    let groupingSeparatorValue = jQuery('[name="currency_grouping_separator"]', form).data('selectedValue');
                    if (groupingSeparatorValue == selectedValue) {
    Severity: Major
    Found in public_html/layouts/basic/modules/Users/resources/Edit.js and 1 other location - About 1 day to fix
    public_html/layouts/basic/modules/Users/resources/Edit.js on lines 39..57

    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 216.

    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

    File RelationListView.php has 543 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
     /* +***********************************************************************************
     * 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
    Severity: Major
    Found in modules/Vtiger/models/RelationListView.php - About 1 day to fix

      `` has 62 functions (exceeds 20 allowed). Consider refactoring.
      Open

          {
              container: false,
              plotContainer: false,
              chartInstance: false,
              chartData: [],

        Vtiger_ChartFilter_Model has 62 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Vtiger_ChartFilter_Model extends \App\Base
        {
            /**
             * Widget model.
             *
        Severity: Major
        Found in modules/Vtiger/models/ChartFilter.php - About 1 day to fix

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

                  getTextFromUrl(url) {
                      const aDeferred = $.Deferred();
                      let progressIndicatorElement = $.progressIndicator({ blockInfo: { enabled: true } });
                      AppConnector.request(url)
                          .done((response) => {
          Severity: Major
          Found in public_html/layouts/resources/app.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/Fields.js on lines 3282..3303

          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 215.

          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

                  getResponse(params) {
                      const aDeferred = $.Deferred();
                      let progressIndicatorElement = $.progressIndicator({ blockInfo: { enabled: true } });
                      AppConnector.request(params)
                          .done((response) => {
          Severity: Major
          Found in public_html/layouts/resources/Fields.js and 1 other location - About 1 day to fix
          public_html/layouts/resources/app.js on lines 912..933

          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 215.

          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 ajaxEditHandling has 224 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  ajaxEditHandling: function (currentTdElement) {
                      const thisInstance = this;
                      let readRecord = $('.setReadRecord'),
                          detailViewValue = $('.value', currentTdElement),
                          editElement = $('.edit', currentTdElement),
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 day to fix

            File Record.php has 540 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * OSSMailScanner Record model class.
             *
            Severity: Major
            Found in modules/OSSMailScanner/models/Record.php - About 1 day to fix

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

                      foreach ($jsFileNames as $jsFileName) {
                          $cacheName = "{$jsFileName} | {$min}";
                          $instance = new \Vtiger_JsScript_Model();
                          if (\App\Cache::has('ConvertJsScripts', $cacheName)) {
                              $instanceData = \App\Cache::get('ConvertJsScripts', $cacheName);
              Severity: Major
              Found in app/Controller/View/Base.php and 1 other location - About 1 day to fix
              app/Controller/View/Base.php on lines 390..408

              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 265.

              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

                      foreach ($fileNames as $fileName) {
                          $cacheName = "{$fileName} | {$min}";
                          $instance = new \Vtiger_CssScript_Model();
                          if (\App\Cache::has('ConvertCssStyles', $cacheName)) {
                              $instanceData = \App\Cache::get('ConvertCssStyles', $cacheName);
              Severity: Major
              Found in app/Controller/View/Base.php and 1 other location - About 1 day to fix
              app/Controller/View/Base.php on lines 352..370

              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 265.

              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

              Vtiger_Owner_Field_Js(
                  'Workflows_Owner_Field_Js',
                  {},
                  {
                      getUi: function () {
              public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js on lines 734..761

              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 214.

              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

              Vtiger_Owner_Field_Js(
                  'AdvanceFilterEx_Owner_Field_Js',
                  {},
                  {
                      getUi: function () {
              public_html/layouts/basic/modules/Settings/Workflows/resources/AdvanceFilter.js on lines 553..580

              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 214.

              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

              File CalendarView.js has 539 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
              'use strict';
              
              /**
               * Class representing a standard calendar.
              Severity: Major
              Found in public_html/layouts/basic/modules/Vtiger/resources/CalendarView.js - About 1 day to fix

                Function process has a Cognitive Complexity of 57 (exceeds 5 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: Minor
                Found in include/main/WebUI.php - About 1 day 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 doTask has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function doTask($recordModel)
                    {
                        $moduleName = $recordModel->getModuleName();
                        $recordId = $recordModel->getId();
                        $entityType = $this->entity_type;
                Severity: Minor
                Found in modules/com_vtiger_workflow/tasks/VTCreateEntityTask.php - About 1 day 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