YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

File Widget.php has 479 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/Vtiger/models/Widget.php - About 7 hrs to fix

    Function _request has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        _request: function (params, pjaxMode, rawData) {
            const aDeferred = jQuery.Deferred();
            if (typeof rawData === 'undefined') {
                rawData = false;
            }
    Severity: Minor
    Found in public_html/layouts/resources/Connector.js - 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 checkZip has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        public function checkZip($zipfile)
        {
            $manifestFound = $languagefile_found = $layoutfile_found = $updatefile_found = $extensionfile_found = $moduleVersionFound = $fontfile_found = false;
            $moduleName = null;
            $zip = \App\Zip::openFile($zipfile, ['checkFiles' => false]);
    Severity: Minor
    Found in vtlib/Vtiger/PackageImport.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 addReport has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function addReport(array $data): string
        {
            $status = 0;
            if (\Config\Components\Mail::$rcListAcceptAutomatically ?? false) {
                $status = 1;
    Severity: Minor
    Found in app/Mail/Rbl.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 getFieldValue has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFieldValue(string $magentoFieldName, ?string $crmFieldName = null)
        {
            $parsedFieldName = $crmFieldName ?? $this->getFieldNameCrm($magentoFieldName);
            $methodName = 'getCrm' . \ucfirst($parsedFieldName);
            $fieldLevels = explode('|', $magentoFieldName);
    Severity: Minor
    Found in app/Integrations/Magento/Synchronizer/Maps/Base.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 save has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

        public function save()
        {
            $db = App\Db::getInstance();
            $profileName = $this->get('profilename');
            $description = $this->get('description');
    Severity: Minor
    Found in modules/Settings/Profiles/models/Record.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 DetailView.php has 475 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/Vtiger/models/DetailView.php - About 7 hrs to fix

      File Mailer.php has 472 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

        Function populateSharingPrivileges has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
            {
                $tabId = Module::getModuleId($module);
                $dbCommand = \App\Db::getInstance()->createCommand();
                if (empty($varArr)) {
        Severity: Minor
        Found in app/UserPrivilegesFile.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 populateRelatedSharingPrivileges has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
            {
                $dbCommand = \App\Db::getInstance()->createCommand();
                $tabId = Module::getModuleId($module);
                $relTabId = Module::getModuleId($relmodule);
        Severity: Minor
        Found in app/UserPrivilegesFile.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 getValueFromImport has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getValueFromImport($value, $defaultValue = null)
            {
                if (empty($value)) {
                    return '';
                }
        Severity: Minor
        Found in modules/Vtiger/uitypes/Reference.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

        PackageImport has 51 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class PackageImport extends PackageExport
        {
            /**
             * Module Meta XML File (Parsed).
             */
        Severity: Major
        Found in vtlib/Vtiger/PackageImport.php - About 7 hrs to fix

          File Functions.php has 464 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 vtlib/Vtiger/Functions.php - About 7 hrs to fix

            Function parseBaseSearchParamsToCondition has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                public function parseBaseSearchParamsToCondition($searchParams)
                {
                    if (empty($searchParams)) {
                        return [];
                    }
            Severity: Minor
            Found in app/QueryGenerator.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 sendByRowQueue has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function sendByRowQueue($rowQueue)
                {
                    if ('demo' === \App\Config::main('systemMode')) {
                        return true;
                    }
            Severity: Minor
            Found in app/Mailer.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 saveHandler has 177 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            let saveHandler = function (e) {
                                thisInstance.registerNameAjaxEditEvent();
                                let element = $(e.target);
                                if ($(e.currentTarget).find('.dateTimePickerField').length) {
                                    if (element.closest('.drp-calendar').length || element.hasClass('drp-calendar')) {
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 7 hrs to fix

              File Privilege.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                File Import.js has 458 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/Import/resources/Import.js - About 7 hrs to fix

                  Method getRecordRelatedListViewLinksLeftSide has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getRecordRelatedListViewLinksLeftSide(Vtiger_RelationListView_Model $viewModel)
                      {
                          $links = [];
                          if (!$this->isViewable()) {
                              return [];
                  Severity: Major
                  Found in modules/Vtiger/models/Record.php - About 6 hrs to fix

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

                        public function process(): string
                        {
                            $html = '';
                            $moduleName = 'SSalesProcesses';
                            if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
                    Severity: Minor
                    Found in app/TextParser/UserSSalesProcesses.php - About 6 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