YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

File DashBoard.js has 609 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*+**********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.1
 * ("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/DashBoard.js - About 1 day to fix

    Function category has 265 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.jstree.plugins.category = function (options, parent) {
            this.bind = function () {
                parent.bind.call(this);
                this._data.category.selected = [];
                this.element.on(
    Severity: Major
    Found in public_html/layouts/resources/libraries/jstree.category.js - About 1 day to fix

      Method getDetailViewLinks has 265 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDetailViewLinks(array $linkParams): array
          {
              if ($this->has('Links')) {
                  return $this->get('Links');
              }
      Severity: Major
      Found in modules/Vtiger/models/DetailView.php - About 1 day to fix

        Function getBreadcrumbs has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getBreadcrumbs($pageTitle = false)
            {
                $breadcrumbs = [];
                $request = App\Request::init();
                $userPrivModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
        Severity: Minor
        Found in modules/Vtiger/models/Menu.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

        File WebservicePremiumTest.php has 602 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * Webservice Premium Test integrations test file.
         *
         * @see https://github.com/Maks3w/SwaggerAssertions/
        Severity: Major
        Found in tests/Integrations/WebservicePremiumTest.php - About 1 day to fix

          Method checkPermission has 259 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
              {
                  \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                  if (!$userId) {
                      $userId = \App\User::getCurrentUserId();
          Severity: Major
          Found in app/Privilege.php - About 1 day to fix

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

                public function process(): string
                {
                    $html = '';
                    $moduleName = $this->params[0];
                    if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])
            Severity: Minor
            Found in app/TextParser/UserRecordsDuplicateList.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 getPluralized has a Cognitive Complexity of 64 (exceeds 5 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: Minor
            Found in app/Language.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

            QueryGenerator has 68 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class QueryGenerator
            {
                const STRING_TYPE = ['string', 'text', 'email', 'reference'];
                const NUMERIC_TYPE = ['integer', 'double', 'currency', 'currencyInventory'];
                const DATE_TYPE = ['date', 'datetime'];
            Severity: Major
            Found in app/QueryGenerator.php - About 1 day to fix

              File MultiImage.js has 580 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 MultiImage {
                  /**
              Severity: Major
              Found in public_html/layouts/resources/fields/MultiImage.js - About 1 day to fix

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

                    public function process()
                    {
                        $html = '';
                        [$relatedModuleName, $relatedModuleField, $fieldsToShow] = array_pad($this->params, 3, null);
                        $fieldsToShow = !empty($fieldsToShow) ? explode(',', $fieldsToShow) : ['seq', 'name', 'qty', 'discount', 'currency', 'discountmode', 'taxmode', 'price', 'gross', 'net', 'tax', 'total'];
                Severity: Minor
                Found in app/TextParser/ProductsTableRelatedModule.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 process has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                Open

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

                    public function process(App\Request $request)
                    {
                        $viewer = $this->getViewer($request);
                        $moduleName = $request->getModule();
                        $qualifiedModuleName = $request->getModule(false);
                Severity: Minor
                Found in modules/Settings/Workflows/views/EditTask.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

                File Data.php has 579 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: Major
                Found in modules/Import/actions/Data.php - About 1 day to fix

                  File Record.php has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * OSSMail record model file.
                   *
                   * @package Model
                  Severity: Major
                  Found in modules/OSSMail/models/Record.php - About 1 day to fix

                    File WidgetsManagement.js has 567 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';
                    
                    jQuery.Class(
                        'Settings_WidgetsManagement_Js',

                      Function setRecordFieldValues has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function setRecordFieldValues($parentRecordModel)
                          {
                              $mfInstance = Vtiger_MappedFields_Model::getInstanceByModules($parentRecordModel->getModule()->getId(), $this->getModule()->getId());
                              if ($mfInstance) {
                                  $defaultInvRow = [];
                      Severity: Minor
                      Found in modules/Vtiger/models/Record.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

                      File Edit.js has 564 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/Calendar/resources/Edit.js - About 1 day to fix

                        File Gantt.php has 564 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /**
                         * Gantt Model class.
                         *
                        Severity: Major
                        Found in modules/Project/models/Gantt.php - About 1 day to fix

                          Function search has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function search(): array
                              {
                                  if (!$this->isActive()) {
                                      return [];
                                  }
                          Severity: Minor
                          Found in app/RecordCollectors/Gus.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

                          Severity
                          Category
                          Status
                          Source
                          Language