YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

File Record.php has 282 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/ModComments/models/Record.php - About 2 hrs to fix

    File Module.php has 282 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/Calendar/models/Module.php - About 2 hrs to fix

      Function registerWarningsAlert has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerWarningsAlert: function () {
                  const alertsContainer = $('#systemWarningAletrs');
                  if (alertsContainer.length) {
                      app.showModalWindow(alertsContainer, function () {
                          alertsContainer.find('.warning').first().removeClass('d-none');
      Severity: Major
      Found in public_html/layouts/basic/modules/Settings/Vtiger/resources/Index.js - About 2 hrs to fix

        Function registerSplit has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerSplit: function (container) {
                    var rightSplitMaxWidth = (400 / this.windowW) * 100;
                    var splitMinWidth = (25 / this.windowW) * 100;
                    var splitMaxWidth = 100 - splitMinWidth;
                    var listPreview = container.find('.js-detail-preview');
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/ListPreview.js - About 2 hrs to fix

          Function showConfirmModal has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              showConfirmModal: function (params) {
                  let confirmButtonLabel = 'JS_OK';
                  let rejectedButtonLabel = 'JS_CANCEL';
                  if (typeof params.confirmButtonLabel !== 'undefined') {
                      confirmButtonLabel = params.confirmButtonLabel;
          Severity: Major
          Found in public_html/layouts/resources/app.js - About 2 hrs to fix

            Method afterLogin has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function afterLogin(App\Request $request): void
                {
                    \App\Controller\Headers::generateCspToken();
                    if (\Config\Security::$loginSessionRegenerate) {
                        \App\Session::regenerateId(true); // to overcome session id reuse.
            Severity: Major
            Found in modules/Users/actions/Login.php - About 2 hrs to fix

              Method showEmailsList has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function showEmailsList($srecord, $smodule, $config, $type, $filter = 'All')
                  {
                      if ('All' === $filter || 'Contacts' === $filter) {
                          $relatedId = (new \App\Db\Query())->select(['vtiger_contactdetails.contactid'])->from('vtiger_contactdetails')
                              ->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')
              Severity: Major
              Found in modules/OSSMailView/models/Record.php - About 2 hrs to fix

                Function changeWatching has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    changeWatching: function (instance) {
                        let value, module, state, className, user, record;
                        if (instance != undefined) {
                            instance = $(instance);
                            value = instance.data('value');
                Severity: Minor
                Found in public_html/layouts/basic/modules/Vtiger/resources/Vtiger.js - About 2 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 mergeOptionsObject has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                        mergeOptionsObject: function mergeOptionsObject(to, from) {
                            if (typeof to === 'undefined') {
                                to = {};
                            }
                            for (let key in from) {

                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 parseOptionsObject has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                        parseOptionsObject: function parseOptionsObject(options, original, afterInit = false) {
                            let result = {};
                            for (let propertyName in options) {
                                let value = options[propertyName];
                                if (afterInit) {

                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 selectCallbackCreateModal has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    selectCallbackCreateModal(modal, info) {
                        let startDate = info.start,
                            endDate = info.end;
                        if (info['allDay']) {
                            endDate.setDate(endDate.getDate() - 1);
                Severity: Minor
                Found in public_html/layouts/resources/Calendar.js - About 2 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 showModalWindow has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    showModalWindow: function (data, url, cb, paramsObject = {}) {
                        if (!app.isCurrentWindowTarget('app.showModalWindow', arguments)) {
                            return false;
                        }
                        const thisInstance = this;
                Severity: Minor
                Found in public_html/layouts/resources/app.js - About 2 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 createFiles has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createFiles(Field $entityField)
                    {
                        $targetpath = 'modules/' . $this->name;
                
                        if (!is_file($targetpath)) {
                Severity: Minor
                Found in vtlib/Vtiger/Module.php - About 2 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 getModuleConverters has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getModuleConverters(string $moduleName, string $view = '', array $recordIds = [], ?int $userId = null): array
                    {
                        $converters = [];
                        if (null === $userId) {
                            $userId = \App\User::getCurrentUserId();
                Severity: Minor
                Found in app/RecordConverter.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function process()
                    {
                        $html = '';
                        $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
                        $pdf = $this->textParser->getParam('pdf');
                Severity: Minor
                Found in app/TextParser/RecordsList.php - About 2 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 htmlTruncate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function htmlTruncate(string $html, int $length = 255, string $ending = '...'): string
                    {
                        if (\strlen($html) <= $length) {
                            return $html;
                        }
                Severity: Minor
                Found in app/TextUtils.php - About 2 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 createTimeZone has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function createTimeZone($tzid, $from = 0, $to = 0)
                    {
                        if (!$from) {
                            $from = time();
                        }
                Severity: Minor
                Found in app/Integrations/Dav/Calendar.php - About 2 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 findRecordByEmail has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function findRecordByEmail($value, array $allowedModules = [], array $skipModules = [])
                    {
                        $db = \App\Db::getInstance();
                        $rows = $fields = [];
                        $dataReader = (new \App\Db\Query())->select(['vtiger_field.columnname', 'vtiger_field.tablename', 'vtiger_field.fieldlabel', 'vtiger_field.tabid', 'vtiger_tab.name'])
                Severity: Minor
                Found in app/Integrations/Dav/Calendar.php - About 2 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 getMissingSystemFields has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getMissingSystemFields(): array
                    {
                        $fields = $this->getFields();
                        $systemFields = \App\Field::SYSTEM_FIELDS;
                        $missingFields = [];
                Severity: Minor
                Found in modules/Settings/LayoutEditor/models/Module.php - About 2 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 getCRMConversionRate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getCRMConversionRate($from, $to, $date = '')
                    {
                        $mainCurrencyCode = \App\Fields\Currency::getDefault()['currency_code'];
                        $activeBankId = self::getActiveBankId();
                        $exchange = false;
                Severity: Minor
                Found in modules/Settings/CurrencyUpdate/models/Module.php - About 2 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