YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Settings_Groups_Record_Model has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

class Settings_Groups_Record_Model extends Settings_Vtiger_Record_Model
{
    /** @var array Record changes */
    protected $changes = [];

Severity: Minor
Found in modules/Settings/Groups/models/Record.php - About 3 hrs to fix

    File Module.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Module Class for MappedFields Settings.
     *
    Severity: Minor
    Found in modules/Settings/MappedFields/models/Module.php - About 3 hrs to fix

      Function autoLink has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  autoLink() {
                      let fillChar = '\u200B';
                      let sel = window.getSelection(),
                          range = sel.getRangeAt(0).cloneRange(),
                          offset,
      Severity: Major
      Found in public_html/layouts/resources/Fields.js - About 3 hrs to fix

        Method getHtmlConfig has 95 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function getHtmlConfig(array $options = [])
            {
                $config = \HTMLPurifier_Config::createDefault();
                $config->set('Core.Encoding', static::$defaultCharset);
                $config->set('Cache.SerializerPermissions', 0775);
        Severity: Major
        Found in app/Purifier.php - About 3 hrs to fix

          Method getWidgetTimeControl has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getWidgetTimeControl($user, $time)
              {
                  if (!$time) {
                      return ['show_chart' => false];
                  }
          Severity: Major
          Found in modules/OSSTimeControl/dashboards/AllTimeControl.php - About 3 hrs to fix

            Method loadFieldInfo has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function loadFieldInfo(): array
                {
                    if (null !== $this->fieldInfo) {
                        return $this->fieldInfo;
                    }
            Severity: Major
            Found in modules/Vtiger/models/Field.php - About 3 hrs to fix

              Method getValuesFromSource has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getValuesFromSource(App\Request $request, $moduleName = false)
                  {
                      $sourceModule = $request->getByType('sourceModule', 2);
                      if (
                          empty($sourceModule)
              Severity: Major
              Found in modules/Vtiger/models/Module.php - About 3 hrs to fix

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

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

                          getPopUp: function (container) {
                              const thisInstance = this;
                              if (typeof container === 'undefined') {
                                  container = thisInstance.getFilterContainer();
                              }
                  Severity: Major
                  Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js - About 3 hrs to fix

                    Function addTimeControl has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                            addTimeControl(params, callback = () => {}) {
                                let aDeferred = jQuery.Deferred();
                                let referenceModuleName = 'OSSTimeControl';
                                let parentId = params.recordId;
                                let parentModule = 'HelpDesk';
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/HelpDesk/resources/Detail.js - 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 throwNewException has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
                        {
                            if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
                                header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
                            }
                    Severity: Minor
                    Found in vtlib/Vtiger/Functions.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 readCatalog has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function readCatalog(string $catalogToRead)
                        {
                            $catalogPath = static::getBackupCatalogPath();
                            $catalogToReadArray = $returnStructure = [];
                            if (empty($catalogPath)) {
                    Severity: Minor
                    Found in app/Utils/Backup.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 import has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function import(): bool
                        {
                            $allChecked = false;
                            try {
                                if ($invoices = $this->getInvoicesFromApi()) {
                    Severity: Minor
                    Found in app/Integrations/Magento/Synchronizer/Invoice.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 getModulePermissions has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getModulePermissions()
                        {
                            if (!isset($this->module_permissions)) {
                                $allModules = Vtiger_Module_Model::getAll([0], Settings_Profiles_Module_Model::getNonVisibleModulesList());
                                $profileTabPermissions = $this->getProfileTabPermissions();
                    Severity: Minor
                    Found in modules/Settings/Profiles/models/Record.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 entityAfterSave has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function entityAfterSave(App\EventHandler $eventHandler)
                        {
                            $moduleName = $eventHandler->getModuleName();
                            // Update Used Units for the Service Contract, everytime the status of a ticket related to the Service Contract changes
                            if ('HelpDesk' === $moduleName && 'ServiceContracts' !== \App\Request::_get('return_module')) {
                    Severity: Minor
                    Found in modules/ServiceContracts/handlers/ServiceContractsHandler.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 getHierarchyData has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getHierarchyData($id, $accountInfoBase, $accountId, &$listViewEntries)
                        {
                            \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $accountId . ') method ...');
                            $hasRecordViewAccess = \App\Privilege::isPermitted('Accounts', 'DetailView', $accountId);
                            foreach ($this->hierarchyFields as &$field) {
                    Severity: Minor
                    Found in modules/Accounts/Accounts.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 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function process(App\Request $request)
                        {
                            $this->preProcess($request);
                            $viewer = $this->getViewer($request);
                            $pdfModuleName = $moduleName = $request->getModule();
                    Severity: Minor
                    Found in modules/Vtiger/views/PDF.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 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function process()
                        {
                            foreach (App\Integrations\Magento\Config::getAllServers() as $serverId => $config) {
                                if (0 === (int) $config['status']) {
                                    continue;
                    Severity: Minor
                    Found in modules/Vtiger/crons/Magento.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 getWidget has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getWidget()
                        {
                            $widget = [];
                            $model = Vtiger_Module_Model::getInstance($this->Data['relatedmodule']);
                            if ($model && $model->isPermitted('DetailView')) {
                    Severity: Minor
                    Found in modules/Vtiger/widgets/RelatedModule.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 updateRelation has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function updateRelation(App\Request $request)
                        {
                            $sourceModule = $request->getModule();
                            $sourceRecordId = $request->getInteger('src_record');
                            $relatedModule = $request->getByType('related_module', 2);
                    Severity: Minor
                    Found in modules/Vtiger/actions/RelationAjax.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

                    Severity
                    Category
                    Status
                    Source
                    Language