YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function doTask($rawRecordModel)
    {
        $recordModel = \Vtiger_Record_Model::getCleanInstance($rawRecordModel->getModuleName());
        $recordModel->setData($rawRecordModel->getData());
        $recordModel->ext = $rawRecordModel->ext;
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.php - About 4 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 getAccountFieldsForLeadConvert has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAccountFieldsForLeadConvert()
    {
        $accountsFields = [];
        $moduleName = 'Accounts';

Severity: Minor
Found in modules/Leads/models/Record.php - About 4 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 getInventoryChanges has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInventoryChanges()
    {
        if (!isset($this->inventoryChanges)) {
            $changes = [];
            if ($this->isCreate() || $this->isUpdate() || $this->isTransferEdit()) {
Severity: Minor
Found in modules/ModTracker/models/Record.php - About 4 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 getRecordListViewLinksLeftSide has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordListViewLinksLeftSide()
    {
        if (!$this->isViewable()) {
            return [];
        }
Severity: Minor
Found in modules/Vtiger/models/Record.php - About 4 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 preProcess has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function preProcess(App\Request $request, $display = true)
    {
        parent::preProcess($request, false);

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Vtiger/views/Detail.php - About 4 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 getHierarchyData has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData($id, $baseInfo, $recordId, &$listviewEntries, $getRawData = false, $getLinks = true)
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Contacts', 'DetailView', $recordId);
Severity: Minor
Found in modules/Contacts/Contacts.php - About 4 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 get has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $this->loadResponseParams();
        $moduleName = $this->controller->request->get('module');
        $module = \Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/Fields.php - About 4 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

Method formatCurrencyValue has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function formatCurrencyValue($value)
    {
        $currencyPattern = $this->currencyFormat;
        $curSeparator = $this->currencySeparator;
        $decSeparator = $this->decimalSeparator;
Severity: Major
Found in include/fields/CurrencyField.php - About 4 hrs to fix

    Function registerRelatedListEvents has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerRelatedListEvents: function () {
                const thisInstance = this,
                    relatedList = $('#relatedTabOrder');
                App.Fields.Picklist.showSelect2ElementView(
                    relatedList.find('.relatedTabModulesList .js-related-column-list-container .select2_container'),

      Function render has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              render: function () {
                  this.bindAttr('data', function (data) {
                      // ported from php DataFormatter
                      var formatDuration = function (seconds) {
                          if (seconds < 0.001) return (seconds * 1000000).toFixed() + 'μs';
      Severity: Major
      Found in public_html/layouts/resources/debugbar/logs.js - About 4 hrs to fix

        Method getInventoryTable has 109 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getInventoryTable(array $config): string
            {
                $rawText = empty($config['href']) || 'yes' !== $config['href'];
                $inventory = \Vtiger_Inventory_Model::getInstance($this->moduleName);
                $fields = $inventory->getFieldsByBlocks();
        Severity: Major
        Found in app/TextParser.php - About 4 hrs to fix

          Method getBreadcrumbs has 109 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getBreadcrumbs($pageTitle = false)
              {
                  $breadcrumbs = [];
                  $request = App\Request::init();
                  $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
          Severity: Major
          Found in modules/Vtiger/models/Menu.php - About 4 hrs to fix

            `` has 34 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export default {
                maximize({ commit }, isMini) {
                    commit('miniMode', isMini)
                },
                toggleLeftPanel({ commit, getters }, newValue) {
            Severity: Minor
            Found in public_html/src/layouts/basic/modules/Chat/store/actions.js - About 4 hrs to fix

              WebservicePremiumTest has 34 functions (exceeds 20 allowed). Consider refactoring.
              Open

              final class WebservicePremiumTest extends \Tests\Base
              {
                  use AssertsTrait;
              
                  /** @var int Api server id. */
              Severity: Minor
              Found in tests/Integrations/WebservicePremiumTest.php - About 4 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if (empty(self::$browserCache)) {
                            $browserAgent = strtolower(\App\Request::_getServer('HTTP_USER_AGENT', ''));
                
                            $browser = new \stdClass();
                            $browser->ver = 0;
                Severity: Critical
                Found in app/RequestUtil.php - About 4 hrs to fix

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

                  <?php
                  
                  /**
                   * Settings menu record model class.
                   *
                  Severity: Minor
                  Found in modules/Settings/Menu/models/Record.php - About 4 hrs to fix

                    Function setMarkers has 108 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            setMarkers: function (data) {
                                var thisInstance = this;
                                var markerArray = [];
                                var container = this.container;
                                var map = this.mapInstance;
                    Severity: Major
                    Found in public_html/layouts/basic/modules/OpenStreetMap/resources/Map.js - About 4 hrs to fix

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

                        Method getComposeParam has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function getComposeParam(App\Request $request)
                            {
                                $moduleName = $request->getByType('crmModule');
                                $record = $request->getInteger('crmRecord');
                                $type = $request->getByType('type');
                        Severity: Major
                        Found in modules/OSSMail/models/Module.php - About 4 hrs to fix

                          File Base.php has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * Abstract base view controller file.
                           *
                           * @package   Controller
                          Severity: Minor
                          Found in app/Controller/View/Base.php - About 4 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language