YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

File DateTimeRange.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Date time range class.
 *
 * @copyright YetiForce S.A.
Severity: Minor
Found in include/fields/DateTimeRange.php - About 3 hrs to fix

    Function registerRange has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerRange(parentElement, customParams = {}) {
                if (typeof parentElement === 'undefined') {
                    parentElement = $('body');
                } else {
                    parentElement = $(parentElement);
    Severity: Major
    Found in public_html/layouts/resources/Fields.js - About 3 hrs to fix

      Method doTask has 88 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function doTask($recordModel)
          {
              $moduleName = $recordModel->getModuleName();
              $recordId = $recordModel->getId();
              $entityType = $this->entity_type;
      Severity: Major
      Found in modules/com_vtiger_workflow/tasks/VTCreateEntityTask.php - About 3 hrs to fix

        Method getProject has 88 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getProject($id, $viewName = null)
            {
                if (!\is_array($id) && isset($this->tasksById[$id])) {
                    return [$this->tasksById[$id]];
                }
        Severity: Major
        Found in modules/Project/models/Gantt.php - About 3 hrs to fix

          Vtiger_Calendar_Js has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          window.Vtiger_Calendar_Js = class Vtiger_Calendar_Js extends Calendar_Js {
              /**
               * Create calendar's options.
               * @param {jQuery} container
               * @param {bool} readonly
          Severity: Minor
          Found in public_html/layouts/basic/modules/Vtiger/resources/CalendarView.js - About 3 hrs to fix

            RecordConverter has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class RecordConverter extends Base
            {
                /** @var int Field to mapping */
                const FIELD_TO_MAPPING = 1;
            
            
            Severity: Minor
            Found in app/RecordConverter.php - About 3 hrs to fix

              BaseField has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class BaseField
              {
                  /**
                   * @var \App\QueryGenerator
                   */
              Severity: Minor
              Found in app/Conditions/QueryFields/BaseField.php - About 3 hrs to fix

                Base has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                abstract class Base
                {
                    /** @var string Driver name */
                    const DRIVER_NAME = self::DRIVER_NAME;
                
                
                Severity: Minor
                Found in app/Pdf/Drivers/Base.php - About 3 hrs to fix

                  Vtiger_PDF_Model has 29 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Vtiger_PDF_Model extends \App\Base
                  {
                      /**
                       * Template type standard.
                       *
                  Severity: Minor
                  Found in modules/Vtiger/models/PDF.php - About 3 hrs to fix

                    Function registerAutoloadAddress has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            registerAutoloadAddress: function () {
                                const self = this;
                                this.getForm()
                                    .find('.js-search-address')
                                    .each(function (_index, e) {
                    Severity: Major
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 3 hrs to fix

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

                          public function process()
                          {
                              $html = '';
                              if (!$this->textParser->recordModel->getModule()->isInventory()) {
                                  return $html;
                      Severity: Major
                      Found in app/TextParser/ProductsTableShortVersion.php - About 3 hrs to fix

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

                            public function getFieldInstanceByName($name)
                            {
                                $moduleName = 'Settings:WidgetsManagement';
                                $field = $this->getEditFields()[$name] ?? null;
                                if (!$field) {
                        Severity: Major
                        Found in modules/Vtiger/models/Widget.php - About 3 hrs to fix

                          Method get has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function get(): array
                              {
                                  $pagingModel = new \Vtiger_Paging_Model();
                                  $limit = 100;
                                  $isMorePages = false;
                          Severity: Major
                          Found in api/webservice/WebserviceStandard/BaseModule/RecordHistory.php - About 3 hrs to fix

                            Function refreshWidget has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    refreshWidget: function refreshWidget() {
                                        let thisInstance = this;
                                        let parent = this.getContainer();
                                        let element = parent.find('.js-widget-refresh');
                                        let url = element.data('url');

                              Function registerSearchCompany has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      registerSearchCompany: function () {
                                          const searchValue = this.container.find('.js-search-company');
                                          const searchModule = this.container.find('.searchModule');
                                          $.widget('custom.ivAutocomplete', $.ui.autocomplete, {
                                              _create: function () {
                              Severity: Major
                              Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 3 hrs to fix

                                Method getListViewMassActions has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getListViewMassActions($linkParams)
                                    {
                                        $moduleModel = $this->getModule();
                                        $moduleName = $moduleModel->getName();
                                
                                
                                Severity: Major
                                Found in modules/Documents/models/ListView.php - About 3 hrs to fix

                                  Function copyAddress has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                          copyAddress: function (fromLabel, toLabel, relatedRecord, sourceModule) {
                                              const thisInstance = this;
                                              let formElement = this.getForm(),
                                                  status = false,
                                                  addressMapping = this.addressFieldsMapping,
                                  Severity: Minor
                                  Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 3 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 getSearchLabelQuery has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function getSearchLabelQuery(): Db\Query
                                      {
                                          $query = (new Db\Query())->select(['csl.crmid', 'setype' => 'vtiger_tab.name', 'csl.searchlabel'])
                                              ->from('u_#__crmentity_search_label csl')
                                              ->innerJoin('vtiger_tab', 'csl.tabid = vtiger_tab.tabid')
                                  Severity: Minor
                                  Found in app/RecordSearch.php - About 3 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 process has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                  Open

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

                                      public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                                      {
                                          $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                                          if ($view) {
                                              $queryGenerator->initForCustomViewById($view);
                                  Severity: Minor
                                  Found in app/Fields/Owner.php - About 3 hrs to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language