YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function setSmtp has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function setSmtp(): void
    {
        if (!$this->smtp) {
            throw new \App\Exceptions\AppException('ERR_NO_SMTP_CONFIGURATION');
        }
Severity: Minor
Found in app/Mailer.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 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        \App\Log::trace('Start ' . __METHOD__);
        $qualifiedModule = $request->getModule(false);
        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Settings/PDF/views/Import.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 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $result = false;
        $fileContent = '';
        if ($request->isEmpty('type') || $request->isEmpty('libraryName')) {
Severity: Minor
Found in modules/Settings/Dependencies/views/LibraryMoreInfo.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 davSync has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function davSync(): int
    {
        $create = $updates = 0;
        foreach ($this->davUsers as $userId => $user) {
            $this->calendarId = $user->get('calendarsid');
Severity: Minor
Found in modules/API/models/CalDAV.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 getChartData has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChartData()
    {
        $this->setUpModelFields();
        if ('Table' === $this->chartType) {
            return $this->getRows();
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 getRecords has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecords($user)
    {
        $this->initListViewController();
        if (!$user) {
            $user = App\User::getCurrentUserId();
Severity: Minor
Found in modules/Vtiger/models/MiniList.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 registerCommentEvents has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerCommentEvents(detailContentsHolder) {
            const self = this;
            detailContentsHolder.on('click', '.js-close-comment-block', function (e) {
                let commentInfoBlock = $(e.currentTarget.closest('.js-comment-single'));
                commentInfoBlock.find('.js-comment-container').show();
Severity: Major
Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 3 hrs to fix

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

        public function getDetailViewLinks(array $linkParams): array
        {
            $recordModel = $this->getRecord();
            $linkModelList = parent::getDetailViewLinks($linkParams);
            unset($linkModelList['DETAIL_VIEW_ADDITIONAL']);
    Severity: Major
    Found in modules/OSSMailView/models/DetailView.php - About 3 hrs to fix

      File RecordsList.js has 308 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(
          'Base_RecordsList_JS',
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/RecordsList.js - About 3 hrs to fix

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

        <?php
        
        /**
         * Automatic Assignment Record Model Class.
         *
        Severity: Minor
        Found in modules/Settings/AutomaticAssignment/models/Record.php - About 3 hrs to fix

          Function registerTabEvents has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerTabEvents: function (contentContainer = $('.js-tab.active')) {
                      const self = this;
                      let mode = contentContainer.attr('id');
                      let table = this.registerDataTable(contentContainer);
                      table.off('click', '.js-details').on('click', '.js-details', function () {
          Severity: Major
          Found in public_html/layouts/basic/modules/Settings/MailRbl/resources/Index.js - About 3 hrs to fix

            Function registerListEvents has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerListEvents: function () {
                        const self = this;
                        let additional = this.container.find('.js-additional-informations').val() == 1;
                        self.container.on('click', '.js-select-row', function (e) {
                            if ($(e.target).hasClass('js-select-checkbox') || $(e.target).hasClass('u-cursor-auto')) {
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/RecordsList.js - About 3 hrs to fix

              Function registerInviteEvent has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerInviteEvent: function (editViewForm) {
                          this.registerRow(editViewForm);
                          let participantsContent = editViewForm.find('.js-participants-content');
                          let participantsSearch = editViewForm.find('.js-participants-search');
                          $.widget('custom.ivAutocomplete', $.ui.autocomplete, {
              Severity: Major
              Found in public_html/layouts/basic/modules/Calendar/resources/Edit.js - About 3 hrs to fix

                Function render has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        render: function () {
                            var self = this;
                
                            this.$list = new ListWidget({
                                itemRenderer: function (li, value) {
                Severity: Major
                Found in public_html/layouts/resources/debugbar/logs.js - About 3 hrs to fix

                  Method importFont has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function importFont($zipfile)
                      {
                          $fontsDir = ROOT_DIRECTORY . '/public_html/layouts/resources/fonts';
                          $zip = \App\Zip::openFile($zipfile, ['onlyExtensions' => ['ttf', 'txt', 'woff']]);
                          $files = $zip->unzip(['fonts' => $fontsDir]);
                  Severity: Major
                  Found in vtlib/Vtiger/PackageImport.php - About 3 hrs to fix

                    Method process has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function process()
                        {
                            $html = '';
                            if (!$this->textParser->recordModel->getModule()->isInventory()) {
                                return $html;
                    Severity: Major
                    Found in app/TextParser/ProductsTableLongVersion.php - About 3 hrs to fix

                      Method getPrivilegeQuery has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getPrivilegeQuery(Db\Query $query, $moduleName, $user = false, $relatedRecord = null)
                          {
                              if ($user && $user instanceof User) {
                                  $userId = $user->getId();
                              } elseif (!$user) {
                      Severity: Major
                      Found in app/PrivilegeQuery.php - About 3 hrs to fix

                        Method process has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function process()
                            {
                                $html = '';
                                if (!$this->textParser->recordModel->getModule()->isInventory()) {
                                    return $html;
                        Severity: Major
                        Found in app/TextParser/ProductsTableNew.php - About 3 hrs to fix

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

                              public function getDetailViewLinks(array $linkParams): array
                              {
                                  $currentUserModel = \App\User::getCurrentUserModel();
                                  $recordModel = $this->getRecord();
                                  $recordId = $recordModel->getId();
                          Severity: Major
                          Found in modules/Users/models/DetailView.php - About 3 hrs to fix

                            Method getFreeTimeInDay has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getFreeTimeInDay(string $day, string $activityType, int $ownerId = null)
                                {
                                    $currentUser = empty($ownerId) ? \App\User::getCurrentUserModel() : \App\User::getUserModel($ownerId);
                                    if (empty($activityType)) {
                                        $activityType = $currentUser->get('defaultactivitytype');
                            Severity: Major
                            Found in modules/Calendar/actions/GetFreeTime.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language