YetiForceCompany/YetiForceCRM

View on GitHub

Showing 306,333 of 306,333 total issues

Method saveModulePermissions has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function saveModulePermissions($moduleModel, $permissions)
    {
        $db = \App\Db::getInstance();
        $dbCommand = $db->createCommand();
        $profileId = $this->getId();
Severity: Major
Found in modules/Settings/Profiles/models/Record.php - About 4 hrs to fix

    Function record has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function record($params, $isPermitted = true)
        {
            if (!isset($this->recordModel) || ($isPermitted && !Privilege::isPermitted($this->moduleName, 'DetailView', $this->record))) {
                return '';
            }
    Severity: Minor
    Found in app/TextParser.php - About 4 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 getRelatedVariable has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRelatedVariable($fieldType = false, $skipEmpty = false)
        {
            $cacheKey = "{$this->moduleName}|$fieldType|{$skipEmpty}";
            if (isset(static::$relatedVariable[$cacheKey])) {
                return static::$relatedVariable[$cacheKey];
    Severity: Minor
    Found in app/TextParser.php - About 4 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 clear has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function clear(): void
        {
            if ('TEST' === getenv('INSTALL_MODE')) {
                return;
            }
    Severity: Minor
    Found in app/Installer/Composer.php - About 4 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 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function process(): string
        {
            $html = '';
            $moduleName = $this->params[0];
            if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
    Severity: Minor
    Found in app/TextParser/UserNewRecords.php - About 4 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 getQuickCreateModules has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getQuickCreateModules($restrictList = false, $tree = false): array
        {
            $restrictListString = $restrictList ? 1 : 0;
            if ($tree) {
                $userModel = \App\User::getCurrentUserModel();
    Severity: Minor
    Found in app/Module.php - About 4 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 importDataFromXML has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function importDataFromXML($uploadedXml)
        {
            $combine = ['tabid' => 'source', 'reltabid' => 'target'];
            $instances = [];
            $i = 0;
    Severity: Minor
    Found in modules/Settings/MappedFields/models/Module.php - About 4 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 queueScheduledWorkflowTasks has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function queueScheduledWorkflowTasks()
        {
            $default_timezone = App\Config::main('default_timezone');
            $vtWorflowManager = new VTWorkflowManager();
            $taskQueue = new VTTaskQueue();
    Severity: Minor
    Found in modules/com_vtiger_workflow/WorkFlowScheduler.php - About 4 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 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function entityAfterSave(App\EventHandler $eventHandler)
        {
            if (!ModTracker::isTrackingEnabledForModule($eventHandler->getModuleName())) {
                return false;
            }
    Severity: Minor
    Found in modules/ModTracker/handlers/ModTrackerHandler.php - About 4 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 33 (exceeds 5 allowed). Consider refactoring.
    Open

        public function process()
        {
            $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_PRIVILEGES_UPDATER');
            $query = (new \App\Db\Query())->select(['crmid', 'setype'])
                ->from('vtiger_crmentity')
    Severity: Minor
    Found in modules/Vtiger/crons/PrivilegesUpdater.php - About 4 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

            getHierarchyResponseData: function (params) {
                let thisInstance = this,
                    aDeferred = $.Deferred();
                if (!$.isEmptyObject(thisInstance.hierarchyResponseCache)) {
                    aDeferred.resolve(thisInstance.hierarchyResponseCache);
    public_html/layouts/basic/modules/Contacts/resources/Detail.js on lines 59..72
    public_html/layouts/basic/modules/Project/resources/Detail.js on lines 61..73

    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 133.

    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

            getHierarchyResponseData: function (params) {
                let thisInstance = this,
                    aDeferred = $.Deferred();
                if (!$.isEmptyObject(thisInstance.hierarchyResponseCache)) {
                    aDeferred.resolve(thisInstance.hierarchyResponseCache);
    public_html/layouts/basic/modules/Contacts/resources/Detail.js on lines 59..72
    public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 50..62

    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 133.

    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

            getHierarchyResponseData: function (params) {
                let thisInstance = this,
                    aDeferred = jQuery.Deferred();
    
                if (!$.isEmptyObject(thisInstance.hierarchyResponseCache)) {
    public_html/layouts/basic/modules/HelpDesk/resources/Detail.js on lines 50..62
    public_html/layouts/basic/modules/Project/resources/Detail.js on lines 61..73

    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 133.

    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

    Function registerMiniListWidget has 122 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            registerMiniListWidget: function () {
                const thisInstance = this;
                $('.dashboardHeading')
                    .off('click', '.js-add-filter')
                    .on('click', '.js-add-filter', function (e) {
    Severity: Major
    Found in public_html/layouts/basic/modules/Vtiger/resources/DashBoard.js - About 4 hrs to fix

      Function registerCalendar has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerCalendar: function () {
                  const self = this,
                      container = this.getContainer();
                  //Default time format
                  let userTimeFormat = CONFIG.hourFormat;

        Method getRecordListViewLinksLeftSide has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRecordListViewLinksLeftSide()
            {
                if (!$this->isViewable()) {
                    return [];
                }
        Severity: Major
        Found in modules/Vtiger/models/Record.php - About 4 hrs to fix

          File Menu.js has 369 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';
          
          jQuery.Class(
              'Settings_Menu_Index_Js',
          Severity: Minor
          Found in public_html/layouts/basic/modules/Settings/Menu/resources/Menu.js - About 4 hrs to fix

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

            Vtiger_Field_Js(
                'Vtiger_Time_Field_Js',
                {},
                {
                    /**
            Severity: Major
            Found in public_html/layouts/resources/Field.js and 1 other location - About 4 hrs to fix
            public_html/layouts/resources/Field.js on lines 271..301

            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 132.

            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

                                                            dataset._meta[prop].data.forEach((metaDataItem, dataIndex) => {
                                                                metaDataItem._view.x = metaDataItem._xScale.getPixelForValue(index, dataIndex);
                                                                metaDataItem._view.base = metaDataItem._xScale.getBasePixel();
                                                                metaDataItem._view.width =
                                                                    (metaDataItem._xScale.width / dataset._meta[prop].data.length) *
            public_html/layouts/basic/modules/Vtiger/resources/dashboards/Widget.js on lines 484..491

            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 132.

            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

            Vtiger_Field_Js(
                'Vtiger_Date_Field_Js',
                {},
                {
                    /**
            Severity: Major
            Found in public_html/layouts/resources/Field.js and 1 other location - About 4 hrs to fix
            public_html/layouts/resources/Field.js on lines 383..413

            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 132.

            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

            Severity
            Category
            Status
            Source
            Language