YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

<?php
/**
 * Duplicate IGDN handler.
 *
 * @package Handler
Severity: Major
Found in modules/IGDNC/handlers/IgdnExist.php and 1 other location - About 1 day to fix
modules/IGRNC/handlers/IgrnExist.php on lines 1..45

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

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

<?php
/**
 * Duplicate IGRN handler.
 *
 * @package Handler
Severity: Major
Found in modules/IGRNC/handlers/IgrnExist.php and 1 other location - About 1 day to fix
modules/IGDNC/handlers/IgdnExist.php on lines 1..45

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

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

ConfReport has 57 functions (exceeds 20 allowed). Consider refactoring.
Open

class ConfReport
{
    /** @var string System URL. */
    private static $crmUrl;

Severity: Major
Found in app/Utils/ConfReport.php - About 1 day to fix

    Method getFieldDataType has 204 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getFieldDataType()
        {
            if (!isset($this->fieldDataType)) {
                $uiType = $this->getUIType();
                if (55 === $uiType) {
    Severity: Major
    Found in modules/Vtiger/models/Field.php - About 1 day to fix

      Function validate has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function validate(string $type)
          {
              $main = static::parse($type);
              $cron = static::getCronVariables($type);
              foreach (static::${$type} as $key => &$item) {
      Severity: Minor
      Found in app/Utils/ConfReport.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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

          registerSwitchEvents() {
              if (app.getMainParams('hiddenDays', true) !== false) {
                  this.switchContainer.html(this.createSwitch());
                  this.switchContainer.find('input').on('change', (e) => {
                      const currentTarget = $(e.currentTarget);
      public_html/layouts/basic/modules/Calendar/resources/CalendarQuickCreate.js on lines 58..74
      public_html/layouts/basic/modules/Occurrences/resources/QuickCreate.js on lines 48..64
      public_html/layouts/basic/modules/Reservations/resources/QuickCreate.js on lines 48..64

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

          registerSwitchEvents() {
              if (app.getMainParams('hiddenDays', true) !== false) {
                  this.switchContainer.html(this.createSwitch());
                  this.switchContainer.find('input').on('change', (e) => {
                      const currentTarget = $(e.currentTarget);
      public_html/layouts/basic/modules/OSSTimeControl/resources/QuickCreate.js on lines 48..64
      public_html/layouts/basic/modules/Occurrences/resources/QuickCreate.js on lines 48..64
      public_html/layouts/basic/modules/Reservations/resources/QuickCreate.js on lines 48..64

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

          registerSwitchEvents() {
              if (app.getMainParams('hiddenDays', true) !== false) {
                  this.switchContainer.html(this.createSwitch());
                  this.switchContainer.find('input').on('change', (e) => {
                      const currentTarget = $(e.currentTarget);
      public_html/layouts/basic/modules/Calendar/resources/CalendarQuickCreate.js on lines 58..74
      public_html/layouts/basic/modules/OSSTimeControl/resources/QuickCreate.js on lines 48..64
      public_html/layouts/basic/modules/Reservations/resources/QuickCreate.js on lines 48..64

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

          registerSwitchEvents() {
              if (app.getMainParams('hiddenDays', true) !== false) {
                  this.switchContainer.html(this.createSwitch());
                  this.switchContainer.find('input').on('change', (e) => {
                      const currentTarget = $(e.currentTarget);
      public_html/layouts/basic/modules/Calendar/resources/CalendarQuickCreate.js on lines 58..74
      public_html/layouts/basic/modules/OSSTimeControl/resources/QuickCreate.js on lines 48..64
      public_html/layouts/basic/modules/Occurrences/resources/QuickCreate.js on lines 48..64

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

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

              registerEvents: function () {
                  const thisIstance = this,
                      container = jQuery('.contentsDiv');
                  thisIstance.registerColorField($('#exceptions select'));
                  thisIstance.registerEditFolders(container);

        File Header.js has 501 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: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Header.js - About 1 day to fix

          File has 56 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class File
          {
              /** @var string Temporary table name. */
              public const TABLE_NAME_TEMP = 'u_#__file_upload_temp';
          
          
          Severity: Major
          Found in app/Fields/File.php - About 1 day to fix

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

                                        if (
                                            !tmp2.state.loaded &&
                                            tmp2.original &&
                                            tmp2.original.state &&
                                            tmp2.original.state.undetermined &&
            Severity: Major
            Found in public_html/layouts/resources/libraries/jstree.checkbox.js and 1 other location - About 7 hrs to fix
            public_html/layouts/resources/libraries/jstree.checkbox.js on lines 459..475

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

            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 (
                                        tmp.original &&
                                        tmp.original.state &&
                                        tmp.original.state.undetermined &&
                                        tmp.original.state.undetermined === true
            Severity: Major
            Found in public_html/layouts/resources/libraries/jstree.checkbox.js and 1 other location - About 7 hrs to fix
            public_html/layouts/resources/libraries/jstree.checkbox.js on lines 479..496

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

            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 process has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public function process()
                {
                    $html = '';
                    if (!$this->textParser->recordModel->getModule()->isInventory()) {
                        return $html;
            Severity: Minor
            Found in app/TextParser/ProductsTableCorrectingBefore.php - About 7 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 doTask has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public function doTask($recordModel)
                {
                    if (!\App\Module::isModuleActive('Calendar')) {
                        return;
                    }
            Severity: Minor
            Found in modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php - About 7 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 getStructure has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getStructure()
                {
                    if (!empty($this->structuredValues)) {
                        return $this->structuredValues;
                    }
            Severity: Minor
            Found in modules/Calendar/models/EditRecordStructure.php - About 7 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 read has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public function read()
                {
                    $this->createTable();
                    $fieldMapping = $this->request->get('field_mapping');
                    $inventoryFieldMapping = $this->request->get('inventory_field_mapping');
            Severity: Minor
            Found in modules/Import/readers/CSVReader.php - About 7 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 getConditions has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getConditions(\App\Db\Query $query, string $moduleName, $user = false, $relatedRecord = null)
                {
                    if (!($user && $user instanceof \App\User)) {
                        $user = \App\User::getCurrentUserModel();
                    }
            Severity: Minor
            Found in api/webservice/WebservicePremium/PrivilegeQuery.php - About 7 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 VTJsonCondition.php has 494 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
             * The Original Code is:  vtiger CRM Open Source
            Severity: Minor
            Found in modules/com_vtiger_workflow/VTJsonCondition.php - About 7 hrs to fix
              Severity
              Category
              Status
              Source
              Language