YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function testIfAllOperatorsExist has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function testIfAllOperatorsExist()
    {
        foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
            if ($item->isFile() && 'php' === $item->getExtension()) {
                $fileName = $item->getBasename('.php');
Severity: Minor
Found in tests/App/Conditions.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 getModules has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getModules(): array
    {
        $cacheName = 'InterestsConflict::getModules';
        if (\App\Cache::has($cacheName, '')) {
            return \App\Cache::get($cacheName, '');
Severity: Minor
Found in app/Components/InterestsConflict.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 translate has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public static function translate(string $key, string $moduleName = '_Base', ?string $language = null, bool $encode = true, ?string $secondModuleName = null)
    {
        if (empty($key)) { // nothing to translate
            return $key;
        }
Severity: Minor
Found in app/Language.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 checkIfDuplicateRecordExists has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkIfDuplicateRecordExists()
    {
        if ($this->get('check_duplicate') && isset($this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()])) {
            $referenceDestinyField = $this->fieldMapping['field_merge'][$this->destinyModuleModel->getId()];
            if ($referenceDestinyField) {
Severity: Minor
Found in app/RecordConverter.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 getArray has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function getArray($key, $type = false, $value = [], ?string $keyType = null)
    {
        if (isset($this->purifiedValuesByArray[$key])) {
            return $this->purifiedValuesByArray[$key];
        }
Severity: Minor
Found in app/Request.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 27 (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/TableCorrectTaxSummary.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 initializeListViewContents has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
    {
        $moduleName = $request->getModule();
        $cvId = $request->getByType('viewname', 2);
        $pageNumber = $request->getInteger('page');
Severity: Minor
Found in modules/Users/views/List.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 global has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function global(App\Request $request)
    {
        $moduleName = $request->getModule(false);
        $data = [];
        $type = 'global';
Severity: Minor
Found in modules/Settings/ApiAddress/actions/SaveConfig.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 getStats has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStats($data, $langBase, $byModule)
    {
        $differences = [];
        $i = 0;
        foreach ($data as $id => $dataLang) {
Severity: Minor
Found in modules/Settings/LangManagement/models/Module.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 getHeaders has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHeaders()
    {
        $fields = [];
        if ($this->get('viewId')) {
            $moduleModel = $this->getRelationModel()->getRelationModuleModel();
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 getAutoCompleteField has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAutoCompleteField($recordModel): array
    {
        $fields = [];
        $fieldsReferenceList = [];
        $excludedModules = ['Users'];
Severity: Minor
Found in modules/Vtiger/models/Relation.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

File Index.js has 329 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(
    'Settings_RecordNumbering_Index_Js',

    File User.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App;
    
    /**
    Severity: Minor
    Found in app/User.php - About 3 hrs to fix

      File Record.php has 329 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/Calendar/models/Record.php - About 3 hrs to fix

        Function getPopUp has 97 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getPopUp(container) {
                    if (typeof container === 'undefined') {
                        container = this.getContainer();
                    }
                    container.on('click', '.getPopupUi', (e) => {

          Function registerParams has 97 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerParams(selectElement, params) {
                      if (typeof params.dropdownParent === 'undefined') {
                          const modalParent = $(selectElement).closest('.modal-body');
                          if (modalParent.length) {
                              params.dropdownParent = modalParent;
          Severity: Major
          Found in public_html/layouts/resources/Fields.js - About 3 hrs to fix

            File Watchdog.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /**
             * Watching Model Class.
             *
            Severity: Minor
            Found in modules/Vtiger/models/Watchdog.php - About 3 hrs to fix

              Function registerConfirmations has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerConfirmations: function (container) {
                          let form = container.find('.js-filter-form');
                          App.Fields.Date.registerRange(form);
                          let table = $('#js-confirm-table');
                          if (table.hasClass('dataTable')) {
              Severity: Major
              Found in public_html/layouts/basic/components/InterestsConflict.js - About 3 hrs to fix

                Method maximumFieldsLength has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function maximumFieldsLength(array $conditions = []): array
                    {
                        $typesNotSupported = ['datetime', 'date', 'year', 'timestamp', 'time'];
                        $uiTypeNotSupported = [30];
                        $updated = $requiresVerification = $typeNotFound = $notSupported = 0;
                Severity: Major
                Found in app/Db/Fixer.php - About 3 hrs to fix

                  Method initMailPart has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
                      {
                          if ($partNum) {
                              \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
                              $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
                  Severity: Major
                  Found in modules/OSSMail/models/Record.php - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language