YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function loadSearchLockedFields has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadSearchLockedFields(App\Request $request): void
    {
        $moduleModel = $this->getRelationModel()->getRelationModuleModel();
        if (!$request->isEmpty('lockedFields')) {
            foreach ($request->getArray('lockedFields') as $value) {
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 findOutColorsFromRows has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function findOutColorsFromRows()
    {
        if ($this->areColorsFromFilter()) {
            return 'filters';
        }
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 getModalRecordsListFields has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModalRecordsListFields(App\QueryGenerator $queryGenerator, $sourceModule = false)
    {
        if (App\Cache::staticHas('PopupViewFieldsList', $this->getName())) {
            $popupFields = App\Cache::staticGet('PopupViewFieldsList', $this->getName());
        } else {
Severity: Minor
Found in modules/Vtiger/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 checkPermission has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function checkPermission(): void
    {
        parent::checkPermission();
        $moduleName = $this->controller->request->getModule();
        if ('POST' === $this->controller->method) {
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/Record.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

File Card.php has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * CardDav address books file.
 *
 * @see https://en.wikipedia.org/wiki/VCard#Properties
Severity: Minor
Found in app/Integrations/Dav/Card.php - About 2 hrs to fix

    Function registerButtons has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerButtons: function (container) {
                container.find('.js-test-speed').on('click', function () {
                    let progress = jQuery.progressIndicator({
                        message: app.vtranslate('JS_SPEED_TEST_START'),
                        position: 'html',

      Function registerMassActionEvent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerMassActionEvent(container) {
                  let thisInstance = this;
                  $('.masscopy', container).click((e) => {
                      let isChecked = $('.mass-selector', container).is(':checked');
                      if (isChecked) {

        Function registerOnChangeEventOfTargetModule has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerOnChangeEventOfTargetModule: function () {
                    var form = jQuery('#leadsMapping');
                    form.on('change', 'select.accountsFields.select2,select.contactFields.select2', function (e, executeChange) {
                        if (typeof executeChange === 'undefined') {
                            executeChange = true;

          Function registerSplitEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerSplitEvents: function (container, split) {
                      var rightSplitMaxWidth = (400 / this.windowW) * 100;
                      var minWindowWidth = (25 / this.windowW) * 100;
                      var maxWindowWidth = 100 - minWindowWidth;
                      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 registerSplitEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerSplitEvents: function (container, split) {
                        let rightSplitMaxWidth = (400 / this.windowW) * 100;
                        let minWindowWidth = (23 / this.windowW) * 100;
                        let maxWindowWidth = 100 - minWindowWidth;
                        let listPreview = container.find('.js-detail-preview');
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 2 hrs to fix

              Function submit has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  submit() {
                      let moduleName = app.getModuleName(),
                          recordId = app.getRecordId();
                      if (this.modal.find('[name="sourceModule"]').length > 0) {
                          moduleName = this.modal.find('[name="sourceModule"]').val();

                Function saveAjaxValidation has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        saveAjaxValidation: function (params) {
                            const aDeferred = $.Deferred();
                            if (this.getInstance().checkPreSaveValidation()) {
                                let paramsTemp = JSON.parse(JSON.stringify(params));
                                paramsTemp.data.mode = 'preSaveValidation';
                Severity: Major
                Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 2 hrs to fix

                  Function show has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          this.show = function () {
                              var className = 'bigLoading';
                              if (this.options.smallLoadingImage == true) {
                                  className = 'smallLoading';
                              }
                  Severity: Major
                  Found in public_html/layouts/resources/ProgressIndicator.js - About 2 hrs to fix

                    Function onShow has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            onShow: function () {
                                this.getContentElement('tab-source', 'file')
                                    .getInputElement()
                                    .$.setAttribute('accept', 'image/jpeg, image/png, image/gif');
                                /* Remove preview */

                      Function registerPostLoadEvents has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  registerPostLoadEvents(form, params, element) {
                                      const submitSuccessCallback = params.callbackFunction || function () {};
                                      const goToFullFormCallBack = params.goToFullFormcallback || function () {};
                                      form.on('submit', (e) => {
                                          if (form.hasClass('not_validation')) {
                      Severity: Major
                      Found in public_html/layouts/resources/app.js - About 2 hrs to fix

                        Method importUpdate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function importUpdate()
                            {
                                $dirName = 'cache/updates/updates';
                                $db = \App\Db::getInstance();
                                $startTime = microtime(true);
                        Severity: Major
                        Found in vtlib/Vtiger/PackageImport.php - About 2 hrs to fix

                          Method testAdvancedConditions has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function testAdvancedConditions()
                              {
                                  $moduleName = 'Accounts';
                                  $accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
                                  $contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
                          Severity: Major
                          Found in tests/App/QueryGenerator.php - About 2 hrs to fix

                            Method parseParams has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function parseParams(array $params)
                                {
                                    foreach ($params as $param => $value) {
                                        switch ($param) {
                                            case 'margin-top':
                            Severity: Major
                            Found in app/Pdf/Drivers/Base.php - About 2 hrs to fix

                              Method recalculateSharingRulesByUser has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function recalculateSharingRulesByUser($id)
                                  {
                                      $userModel = \App\User::getUserModel($id);
                                      if (!$userModel->getId()) {
                                          return null;
                              Severity: Major
                              Found in app/PrivilegeUtil.php - About 2 hrs to fix

                                Method getDisplayValue has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getDisplayValue($name)
                                    {
                                        $value = $this->get($name);
                                        switch ($name) {
                                            case 'server_id':
                                Severity: Major
                                Found in modules/Settings/WebserviceUsers/services/WebserviceStandard.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language