YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method getParent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0)
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase == App\Config::module('Contacts', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Contacts/Contacts.php - About 1 hr to fix

    Function getData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

            getData: function (data) {
                var mappingData = [];
                var mappingConditions = [];
                for (var i in data) {
                    var name = i.split('][');

    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 loadMenuTree has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

            loadMenuTree: function () {
                var thisInstance = this;
                if (thisInstance.treeInstance == false) {
                    var data = JSON.parse($('#treeValues').val());
                    if (data.length == 0) {
    Severity: Minor
    Found in public_html/layouts/basic/modules/Settings/Menu/resources/Menu.js - About 1 hr 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 getDefaultParams has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

            getDefaultParams: function () {
                let container = this.getRelatedContainer();
                let params = Object.assign({}, this.defaultParams);
                params['page'] = this.getCurrentPageNum();
                params['orderby'] = this.getOrderBy();
    Severity: Minor
    Found in public_html/layouts/basic/modules/Vtiger/resources/RelatedList.js - About 1 hr 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 registerCalendar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

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

    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 fillNewRecordData has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        fillNewRecordData(moduleName) {
            const data = {
                email: this.mailItem.from.emailAddress,
                email1: this.mailItem.from.emailAddress,
                relationOperation: true,

    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 14 (exceeds 5 allowed). Consider refactoring.
    Open

            validate: function (dependentFieldList) {
                let field = this.getElement();
                let fieldInfo = field.data('fieldinfo');
                let fieldLabel = fieldInfo.label;
                let contextFormElem = field.closest('form');
    Severity: Minor
    Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 getPermittedModuleIdList has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getPermittedModuleIdList()
        {
            $permittedModules = [];
            require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
            include 'user_privileges/tabdata.php';
    Severity: Minor
    Found in vtlib/Vtiger/Deprecated.php - About 1 hr 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 updateCronTasks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function updateCronTasks($modulenode)
        {
            if (empty($modulenode->crons) || empty($modulenode->crons->cron)) {
                return;
            }
    Severity: Minor
    Found in vtlib/Vtiger/PackageUpdate.php - About 1 hr 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 getByRecordModel has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getByRecordModel(string $view, \Vtiger_Record_Model $recordModel, bool $cache = true): array
        {
            $cacheKey = $view . $recordModel->getId();
            if ($cache && isset(self::$recordModelCache[$cacheKey])) {
                return self::$recordModelCache[$cacheKey];
    Severity: Minor
    Found in app/FieldsDependency.php - About 1 hr 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 currencyDecimalFormat has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function currencyDecimalFormat($value, $user = null)
        {
            if (!$user) {
                $user = \App\User::getCurrentUserModel();
            }
    Severity: Minor
    Found in include/fields/CurrencyField.php - About 1 hr 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 resetPassword has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function resetPassword(): void
        {
            $this->climate->arguments->add([
                'login' => [
                    'prefix' => 'l',
    Severity: Minor
    Found in app/Cli/Users.php - About 1 hr 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 loadAdvancedConditions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private function loadAdvancedConditions(): void
        {
            if (!empty($this->advancedConditions['relationId']) && ($relationModel = \Vtiger_Relation_Model::getInstanceById($this->advancedConditions['relationId']))) {
                $typeRelationModel = $relationModel->getTypeRelationModel();
                if (!method_exists($typeRelationModel, 'loadAdvancedConditionsByRelationId')) {
    Severity: Minor
    Found in app/QueryGenerator.php - About 1 hr 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 updateBySelect has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private function updateBySelect(): void
        {
            $options = [];
            $toInstall = \App\YetiForce\Updater::getToInstall();
            foreach ($toInstall as $package) {
    Severity: Minor
    Found in app/Cli/System.php - About 1 hr 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 organization has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function organization(string $params): string
        {
            if (!$params) {
                return '';
            }
    Severity: Minor
    Found in app/TextParser.php - About 1 hr 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 relatedRecordLevel has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function relatedRecordLevel($params)
        {
            [$fieldName, $relatedModule, $relatedRecord] = array_pad(explode('|', $params, 3), 3, '');
            if (
                !isset($this->recordModel)
    Severity: Minor
    Found in app/TextParser.php - About 1 hr 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 addAdvConditions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        private function addAdvConditions(\App\QueryGenerator $queryGenerator, int $relationId, string $operator, ?array $condition, ?int $userId)
        {
            $relationModel = \Vtiger_Relation_Model::getInstanceById($relationId);
            if (\Vtiger_Relation_Model::RELATION_M2M !== $relationModel->getRelationType()) {
                $parentModuleName = $relationModel->getParentModuleModel()->getName();
    Severity: Minor
    Found in app/TextParser/UserRecordsList.php - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function process()
        {
            if (!$this->textParser->recordModel || !$this->textParser->recordModel->getModule()->isInventory()) {
                return '';
            }
    Severity: Minor
    Found in app/TextParser/TableDiscountSummary.php - About 1 hr 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 verifySender has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function verifySender(): array
        {
            $from = $this->getHeaderEmail('from');
            if (!$from) {
                return ['status' => true, 'info' => ''];
    Severity: Minor
    Found in app/Mail/Rbl.php - About 1 hr 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 verifySpf has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function verifySpf(): array
        {
            if (isset($this->spfCache)) {
                return $this->spfCache;
            }
    Severity: Minor
    Found in app/Mail/Rbl.php - About 1 hr 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

    Severity
    Category
    Status
    Source
    Language