YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getRelatedVariable has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedVariable($fieldType = false, $skipEmpty = false)
    {
        $cacheKey = "{$this->moduleName}|$fieldType|{$skipEmpty}";
        if (isset(static::$relatedVariable[$cacheKey])) {
            return static::$relatedVariable[$cacheKey];
Severity: Minor
Found in app/TextParser.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 clear has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public static function clear(): void
    {
        if ('TEST' === getenv('INSTALL_MODE')) {
            return;
        }
Severity: Minor
Found in app/Installer/Composer.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 process has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): string
    {
        $html = '';
        $moduleName = $this->params[0];
        if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
Severity: Minor
Found in app/TextParser/UserNewRecords.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 getQuickCreateModules has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQuickCreateModules($restrictList = false, $tree = false): array
    {
        $restrictListString = $restrictList ? 1 : 0;
        if ($tree) {
            $userModel = \App\User::getCurrentUserModel();
Severity: Minor
Found in app/Module.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 importDataFromXML has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function importDataFromXML($uploadedXml)
    {
        $combine = ['tabid' => 'source', 'reltabid' => 'target'];
        $instances = [];
        $i = 0;
Severity: Minor
Found in modules/Settings/MappedFields/models/Module.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 queueScheduledWorkflowTasks has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function queueScheduledWorkflowTasks()
    {
        $default_timezone = App\Config::main('default_timezone');
        $vtWorflowManager = new VTWorkflowManager();
        $taskQueue = new VTTaskQueue();
Severity: Minor
Found in modules/com_vtiger_workflow/WorkFlowScheduler.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 entityAfterSave has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityAfterSave(App\EventHandler $eventHandler)
    {
        if (!ModTracker::isTrackingEnabledForModule($eventHandler->getModuleName())) {
            return false;
        }
Severity: Minor
Found in modules/ModTracker/handlers/ModTrackerHandler.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 process has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_PRIVILEGES_UPDATER');
        $query = (new \App\Db\Query())->select(['crmid', 'setype'])
            ->from('vtiger_crmentity')
Severity: Minor
Found in modules/Vtiger/crons/PrivilegesUpdater.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 registerMiniListWidget has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerMiniListWidget: function () {
            const thisInstance = this;
            $('.dashboardHeading')
                .off('click', '.js-add-filter')
                .on('click', '.js-add-filter', function (e) {
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/DashBoard.js - About 4 hrs to fix

    Function registerCalendar has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerCalendar: function () {
                const self = this,
                    container = this.getContainer();
                //Default time format
                let userTimeFormat = CONFIG.hourFormat;

      Method getRecordListViewLinksLeftSide has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getRecordListViewLinksLeftSide()
          {
              if (!$this->isViewable()) {
                  return [];
              }
      Severity: Major
      Found in modules/Vtiger/models/Record.php - About 4 hrs to fix

        File Menu.js has 369 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_Menu_Index_Js',
        Severity: Minor
        Found in public_html/layouts/basic/modules/Settings/Menu/resources/Menu.js - About 4 hrs to fix

          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

                      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
                          Severity
                          Category
                          Status
                          Source
                          Language