YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Function getStructure has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStructure()
    {
        if (!empty($this->structuredValues)) {
            return $this->structuredValues;
        }
Severity: Minor
Found in modules/Users/models/DetailRecordStructure.php - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function save()
    {
        $db = \App\Db::getInstance();
        $settingsModel = Settings_Menu_Module_Model::getInstance();
        $edit = $this->get('edit');
Severity: Minor
Found in modules/Settings/Menu/models/Record.php - About 5 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 createXml has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function createXml($entries, $entriesInventory)
    {
        $exportBlockName = \App\Config::component('Export', 'BLOCK_NAME');
        $xml = new \XMLWriter();
        $xml->openMemory();
Severity: Minor
Found in modules/Vtiger/models/ExportToXml.php - About 5 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 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $relatedModuleName = $request->getByType('relatedModule', 2);
        $parentId = $request->getInteger('record');
Severity: Minor
Found in modules/Vtiger/views/RelatedList.php - About 5 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 getFirstRowData has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFirstRowData($hasHeader = true)
    {
        $isInventory = $this->moduleModel->isInventory();
        $rowData = $headers = $standardData = $inventoryData = [];
        foreach ($this->data as $currentRow => $data) {
Severity: Minor
Found in modules/Import/readers/CSVReader.php - About 5 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 createQuery has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

    public function createQuery(): void
    {
        $moduleName = $this->controller->request->getModule();
        $this->queryGenerator = new \App\QueryGenerator($moduleName);
        if ($cvId = $this->controller->request->getHeader('x-cv-id')) {
Severity: Minor
Found in api/webservice/WebserviceStandard/BaseModule/RecordsList.php - About 5 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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        calculateValues: function () {
            //handled advanced filters saved values.
            var enableFilterElement = $('#enableAdvanceFilters');
            if (enableFilterElement.length > 0 && enableFilterElement.is(':checked') == false) {
                $('#advanced_filter').val($('#olderConditions').val());
public_html/layouts/basic/modules/Settings/MappedFields/resources/Edit3.js on lines 42..52
public_html/layouts/basic/modules/Settings/Workflows/resources/Edit2.js on lines 54..64

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        displayHierarchyResponseData: function (data) {
            let callbackFunction = function (data) {
                app.showScrollBar($('#hierarchyScroll'), {
                    height: '300px',
                    railVisible: true,
public_html/layouts/basic/modules/IStorages/resources/Detail.js on lines 32..46
public_html/layouts/basic/modules/MultiCompany/resources/Detail.js on lines 32..46

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        displayHierarchyResponseData: function (data) {
            let callbackFunction = function (data) {
                app.showScrollBar($('#hierarchyScroll'), {
                    height: '300px',
                    railVisible: true,
public_html/layouts/basic/modules/IStorages/resources/Detail.js on lines 32..46
public_html/layouts/basic/modules/SSalesProcesses/resources/Detail.js on lines 36..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        calculateValues: function () {
            //handled advanced filters saved values.
            var enableFilterElement = jQuery('#enableAdvanceFilters');
            if (enableFilterElement.length > 0 && enableFilterElement.is(':checked') == false) {
                jQuery('#advanced_filter').val(jQuery('#olderConditions').val());
public_html/layouts/basic/modules/Settings/PDF/resources/Edit3.js on lines 79..89
public_html/layouts/basic/modules/Settings/Workflows/resources/Edit2.js on lines 54..64

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        calculateValues: function () {
            //handled advanced filters saved values.
            var enableFilterElement = jQuery('#enableAdvanceFilters');
            if (enableFilterElement.length > 0 && enableFilterElement.is(':checked') == false) {
                jQuery('#advanced_filter').val(jQuery('#olderConditions').val());
public_html/layouts/basic/modules/Settings/MappedFields/resources/Edit3.js on lines 42..52
public_html/layouts/basic/modules/Settings/PDF/resources/Edit3.js on lines 79..89

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

        displayHierarchyResponseData: function (data) {
            let callbackFunction = function (data) {
                app.showScrollBar($('#hierarchyScroll'), {
                    height: '300px',
                    railVisible: true,
public_html/layouts/basic/modules/MultiCompany/resources/Detail.js on lines 32..46
public_html/layouts/basic/modules/SSalesProcesses/resources/Detail.js on lines 36..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 140.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File MultiAttachment.php has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * UIType Multi Attachment Field File.
 *
 * @package   UIType
Severity: Minor
Found in modules/Vtiger/uitypes/MultiAttachment.php - About 5 hrs to fix

    Method showRelatedRecords has 131 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function showRelatedRecords(App\Request $request)
        {
            $parentId = $request->getInteger('record');
            $pageNumber = $request->getInteger('page');
            $relationId = $request->isEmpty('relationId') ? false : $request->getInteger('relationId');
    Severity: Major
    Found in modules/Vtiger/views/Detail.php - About 5 hrs to fix

      Method initializeContent has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function initializeContent(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $this->moduleName = $request->getModule();
              $this->sourceModule = $request->getByType('src_module', 2);
      Severity: Major
      Found in modules/Vtiger/views/RecordsList.php - About 5 hrs to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                            basic: {
                                maintainAspectRatio: false,
                                title: {
                                    display: false
                                },
        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 957..995

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 139.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                            basic: {
                                maintainAspectRatio: false,
                                title: {
                                    display: false
                                },
        public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 1083..1121

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 139.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                showPagingInfo: function () {
                    let totalNumberOfRecords = jQuery('#totalCount').val();
                    let pageNumberElement = jQuery('.pageNumbersText');
                    let pageRange = pageNumberElement.text();
                    let newPagingInfo = pageRange + ' (' + totalNumberOfRecords + ')';
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/Detail.js and 1 other location - About 5 hrs to fix
        public_html/layouts/basic/modules/Vtiger/resources/List.js on lines 1805..1816

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 139.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                showPagingInfo: function () {
                    let totalNumberOfRecords = $('#totalCount').val();
                    let pageNumberElement = $('.pageNumbersText');
                    let pageRange = pageNumberElement.text();
                    let newPagingInfo = pageRange + ' (' + totalNumberOfRecords + ')';
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/List.js and 1 other location - About 5 hrs to fix
        public_html/layouts/basic/modules/Vtiger/resources/Detail.js on lines 1830..1841

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 139.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Vtiger_Cache has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Vtiger_Cache
        {
            private static $selfInstance = false;
            public static $cacheEnable = true;
            protected $connector;
        Severity: Minor
        Found in include/runtime/Cache.php - About 5 hrs to fix
          Severity
          Category
          Status
          Source
          Language