YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

            $.extend($.fn.dataTable.defaults, {
                language: {
                    sLengthMenu: app.vtranslate('JS_S_LENGTH_MENU'),
                    sZeroRecords: app.vtranslate('JS_NO_RESULTS_FOUND'),
                    sInfo: app.vtranslate('JS_S_INFO'),
public_html/layouts/basic/modules/Settings/Logs/resources/Index.js on lines 85..107
public_html/layouts/resources/app.js on lines 2172..2194

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

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 3 locations. Consider refactoring.
Open

        $.extend($.fn.dataTable.defaults, {
            language: {
                sLengthMenu: app.vtranslate('JS_S_LENGTH_MENU'),
                sZeroRecords: app.vtranslate('JS_NO_RESULTS_FOUND'),
                sInfo: app.vtranslate('JS_S_INFO'),
public_html/layouts/basic/modules/Vtiger/resources/TreeRecords.js on lines 63..85
public_html/layouts/resources/app.js on lines 2172..2194

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

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

    private static function getPluralized($count)
    {
        //Extract language code from locale with special cases
        if (0 === strcasecmp(static::getLanguage(), 'pt-BR')) {
            $lang = 'pt-BR';
Severity: Minor
Found in app/Language.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

QueryGenerator has 68 functions (exceeds 20 allowed). Consider refactoring.
Open

class QueryGenerator
{
    const STRING_TYPE = ['string', 'text', 'email', 'reference'];
    const NUMERIC_TYPE = ['integer', 'double', 'currency', 'currencyInventory'];
    const DATE_TYPE = ['date', 'datetime'];
Severity: Major
Found in app/QueryGenerator.php - About 1 day to fix

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

            deleteCustomField: function (fieldId) {
                var aDeferred = $.Deferred();
                var progressIndicatorElement = $.progressIndicator({
                    position: 'html',
                    blockInfo: {
    public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1475..1501

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

    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

            getRelModuleLayoutEditor: function (selectedModule) {
                var aDeferred = $.Deferred();
                var progressIndicatorElement = $.progressIndicator({
                    position: 'html',
                    blockInfo: {
    public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1344..1370

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

    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 MultiImage.js has 580 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 MultiImage {
        /**
    Severity: Major
    Found in public_html/layouts/resources/fields/MultiImage.js - About 1 day to fix

      Function process has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process()
          {
              $html = '';
              [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
              $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];
      Severity: Minor
      Found in app/TextParser/ProductsTableRelatedModule.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 process has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
      Open

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

          public function process(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $moduleName = $request->getModule();
              $qualifiedModuleName = $request->getModule(false);
      Severity: Minor
      Found in modules/Settings/Workflows/views/EditTask.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

                      barStacked: {
                          basic: {
                              maintainAspectRatio: false,
                              title: {
                                  display: false
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 829..893

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

      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

                      horizontalBarStacked: {
                          basic: {
                              maintainAspectRatio: false,
                              title: {
                                  display: false
      public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 701..765

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

      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 Data.php has 579 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: Major
      Found in modules/Import/actions/Data.php - About 1 day to fix

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

        <?php
        /**
         * OSSMail record model file.
         *
         * @package Model
        Severity: Major
        Found in modules/OSSMail/models/Record.php - About 1 day to fix

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

                  getModuleQuickCreateEditor: function (selectedModule) {
                      var aDeferred = jQuery.Deferred();
                      var progressIndicatorElement = jQuery.progressIndicator({
                          position: 'html',
                          blockInfo: {
          public_html/layouts/basic/modules/Settings/LayoutEditor/resources/LayoutEditor.js on lines 1449..1474

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

          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

                  inactiveFieldValidation: function (field) {
                      field.validationEngine('hide');
                      let form = field.closest('form');
                      let invalidFields = form.data('jqv').InvalidFields;
                      let fields = [field.get(0)];
          public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 875..894

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

          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

                  getModuleLayoutEditor: function (selectedModule) {
                      var aDeferred = $.Deferred();
                      var progressIndicatorElement = $.progressIndicator({
                          position: 'html',
                          blockInfo: {
          public_html/layouts/basic/modules/Settings/QuickCreateEditor/resources/QuickCreateEditor.js on lines 249..274

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

          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

                  inactiveFieldValidation: function (field) {
                      field.validationEngine('hide');
                      let form = field.closest('form');
                      let invalidFields = form.data('jqv').InvalidFields;
                      let fields = [field.get(0)];
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/List.js and 1 other location - About 1 day to fix
          public_html/layouts/basic/modules/Vtiger/resources/ChangesJsonModal.js on lines 44..63

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

          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 WidgetsManagement.js has 567 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';
          
          jQuery.Class(
              'Settings_WidgetsManagement_Js',

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

                public function validate($value, $isUserFormat = false)
                {
                    if (empty($value) || isset($this->validate["$value"])) {
                        return;
                    }
            Severity: Major
            Found in modules/Vtiger/uitypes/Double.php and 1 other location - About 1 day to fix
            modules/Vtiger/uitypes/Currency.php on lines 23..41

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

            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

            Severity
            Category
            Status
            Source
            Language