YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function doTask has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function doTask($recordModel)
    {
        if (!\App\Module::isModuleActive('Calendar')) {
            return;
        }
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTCreateEventTask.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 getNextTriggerTimeForMonthlyByDate has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNextTriggerTimeForMonthlyByDate($scheduledDayOfMonth, $scheduledTime)
    {
        $currentDayOfMonth = date('j', time());
        if ($scheduledDayOfMonth) {
            $scheduledDaysOfMonth = \App\Json::decode($scheduledDayOfMonth);
Severity: Minor
Found in modules/com_vtiger_workflow/Workflow.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 getAll has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAll($moduleName = '')
    {
        $query = (new App\Db\Query())->from('com_vtiger_workflow_tasktypes');
        $dataReader = $query->createCommand()->query();
        while ($rawData = $dataReader->read()) {
Severity: Minor
Found in modules/com_vtiger_workflow/VTTaskType.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 getQuery has a Cognitive Complexity of 22 (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/Calendar/models/Calendar.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 updateMailBoxCounter has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateMailBoxCounter(array $users): array
    {
        if (empty($users)) {
            return [];
        }
Severity: Minor
Found in modules/OSSMail/models/Record.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 syncAddressBooks has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncAddressBooks(): int
    {
        \App\Log::trace('AddressBooks start', __METHOD__);
        $dataReader = $this->getDavCardsToSync()->createCommand()->query();
        $create = $deletes = $updates = $skipped = 0;
Severity: Minor
Found in modules/API/models/CardDAV.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 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
        $fields = $moduleModel->getFields();
        $ids = $this->textParser->getParam('pdf')->getVariable('recordsId');
Severity: Minor
Found in modules/OSSTimeControl/textparsers/List.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 delete has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete()
    {
        switch ($this->typeSaving) {
            case self::UPDATE_ALL_EVENTS:
                $records = $this->getRecords($this->recordModel->get('followup'));
Severity: Minor
Found in modules/Calendar/models/RecuringEvents.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 findRecordsById has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function findRecordsById($ids)
    {
        $return = false;
        if (!empty($ids)) {
            $recordModelMailScanner = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
Severity: Minor
Found in modules/OSSMailView/models/Record.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 saveToDb has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveToDb()
    {
        $db = \App\Db::getInstance();
        $fileNameByField = 'filename';
        if ('I' === $this->get('filelocationtype')) {
Severity: Minor
Found in modules/Documents/models/Record.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 getRangeValues has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRangeValues()
    {
        $uiTypeModel = $this->getUITypeModel();
        if (method_exists($uiTypeModel, 'getRangeValues')) {
            return $uiTypeModel->getRangeValues();
Severity: Minor
Found in modules/Vtiger/models/Field.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 getQuery has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getQuery($filter)
    {
        $request = \App\Request::init();
        if ($this->getExtraData('relation_id') && $this->getExtraData('recordId')) {
            $relationModelInstance = Vtiger_Relation_Model::getInstanceById($this->getExtraData('relation_id'));
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 getCustomViewList has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomViewList(): array
    {
        if (isset($this->customViewList)) {
            return $this->customViewList;
        }
Severity: Minor
Found in modules/Vtiger/models/Relation.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 convert has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convert(array $entries): array
    {
        $columns = array_keys($this->columns);
        $fieldName = $this->fieldModel->getName();
        $columnCounter = $records = $sum = [];
Severity: Minor
Found in modules/Vtiger/views/Kanban.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 getColumnNames has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getColumnNames(): array
    {
        $headers = [];
        $selectedColumnsList = [];
        if ($cvId = $this->controller->request->getHeader('x-cv-id')) {
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RecordsList.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 22 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $db = App\Db::getInstance();
        $dataReader = (new App\Db\Query())->from('u_#__openstreetmap_record_updater')
            ->limit(App\Config::module('OpenStreetMap', 'cronMaxUpdatedAddresses'))
Severity: Minor
Found in modules/OpenStreetMap/crons/UpdaterRecordsCoordinates.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 registerAjaxParams has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerAjaxParams(selectElement, params) {
            params.tags = false;
            params.language.searching = function () {
                return app.vtranslate('JS_SEARCHING');
            };
Severity: Major
Found in public_html/layouts/resources/Fields.js - About 3 hrs to fix

    Method loadJoin has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function loadJoin()
        {
            $tableJoin = [];
            $moduleTableIndexList = $this->entityModel->tab_name_index;
            $baseTable = $this->entityModel->table_name;
    Severity: Major
    Found in app/QueryGenerator.php - About 3 hrs to fix

      File Cron.php has 294 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: Minor
      Found in vtlib/Vtiger/Cron.php - About 3 hrs to fix

        File Condition.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Condition main class.
         *
        Severity: Minor
        Found in app/Condition.php - About 3 hrs to fix
          Severity
          Category
          Status
          Source
          Language