YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function validate has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validate(string $type)
    {
        $main = static::parse($type);
        $cron = static::getCronVariables($type);
        foreach (static::${$type} as $key => &$item) {
Severity: Minor
Found in app/Utils/ConfReport.php - About 1 day 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 registerEvents has 201 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerEvents: function () {
            const thisIstance = this,
                container = jQuery('.contentsDiv');
            thisIstance.registerColorField($('#exceptions select'));
            thisIstance.registerEditFolders(container);

    File Header.js has 501 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: Major
    Found in public_html/layouts/basic/modules/Vtiger/resources/Header.js - About 1 day to fix

      File has 56 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class File
      {
          /** @var string Temporary table name. */
          public const TABLE_NAME_TEMP = 'u_#__file_upload_temp';
      
      
      Severity: Major
      Found in app/Fields/File.php - About 1 day to fix

        Function process has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

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

            public function doTask($recordModel)
            {
                if (!\App\Module::isModuleActive('Calendar')) {
                    return;
                }
        Severity: Minor
        Found in modules/com_vtiger_workflow/tasks/VTCreateTodoTask.php - About 7 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 getStructure has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getStructure()
            {
                if (!empty($this->structuredValues)) {
                    return $this->structuredValues;
                }
        Severity: Minor
        Found in modules/Calendar/models/EditRecordStructure.php - About 7 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 read has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            public function read()
            {
                $this->createTable();
                $fieldMapping = $this->request->get('field_mapping');
                $inventoryFieldMapping = $this->request->get('inventory_field_mapping');
        Severity: Minor
        Found in modules/Import/readers/CSVReader.php - About 7 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 getConditions has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getConditions(\App\Db\Query $query, string $moduleName, $user = false, $relatedRecord = null)
            {
                if (!($user && $user instanceof \App\User)) {
                    $user = \App\User::getCurrentUserModel();
                }
        Severity: Minor
        Found in api/webservice/WebservicePremium/PrivilegeQuery.php - About 7 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 VTJsonCondition.php has 494 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
         * The Original Code is:  vtiger CRM Open Source
        Severity: Minor
        Found in modules/com_vtiger_workflow/VTJsonCondition.php - About 7 hrs to fix

          Method getPluralized has 196 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function getPluralized($count)
              {
                  //Extract language code from locale with special cases
                  if (0 === strcasecmp(static::getLanguage(), 'pt-BR')) {
                      $lang = 'pt-BR';
          Severity: Major
          Found in app/Language.php - About 7 hrs to fix

            Users_Record_Model has 55 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Users_Record_Model extends Vtiger_Record_Model
            {
                /** {@inheritdoc} */
                public function getModule(): Vtiger_Module_Model
                {
            Severity: Major
            Found in modules/Users/models/Record.php - About 7 hrs to fix

              File CustomView.php has 492 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Custom view file.
               *
               * @package App
              Severity: Minor
              Found in app/CustomView.php - About 7 hrs to fix

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

                    public function doTask($recordModel)
                    {
                        $fieldValueMapping = [];
                        if (!empty($this->field_value_mapping)) {
                            $fieldValueMapping = \App\Json::decode($this->field_value_mapping);
                Severity: Minor
                Found in modules/com_vtiger_workflow/tasks/VTUpdateRelatedFieldTask.php - About 7 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 getDateRangeByType has 193 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getDateRangeByType($type, $dateObject = null)
                    {
                        $currentUser = \App\User::getCurrentUserModel();
                        $weekStartDay = $currentUser->getDetail('dayoftheweek');
                
                
                Severity: Major
                Found in include/fields/DateTimeRange.php - About 7 hrs to fix

                  File AdvanceFilter.js has 486 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.

                    Function relations has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function relations(int $sourceId, array $records)
                        {
                            $sourceRecord = \Vtiger_Record_Model::getInstanceById($sourceId);
                            foreach ($records as $recordId) {
                                $recordModel = \Vtiger_Record_Model::getInstanceById($recordId);
                    Severity: Minor
                    Found in app/RecordTransfer.php - About 7 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 getRates has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getRates($otherCurrencyCode, $dateParam, $cron = false)
                        {
                            $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
                            $selectedBank = $moduleModel->getActiveBankId();
                            $yesterday = date('Y-m-d', strtotime('-1 day'));
                    Severity: Minor
                    Found in modules/Settings/CurrencyUpdate/bankmodels/NBP.php - About 7 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 LangManagement.js has 480 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';
                    
                    var Settings_Index_Js = {
                        initEvants: function () {

                      TextParser has 53 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class TextParser
                      {
                          /**
                           * Examples of supported variables.
                           *
                      Severity: Major
                      Found in app/TextParser.php - About 7 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language