YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $record = $request->getInteger('record');
        $recordModel = Vtiger_Record_Model::getInstanceById($record, $moduleName);
Severity: Minor
Found in modules/Vtiger/views/QuickEditModal.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 getPagination has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPagination(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $cvId = $request->getByType('viewname', 2);
        $pageNumber = $request->getInteger('page');
Severity: Minor
Found in modules/Vtiger/views/Pagination.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 getHistory has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getHistory()
    {
        $results = (new \App\Db\Query())->from('u_#__browsinghistory')
            ->where(['userid' => App\User::getCurrentUserId()])
            ->orderBy(['id' => SORT_DESC])
Severity: Minor
Found in modules/Vtiger/helpers/BrowsingHistory.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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request, $widget = null)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Vtiger/dashboards/Rss.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 validate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, string $columnName, bool $isUserFormat, $originalValue = null)
    {
        if ($columnName === $this->getColumnName()) {
            if ($isUserFormat) {
                $value = $this->getDBValue($value, $columnName);
Severity: Minor
Found in modules/Vtiger/inventoryfields/Tax.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 getQuery has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQuery()
    {
        $queryGenerator = new App\QueryGenerator($this->getModuleName());
        if ($this->has('customFilter')) {
            $queryGenerator->initForCustomViewById($this->get('customFilter'));
Severity: Minor
Found in modules/Reservations/models/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 process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request, $widget = null)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $data = $request->getAll();
Severity: Minor
Found in modules/Vtiger/dashboards/MiniList.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 getChild has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChild(int $id, array &$childRow, int $depthBase): array
    {
        \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase === \App\Config::module('HelpDesk', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChild 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 process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request, $widget = null)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        if ($widget && !$request->has('widgetid')) {
Severity: Minor
Found in modules/Vtiger/dashboards/Multifilter.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 getRecords has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecords(\App\QueryGenerator $mainQueryGenerator, int $parentId, string $type = 'child'): void
    {
        if (0 === $this->limit || isset($this->recursion[$parentId][$type])) {
            return;
        }
Severity: Minor
Found in api/webservice/WebservicePremium/BaseModule/Hierarchy.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 get has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function get(): array
    {
        $return = parent::get();
        if ($this->controller->headers['x-header-fields'] ?? 0) {
            $fieldsHeader = [];
Severity: Minor
Found in api/webservice/WebservicePremium/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

Function getProject has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function getProject($id, $viewName = null)
    {
        if (!\is_array($id) && isset($this->tasksById[$id])) {
            return [$this->tasksById[$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 registerContextHelp has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerContextHelp: function () {
            $(document).on('click', '.js-context-help', function (e) {
                const customConfig = {
                    toolbar: 'Min'
                };

    File LeadMapping.js has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*+***********************************************************************************
     * 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
     * The Initial Developer of the Original Code is vtiger.

      Function registerRowsEvent has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerRowsEvent: function () {
                  const self = this;
                  if (this.relatedView === 'List' || this.relatedView === 'Detail') {
                      this.content.find('.listViewEntries').on('click', function (e) {
                          if ($(e.target).hasClass('js-no-link')) return;
      Severity: Major
      Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 2 hrs to fix

        Function loadChart has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        loadChart: function () {
                            var data = $('.sumaryRelatedTimeControl .widgetData').val();
                            if (data == undefined || data == '') {
                                return false;
                            }

          Function registerMobileEvents has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  registerMobileEvents: function () {
                      const self = this,
                          container = this.getContentsContainer();
                      $('.rightHeaderBtnMenu').on('click', function () {
                          self.hideActionMenu();
          Severity: Major
          Found in public_html/layouts/basic/modules/Vtiger/resources/Header.js - About 2 hrs to fix

            Function registerSubmitForm has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    registerSubmitForm: function () {
                        let self = this;
                        self.container.on('click', "[name='saveButton']", (e) => {
                            let formMapping = self.container.find('form.js-form-converter');
                            if (formMapping.validationEngine('validate')) {
            Severity: Major
            Found in public_html/layouts/basic/modules/Vtiger/resources/RecordConverter.js - About 2 hrs to fix

              Function updateActivityState has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      updateActivityState: function (currentTarget) {
                          let params = {
                              module: 'Calendar',
                              action: 'ActivityStateAjax',
                              record: currentTarget.data('id'),

                Function registerAutoCompleteFields has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        registerAutoCompleteFields: function (container) {
                            let thisInstance = this;
                            let formElement = container.closest('form');
                            container.find('input.autoComplete').autocomplete({
                                delay: '600',
                Severity: Major
                Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language