YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

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

                                                    if (typeof metaDataItem._xScale !== 'undefined') {
                                                        metaDataItem._view.x = metaDataItem._xScale.getPixelForValue(index, dataIndex);
                                                        metaDataItem._view.base = metaDataItem._xScale.getBasePixel();
                                                        metaDataItem._view.width =
                                                            (metaDataItem._xScale.width / dataset._meta[prop].data.length) *
public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 422..429

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

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

MultiImage has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

class MultiImage {
    /**
     * Create class instance
     *
     * @param {HTMLElement|jQuery} inputElement - input type file element inside component
Severity: Minor
Found in public_html/layouts/resources/fields/MultiImage.js - About 4 hrs to fix

    User has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class User
    {
        protected static $currentUserId;
        protected static $currentUserRealId = false;
        protected static $currentUserCache = false;
    Severity: Minor
    Found in app/User.php - About 4 hrs to fix

      Settings_Profiles_Record_Model has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Settings_Profiles_Record_Model extends Settings_Vtiger_Record_Model
      {
          /**
           * Profile field inactive.
           *
      Severity: Minor
      Found in modules/Settings/Profiles/models/Record.php - About 4 hrs to fix

        Vtiger_Detail_View has 37 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Vtiger_Detail_View extends Vtiger_Index_View
        {
            use \App\Controller\ExposeMethod;
        
            /** @var Vtiger_DetailView_Model Record model instance. */
        Severity: Minor
        Found in modules/Vtiger/views/Detail.php - About 4 hrs to fix

          File Coordinate.php has 368 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * Coordiante model.
           *
          Severity: Minor
          Found in modules/OpenStreetMap/models/Coordinate.php - About 4 hrs to fix

            File Vtiger.js has 367 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/Vtiger/resources/Vtiger.js - About 4 hrs to fix

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

                  showNewScrollbarTop: function (element, options = { wheelPropagation: true, suppressScrollY: true }) {
                      if (typeof element === 'undefined' || !element.length) return;
                      options = Object.assign(this.scrollOptions, options);
                      new PerfectScrollbar(element[0], options);
                      var scrollbarTopElement = element.find('.ps__rail-x').first();
              Severity: Major
              Found in public_html/layouts/resources/app.js and 1 other location - About 4 hrs to fix
              public_html/layouts/resources/app.js on lines 2270..2283

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

              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

                  showNewScrollbarLeft: function (element, options = { wheelPropagation: true }) {
                      if (typeof element === 'undefined' || !element.length) return;
                      options = Object.assign(this.scrollOptions, options);
                      new PerfectScrollbar(element[0], options);
                      var scrollbarLeftElement = element.children('.ps__rail-y').first();
              Severity: Major
              Found in public_html/layouts/resources/app.js and 1 other location - About 4 hrs to fix
              public_html/layouts/resources/app.js on lines 2256..2269

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

              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 Index.js has 366 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';
              
              window.Settings_Picklist_Index_Js = class {
                  /**

                Method getParentRecord has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getParentRecord($record, $moduleName = false, $type = 1, $actionid = false)
                    {
                        $cacheKey = "$record,$moduleName,$type,$actionid";
                        if (\App\Cache::staticHas('PrivilegesParentRecord', $cacheKey)) {
                            return \App\Cache::staticGet('PrivilegesParentRecord', $cacheKey);
                Severity: Major
                Found in modules/Users/models/Privileges.php - About 4 hrs to fix

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

                          if ('currentUser' === $this->assigned_user_id) {
                              $userId = \App\User::getCurrentUserId();
                          } elseif ('triggerUser' === $this->assigned_user_id) {
                              $userId = $recordModel->executeUser;
                          } elseif ('copyParentOwner' === $this->assigned_user_id) {
                  Severity: Major
                  Found in modules/com_vtiger_workflow/tasks/VTCreateEventTask.php and 1 other location - About 4 hrs to fix
                  modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php on lines 63..83

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

                  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

                  <?php
                  /**
                   * CFixedAssets CRMEntity Class.
                   *
                   * @copyright YetiForce S.A.
                  Severity: Major
                  Found in modules/CFixedAssets/CFixedAssets.php and 2 other locations - About 4 hrs to fix
                  modules/CInternalTickets/CInternalTickets.php on lines 1..59
                  modules/CMileageLogbook/CMileageLogbook.php on lines 1..59

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

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

                          foreach ($listColumns as $colname) {
                              // Permission to view storage is restricted, avoid showing field values (except storage name)
                              if (\App\Field::getFieldPermission('IStorages', $colname)) {
                                  $data = \App\Purifier::encodeHtml($iStorageInfoBase[$colname]);
                                  if (false === $getRawData && 'subject' === $colname) {
                  Severity: Major
                  Found in modules/IStorages/IStorages.php and 3 other locations - About 4 hrs to fix
                  modules/HelpDesk/models/Module.php on lines 111..131
                  modules/MultiCompany/MultiCompany.php on lines 125..147
                  modules/Project/Project.php on lines 187..207

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

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

                          foreach ($listColumns as $colname) {
                              if (\App\Field::getFieldPermission('HelpDesk', $colname)) {
                                  $data = \App\Purifier::encodeHtml($baseInfo[$colname]);
                                  if (false === $getRawData && 'ticket_no' === $colname) {
                                      if ($recordId != $id) {
                  Severity: Major
                  Found in modules/HelpDesk/models/Module.php and 3 other locations - About 4 hrs to fix
                  modules/IStorages/IStorages.php on lines 131..153
                  modules/MultiCompany/MultiCompany.php on lines 125..147
                  modules/Project/Project.php on lines 187..207

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

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

                          if (!empty($conditions)) {
                              foreach ($conditions as $index => $condition) {
                                  $columns = $condition['columns'];
                                  if ('1' == $index && empty($columns)) {
                                      $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',
                  Severity: Major
                  Found in modules/Settings/PDF/models/Record.php and 1 other location - About 4 hrs to fix
                  modules/Settings/Workflows/models/Record.php on lines 412..427

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

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

                          foreach ($listColumns as $colname) {
                              if (\App\Field::getFieldPermission('Project', $colname)) {
                                  $data = \App\Purifier::encodeHtml($baseInfo[$colname]);
                                  if (false === $getRawData && 'projectname' === $colname) {
                                      if ($recordId != $id) {
                  Severity: Major
                  Found in modules/Project/Project.php and 3 other locations - About 4 hrs to fix
                  modules/HelpDesk/models/Module.php on lines 111..131
                  modules/IStorages/IStorages.php on lines 131..153
                  modules/MultiCompany/MultiCompany.php on lines 125..147

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

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

                          if (\is_array($conditions)) {
                              foreach ($conditions as $index => $condition) {
                                  $columns = $condition['columns'];
                                  if ('1' == $index && empty($columns)) {
                                      $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',
                  Severity: Major
                  Found in modules/Settings/Workflows/models/Record.php and 1 other location - About 4 hrs to fix
                  modules/Settings/PDF/models/Record.php on lines 196..211

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

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

                          if ('currentUser' === $this->assigned_user_id) {
                              $userId = \App\User::getCurrentUserId();
                          } elseif ('triggerUser' === $this->assigned_user_id) {
                              $userId = $recordModel->executeUser;
                          } elseif ('copyParentOwner' === $this->assigned_user_id) {
                  Severity: Major
                  Found in modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php and 1 other location - About 4 hrs to fix
                  modules/com_vtiger_workflow/tasks/VTCreateEventTask.php on lines 44..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 178.

                  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

                  <?php
                  /**
                   * CInternalTickets CRMEntity Class.
                   *
                   * @copyright YetiForce S.A.
                  Severity: Major
                  Found in modules/CInternalTickets/CInternalTickets.php and 2 other locations - About 4 hrs to fix
                  modules/CFixedAssets/CFixedAssets.php on lines 1..59
                  modules/CMileageLogbook/CMileageLogbook.php on lines 1..59

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

                  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