YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function doTask has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        if (empty($this->recordCollector)) {
            return;
        }
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/RecordCollector.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $page = $request->getInteger('page');
Severity: Minor
Found in modules/ModTracker/dashboards/Updates.php - About 2 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 initInventoryData has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function initInventoryData(array $items, bool $userFormat = true)
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $inventoryModel = Vtiger_Inventory_Model::getInstance($this->getModuleName());
        $fields = $inventoryModel->getFields();
Severity: Minor
Found in modules/Vtiger/models/Record.php - About 2 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 sanitizeInventoryValue has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function sanitizeInventoryValue($value, $columnName): string
    {
        if ($field = $this->inventoryFields[$columnName] ?? false) {
            if (\in_array($field->getType(), ['Name', 'Reference'])) {
                $value = trim($value);
Severity: Minor
Found in modules/Vtiger/models/ExportToXml.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $html = '';
        $relationModuleName = 'Products';
        $relationListView = \Vtiger_RelationListView_Model::getInstance($this->textParser->recordModel, $relationModuleName);
Severity: Minor
Found in modules/IStorages/textparsers/ProductsTable.php - About 2 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 getDefaultFieldValues has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDefaultFieldValues()
    {
        $key = $this->module . '_' . $this->user->getId();
        if (\App\Cache::staticHas('DefaultFieldValues', $key)) {
            return \App\Cache::staticGet('DefaultFieldValues', $key);
Severity: Minor
Found in modules/Import/actions/Data.php - About 2 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 Record.php has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

 /* +***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
Severity: Minor
Found in modules/Documents/models/Record.php - About 2 hrs to fix

    Function loadMenuTree has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            loadMenuTree: function () {
                var thisInstance = this;
                if (thisInstance.treeInstance == false) {
                    var data = JSON.parse($('#treeValues').val());
                    if (data.length == 0) {
    Severity: Major
    Found in public_html/layouts/basic/modules/Settings/Menu/resources/Menu.js - About 2 hrs to fix

      File ChartFilter.js has 280 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(
          'Base_ChartFilter_JS',

        Function constructor has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor(element) {
                const thisInstance = this;
                this.elements = {};
                this.options = {
                    showCarousel: true
        Severity: Major
        Found in public_html/layouts/resources/fields/MultiImage.js - About 2 hrs to fix

          Function init has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  init() {
                      const field = this.getField();
                      $('.js-pwd-auto-generate', this.container)
                          .off('click')
                          .on('click', (e) => {
          Severity: Major
          Found in public_html/layouts/resources/Fields.js - About 2 hrs to fix

            Function showModalWindow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                showModalWindow: function (data, url, cb, paramsObject = {}) {
                    if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
                        return false;
                    }
                    const thisInstance = this;
            Severity: Major
            Found in public_html/layouts/resources/app.js - About 2 hrs to fix

              Method getUserQuickMenuLinks has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getUserQuickMenuLinks(\App\Request $request): array
                  {
                      $userModel = \Users_Record_Model::getCurrentUserModel();
                      $headerLinks[] = [
                          'linktype' => 'GROUPNAME',
              Severity: Major
              Found in app/Controller/View/Page.php - About 2 hrs to fix

                Method computeLabels has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function computeLabels($moduleName, $ids, $search = false): ?array
                    {
                        if (empty($moduleName) || empty($ids)) {
                            return [];
                        }
                Severity: Major
                Found in app/Record.php - About 2 hrs to fix

                  Method getFieldValue has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getFieldValue(string $magentoFieldName, ?string $crmFieldName = null)
                      {
                          $parsedFieldName = $crmFieldName ?? $this->getFieldNameCrm($magentoFieldName);
                          $methodName = 'getCrm' . \ucfirst($parsedFieldName);
                          $fieldLevels = explode('|', $magentoFieldName);
                  Severity: Major
                  Found in app/Integrations/Magento/Synchronizer/Maps/Base.php - About 2 hrs to fix

                    Method createModule has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function createModule(array $moduleInformation)
                        {
                            $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));
                    
                            $module = new vtlib\Module();
                    Severity: Major
                    Found in modules/Settings/ModuleManager/models/Module.php - About 2 hrs to fix

                      Method getQuery has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getQuery()
                          {
                              $queryGenerator = new App\QueryGenerator($this->getModuleName());
                              if ($this->has('customFilter')) {
                                  $queryGenerator->initForCustomViewById($this->get('customFilter'));
                      Severity: Major
                      Found in modules/Occurrences/models/Calendar.php - About 2 hrs to fix

                        Method convertToNativeLink has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function convertToNativeLink()
                            {
                                $url = $this->get('linkurl');
                                if (empty($url)) {
                                    return $url;
                        Severity: Major
                        Found in modules/Vtiger/models/Link.php - About 2 hrs to fix

                          File RecordsList.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          /**
                           * Records list view class.
                           *
                          Severity: Minor
                          Found in modules/Vtiger/views/RecordsList.php - About 2 hrs to fix

                            Method readAllCoordinatesFromCustomeView has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function readAllCoordinatesFromCustomeView()
                                {
                                    $moduleModel = $this->get('srcModuleModel');
                                    $moduleName = $moduleModel->getName();
                                    $excludedIds = $this->get('excluded_ids');
                            Severity: Major
                            Found in modules/OpenStreetMap/models/Coordinate.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language