YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    protected static function initMailPart($mbox, $mail, $partStructure, $partNum)
    {
        if ($partNum) {
            \App\Log::beginProfile(__METHOD__ . '|imap_fetchbody', 'Mail|IMAP');
            $data = $orgData = imap_fetchbody($mbox, $mail['id'], $partNum, FT_UID | FT_PEEK);
Severity: Minor
Found in modules/OSSMail/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

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

    public static function getComposeParam(App\Request $request)
    {
        $moduleName = $request->getByType('crmModule');
        $record = $request->getInteger('crmRecord');
        $type = $request->getByType('type');
Severity: Minor
Found in modules/OSSMail/models/Module.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 getFieldsStructure has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldsStructure(array $block): array
    {
        $fields = [];
        foreach ($block['fields'] as $field) {
            if (\is_array($field) && 'relatedField' === $field['type']) {
Severity: Minor
Found in modules/Vtiger/models/ProcessWizard.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 autoLink has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

            autoLink() {
                let fillChar = '\u200B';
                let sel = window.getSelection(),
                    range = sel.getRangeAt(0).cloneRange(),
                    offset,
Severity: Minor
Found in public_html/layouts/resources/Fields.js - 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 save has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    public function save(App\Request $request)
    {
        $workflowId = !$request->isEmpty('for_workflow') ? $request->getInteger('for_workflow') : 0;
        if (!empty($workflowId)) {
            $record = !$request->isEmpty('task_id') ? $request->getInteger('task_id') : 0;
Severity: Minor
Found in modules/Settings/Workflows/actions/TaskAjax.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

Chat has 63 functions (exceeds 20 allowed). Consider refactoring.
Open

final class Chat
{
    /**
     * Information about allowed types of rooms.
     */
Severity: Major
Found in app/Chat.php - About 1 day to fix

    Function isPermitted has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function isPermitted(string $moduleName, $actionName = null, $record = false, $userId = false)
        {
            if (!$userId) {
                $user = \App\User::getCurrentUserModel();
            } else {
    Severity: Minor
    Found in api/webservice/WebservicePremium/Privilege.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 RelationListView.php has 543 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: Major
    Found in modules/Vtiger/models/RelationListView.php - About 1 day to fix

      `` has 62 functions (exceeds 20 allowed). Consider refactoring.
      Open

          {
              container: false,
              plotContainer: false,
              chartInstance: false,
              chartData: [],

        Vtiger_ChartFilter_Model has 62 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Vtiger_ChartFilter_Model extends \App\Base
        {
            /**
             * Widget model.
             *
        Severity: Major
        Found in modules/Vtiger/models/ChartFilter.php - About 1 day to fix

          Function ajaxEditHandling has 224 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  ajaxEditHandling: function (currentTdElement) {
                      const thisInstance = this;
                      let readRecord = $('.setReadRecord'),
                          detailViewValue = $('.value', currentTdElement),
                          editElement = $('.edit', currentTdElement),
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 1 day to fix

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

            <?php
            
            /**
             * OSSMailScanner Record model class.
             *
            Severity: Major
            Found in modules/OSSMailScanner/models/Record.php - About 1 day to fix

              File CalendarView.js has 539 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 representing a standard calendar.
              Severity: Major
              Found in public_html/layouts/basic/modules/Vtiger/resources/CalendarView.js - About 1 day to fix

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

                    public function process(App\Request $request)
                    {
                        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
                        }
                Severity: Minor
                Found in include/main/WebUI.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 doTask has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function doTask($recordModel)
                    {
                        $moduleName = $recordModel->getModuleName();
                        $recordId = $recordModel->getId();
                        $entityType = $this->entity_type;
                Severity: Minor
                Found in modules/com_vtiger_workflow/tasks/VTCreateEntityTask.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 TextParser.php has 538 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * TextParser test file.
                 *
                 * @package   Tests
                Severity: Major
                Found in tests/App/TextParser.php - About 1 day to fix

                  File ListView.php has 536 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/Vtiger/models/ListView.php - About 1 day to fix

                    `` has 61 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                        {
                            selectedRelatedTabElement: false,
                            parentRecordId: false,
                            parentModuleName: false,
                            moduleName: false,
                    Severity: Major
                    Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 1 day to fix

                      `` has 61 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                          {
                              formElement: false,
                              relationOperation: '',
                              moduleName: app.getModuleName(),
                              getForm: function () {
                      Severity: Major
                      Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 1 day to fix

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

                            public function process()
                            {
                                $html = '';
                                if (!$this->textParser->recordModel->getModule()->isInventory()) {
                                    return $html;
                        Severity: Minor
                        Found in app/TextParser/ProductsTableLongVTwoLang.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