YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getFieldsTypes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldsTypes(): array
    {
        $moduleName = $this->getModuleName();
        if (\App\Cache::has(__METHOD__, $moduleName)) {
            $inventoryTypes = \App\Cache::get(__METHOD__, $moduleName);
Severity: Minor
Found in modules/Vtiger/models/Inventory.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 getWatchingUsers has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function getWatchingUsers($restrictUsers = [])
    {
        if (!$this->watchingUsers) {
            $users = $this->getModuleUsers();
            if ($this->has('record')) {
Severity: Minor
Found in modules/Vtiger/models/Watchdog.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 getReference has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function getReference(App\Request $request): void
    {
        if ($request->has('fieldName')) {
            $fieldModel = Vtiger_Module_Model::getInstance($request->getModule())->getFieldByName($request->getByType('fieldName', 2));
            if (empty($fieldModel) || !$fieldModel->isActiveField() || !$fieldModel->isViewEnabled()) {
Severity: Minor
Found in modules/Vtiger/actions/Fields.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 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $recordIds = self::getRecordsListFromRequest($request);
        $skipped = [];
Severity: Minor
Found in modules/Vtiger/actions/MassState.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 sendMails has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendMails(App\Request $request): void
    {
        $moduleName = $request->getModule();
        $field = $request->getByType('field', 'Alnum');
        $sourceModule = $request->getByType('sourceModule', 'Alnum');
Severity: Minor
Found in modules/Vtiger/actions/Mail.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 getParent has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/HelpDesk/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 read has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function read()
    {
        $defaultCharset = App\Config::main('default_charset');

        $filePath = $this->getFilePath();
Severity: Minor
Found in modules/Import/readers/VCardReader.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 cleanup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private function cleanup($tasks)
    {
        $clean = [];
        foreach ($tasks as $task) {
            if (0 !== $task['id']) {
Severity: Minor
Found in modules/Project/models/Gantt.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 getRawDataFromRow has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRawDataFromRow(array $row): array
    {
        foreach ($this->fields as $fieldName => $fieldModel) {
            if (\array_key_exists($fieldName, $row)) {
                $row[$fieldName] = $fieldModel->getUITypeModel()->getRawValue($row[$fieldName]);
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/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 normalizeParents has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    private function normalizeParents()
    {
        // not set parents are children of root node
        foreach ($this->tasks as &$task) {
            if (!isset($task['parent']) && 0 !== $task['id']) {
Severity: Minor
Found in modules/Project/models/Gantt.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 CalendarView.js has 267 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 an extended calendar.
 * @extends Calendar_Calendar_Js
Severity: Minor
Found in public_html/layouts/basic/modules/Calendar/resources/CalendarView.js - About 2 hrs to fix

    File CalDAV.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Api CalDAV Model Class.
     *
    Severity: Minor
    Found in modules/API/models/CalDAV.php - About 2 hrs to fix

      Function registerAddCustomFieldEvent has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerAddCustomFieldEvent() {
                  const thisInstance = this;
                  let contents = this.container.find('.contents');
                  contents.find('.addCustomField').on('click', (e) => {
                      let blockId = $(e.currentTarget).closest('.editFieldsTable').data('blockId'),

        Function registerStep2 has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                registerStep2: function (container, blockId) {
                    let thisInstance = this;
                    let containerInventory = thisInstance.getInventoryViewLayout();
                    let form = container.find('form');
                    let selectedModule = this.container.find('[name="layoutEditorModules"]').val();

          Function showFormToEditKey has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  showFormToEditKey: function (id, type) {
                      var thisInstance = this;
                      var params = {
                          module: app.getModuleName(),
                          parent: app.getParentModuleName(),

            Function getUi has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    getUi: function () {
                        let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
                            dateSpecificConditions = this.get('dateSpecificConditions'),
                            html,
                            element;

              Function registerEventForModal has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      registerEventForModal: function (container) {
                          const self = this;
                          let table = app.registerDataTables(container.find('.js-watching-data-table'));
                          app.showPopoverElementView(container.find('.infoPopover'));
                          container.on('switchChange.bootstrapSwitch', '.sendNotificationsSwitch', function (e, state) {

                Function getUi has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        getUi: function () {
                            let comparatorSelectedOptionVal = this.get('comparatorElementVal'),
                                dateSpecificConditions = this.get('dateSpecificConditions'),
                                html,
                                element;
                Severity: Major
                Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilterEx.js - About 2 hrs to fix

                  Function loadWidget has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          loadWidget: function (widgetContainer, params) {
                              const thisInstance = this,
                                  contentContainer = $('.js-detail-widget-content', widgetContainer);
                              let relatedModuleName;
                              this.registerFilterForAddingModuleRelatedRecordFromSummaryWidget(widgetContainer);
                  Severity: Major
                  Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js - About 2 hrs to fix

                    Function registerEventForCopyAddress has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            registerEventForCopyAddress: function () {
                                let thisInstance = this;
                                this.formElement
                                    .find(
                                        '.js-toggle-panel:not(.inventoryHeader):not(.inventoryItems) .fieldValue, .js-toggle-panel:not(.inventoryHeader):not(.inventoryItems) .fieldLabel'
                    Severity: Major
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language