YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getFileFromImage has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    private function getFileFromImage(DOMElement $element, array $params, array &$attachments): array
    {
        $src = trim($element->getAttribute('src'), '\'');
        $element->removeAttribute('src');
        $file = [];
Severity: Minor
Found in modules/OSSMail/models/Mail.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 isLockByFields has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function isLockByFields()
    {
        if (!isset($this->privileges['isLockByFields'])) {
            $isLock = false;
            $moduleName = $this->getModuleName();
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 initializeContent has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function initializeContent(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $this->moduleName = $request->getModule();
        $this->sourceModule = $request->getByType('src_module', 2);
Severity: Minor
Found in modules/Vtiger/views/RecordsList.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 setRelatedFieldsInHierarchy has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function setRelatedFieldsInHierarchy(Vtiger_Record_Model $recordModel, $fieldName)
    {
        $fieldValue = $recordModel->get($fieldName);
        $relatedModules = \App\ModuleHierarchy::getRelationFieldByHierarchy($recordModel->getModuleName(), $fieldName);
        if ($relatedModules && !empty($fieldValue) && $recordModel->getPreviousValue($fieldName) !== $fieldValue) {
Severity: Minor
Found in modules/Vtiger/actions/SaveAjax.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 read has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function read()
    {
        $defaultCharset = App\Config::main('default_charset');
        $this->createTable();

Severity: Minor
Found in modules/Import/readers/XmlReader.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 createQuery has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    public function createQuery(): void
    {
        $this->queryGenerator = new \App\QueryGenerator('Users');
        $limit = 1000;
        if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
Severity: Minor
Found in api/webservice/WebserviceStandard/Users/RecordsList.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

File Field.php has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App;

/**
Severity: Minor
Found in app/Field.php - About 4 hrs to fix

    Method process has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process()
        {
            $html = '';
            if (!$this->textParser->recordModel->getModule()->isInventory()) {
                return $html;
    Severity: Major
    Found in app/TextParser/ProductsTableImages.php - About 4 hrs to fix

      File RelationAjax.php has 355 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/Vtiger/actions/RelationAjax.php - About 4 hrs to fix

        OSSMailScanner_Record_Model has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class OSSMailScanner_Record_Model extends Vtiger_Record_Model
        {
            /**
             * Main folders array.
             *
        Severity: Minor
        Found in modules/OSSMailScanner/models/Record.php - About 4 hrs to fix

          Vtiger_Inventory_Model has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Vtiger_Inventory_Model
          {
              /**
               * Field configuration table postfix.
               */
          Severity: Minor
          Found in modules/Vtiger/models/Inventory.php - About 4 hrs to fix

            File Profiles.js has 354 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.

              File ListPreview.js has 351 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';
              
              Vtiger_List_Js(
                  'Vtiger_ListPreview_Js',
              Severity: Minor
              Found in public_html/layouts/basic/modules/Vtiger/resources/ListPreview.js - About 4 hrs to fix

                File Field.js has 351 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/resources/Field.js - About 4 hrs to fix

                  File ChatAjax.php has 351 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /**
                   * Action to get Chat data.
                   *
                  Severity: Minor
                  Found in modules/Chat/actions/ChatAjax.php - About 4 hrs to fix

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

                            sanitizeFieldMapping: function () {
                                var fieldsList = jQuery('.fieldIdentifier');
                                var mappedFields = {};
                                var inventoryMappedFields = {};
                                var errorMessage;
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Import/resources/Import.js - 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 getViewId has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getViewId($noCache = false)
                        {
                            \App\Log::trace(__METHOD__);
                            if (isset($this->defaultViewId)) {
                                return $this->defaultViewId;
                    Severity: Minor
                    Found in app/CustomView.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 getVendorLibraries has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getVendorLibraries()
                        {
                            $libraries = [];
                            if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
                                $composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
                    Severity: Minor
                    Found in app/Installer/Credits.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 30 (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/TableTaxSummary.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 getSupportedCurrencies has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getSupportedCurrencies()
                        {
                            $supportedCurrencies = [];
                            $supportedCurrencies[Settings_CurrencyUpdate_Module_Model::getCRMCurrencyName($this->getMainCurrencyCode())] = $this->getMainCurrencyCode();
                            $dateCur = date('Y-m-d', strtotime('last monday'));
                    Severity: Minor
                    Found in modules/Settings/CurrencyUpdate/bankmodels/NBP.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

                    Severity
                    Category
                    Status
                    Source
                    Language