YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function addTimeControl has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        addTimeControl: function (params) {
            let aDeferred = jQuery.Deferred();
            let referenceModuleName = 'OSSTimeControl';
            let parentId = params.recordId;
            let parentModule = 'HelpDesk';
Severity: Minor
Found in public_html/layouts/basic/modules/HelpDesk/resources/Edit.js - 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 __create has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function __create($blockInstance)
    {
        $db = \App\Db::getInstance();
        $this->block = $blockInstance;
        $moduleInstance = $this->getModuleInstance();
Severity: Minor
Found in vtlib/Vtiger/FieldBasic.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 unzip has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function unzip($toDir, bool $close = true)
    {
        if (\is_string($toDir)) {
            $toDir = [$toDir];
        }
Severity: Minor
Found in app/Zip.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 computeLabels has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static function computeLabels($moduleName, $ids, $search = false): ?array
    {
        if (empty($moduleName) || empty($ids)) {
            return [];
        }
Severity: Minor
Found in app/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 db has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static function db(): array
    {
        $benchmarkCountGroup = 20;
        $insertCountGroup = 5;
        $updateCountGroup = 5;
Severity: Minor
Found in app/Utils/Benchmarks.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 save has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function save($mapping)
    {
        $db = \App\Db::getInstance();
        $deleteMappingsList = $updateMappingsList = $createMappingsList = [];
        foreach ($mapping as $mappingDetails) {
Severity: Minor
Found in modules/Settings/Leads/models/Mapping.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 25 (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/DetailedList.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        \App\Log::trace('Start SendReminder');
        $dataReader = (new \App\Db\Query())->select([
            'vtiger_crmentity.smownerid',
Severity: Minor
Found in modules/Calendar/crons/SendReminder.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 reviewChanges has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function reviewChanges()
    {
        $db = \App\Db::getInstance();
        $recordsList = $this->getRecords();
        if (!empty($recordsList)) {
Severity: Minor
Found in modules/ModTracker/crons/ReviewChanges.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 uploadTempFile has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function uploadTempFile(array $files, int $recordId, ?string $hash = null)
    {
        $db = \App\Db::getInstance();
        $attach = [];
        $type = 'image';
Severity: Minor
Found in modules/Vtiger/uitypes/MultiImage.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 getImage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getImage()
    {
        $image = [];
        if (!$this->isEmpty('imagename') && \App\Json::isJson($this->get('imagename')) && !\App\Json::isEmpty($this->get('imagename'))) {
            $image = \App\Json::decode($this->get('imagename'));
Severity: Minor
Found in modules/Vtiger/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 getStructure has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStructure()
    {
        if (!empty($this->structuredValues)) {
            return $this->structuredValues;
        }
Severity: Minor
Found in modules/Vtiger/models/DetailRecordStructure.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 getRelationField has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelationField()
    {
        if ($this->has('RelationField')) {
            return $this->get('RelationField');
        }
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 getOwners has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOwners(App\Request $request): void
    {
        if (!App\Config::performance('SEARCH_OWNERS_BY_AJAX')) {
            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/Vtiger/actions/Fields.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 getRelatedListPageCount has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedListPageCount(App\Request $request)
    {
        $moduleName = $request->getModule();
        $relatedModuleName = $request->getArray('relatedModule', 'Alnum');
        $firstRelatedModuleName = current($relatedModuleName);
Severity: Minor
Found in modules/Vtiger/actions/RelationAjax.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 entityAfterSave has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityAfterSave(App\EventHandler $eventHandler): void
    {
        $typeAddressToUpdate = [];
        $recordModel = $eventHandler->getRecordModel();
        if (!$recordModel->isNew()) {
Severity: Minor
Found in modules/OpenStreetMap/handlers/OpenStreetMapHandler.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 getRecordFromRow has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRecordFromRow(array $row): array
    {
        $record = ['recordLabel' => \App\Record::getLabel($row['id'])];
        if ($this->fields) {
            $moduleModel = reset($this->fields)->getModule();
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 initEditView has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    initEditView: function () {
        function toggleEditViewTableRow(e) {
            var target = jQuery(e.currentTarget);
            var container = jQuery('[data-togglecontent="' + target.data('togglehandler') + '"]');
            var closestTrElement = container.closest('tr');

    Method process has 89 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/ProductsTableCorrectingBefore.php - About 3 hrs to fix

      Method evaluate has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function evaluate($condition, Vtiger_Record_Model $recordModel)
          {
              $expr = \App\Json::decode($condition);
              $finalResult = true;
              if (\is_array($expr)) {
      Severity: Major
      Found in modules/com_vtiger_workflow/VTJsonCondition.php - About 3 hrs to fix
        Severity
        Category
        Status
        Source
        Language