YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function checkPwd has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPwd(string $value)
    {
        $conf = Settings_Password_Record_Model::getUserPassConfig();
        $fieldConfig = $this->getFieldModel()->getFieldParams()['validate'] ?? [];
        $notice = [];
Severity: Minor
Found in modules/Vtiger/uitypes/Password.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 getDisplayValue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (empty($value)) {
            return null;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/Multipicklist.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 getLinks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLinks(): array
    {
        $parentRecordModel = $this->getParentRecordModel();
        $relationModelInstance = $this->getRelationModel();
        $relatedModuleModel = $relationModelInstance->getRelationModuleModel();
Severity: Minor
Found in modules/Vtiger/models/RelationListView.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 getPicklistValues has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPicklistValues($skipCheckingRole = false)
    {
        if (isset($this->picklistValues)) {
            return $this->picklistValues;
        }
Severity: Minor
Found in modules/Vtiger/models/Field.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 saveInventoryData has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveInventoryData()
    {
        \App\Log::trace('Start ' . __METHOD__);
        $inventoryData = $this->getInventoryData();
        $prevValue = $this->getPreviousInventoryItems();
Severity: Minor
Found in modules/Vtiger/models/Record.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 setRelationConditions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function setRelationConditions(array $conditions): self
    {
        $group = 'and';
        $relFields = $this->getRelationFields();
        foreach ($conditions as $groupInfo) {
Severity: Minor
Found in modules/Vtiger/models/Relation.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 getMenuIcon has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMenuIcon($menu, $title = ''): string
    {
        if (empty($title) && !empty($menu['label'])) {
            $title = self::getLabelToDisplay($menu);
        }
Severity: Minor
Found in modules/Vtiger/models/Menu.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 reloadCache has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function reloadCache()
    {
        $members = $users = [];
        $dataReader = (new App\Db\Query())->from('u_#__watchdog_module')->createCommand()->query();
        while ($row = $dataReader->read()) {
Severity: Minor
Found in modules/Vtiger/models/Watchdog.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 getActivities has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getActivities(App\Request $request)
    {
        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
        if (!$userPrivilegesModel->hasModulePermission('Calendar')) {
            throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Vtiger/views/Detail.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 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $view = $request->getByType('fromView', \App\Purifier::STANDARD);
        $sourceModuleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Vtiger/views/SortOrderModal.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 getRecordModelsFromRequest has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordModelsFromRequest(App\Request $request)
    {
        $moduleName = $request->getModule();
        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
        $recordIds = Vtiger_Mass_Action::getRecordsListFromRequest($request);
Severity: Minor
Found in modules/Vtiger/actions/MassSave.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 checkPermission has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
        if (!$request->isEmpty('record', true) && !\App\Privilege::isPermitted($request->getModule(), 'DetailView', $request->getInteger('record'))) {
            throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 403);
Severity: Minor
Found in modules/Vtiger/actions/RelationAjax.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 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $this->loadConfig();
        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\Gus', $this->config['moduleName']);
        if (!$recordCollector->isActive()) {
Severity: Minor
Found in modules/Vtiger/crons/IntegrationPLGusRegon.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 transformToSave has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function transformToSave($conditions = false)
    {
        $wfCondition = [];
        if (!empty($conditions)) {
            foreach ($conditions as $index => $condition) {
Severity: Minor
Found in modules/Vtiger/helpers/AdvancedFilter.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 getParentIStorages has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParentIStorages($id, &$parentIStorages, &$encounteredIStorages, $depthBase = 0)
    {
        \App\Log::trace('Entering getParentIStorages(' . $id . ') method ...');

        if ($depthBase === App\Config::module('IStorages', 'MAX_HIERARCHY_DEPTH')) {
Severity: Minor
Found in modules/IStorages/IStorages.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 getChild has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChild(int $id, array &$childRow, int $depthBase)
    {
        \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase == App\Config::module('Contacts', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Contacts/Contacts.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 getImportDetails has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getImportDetails(App\User $user, $forModule)
    {
        $db = App\Db::getInstance();
        $importRecords = [];
        $tableName = Import_Module_Model::getDbTableName($user);
Severity: Minor
Found in modules/Import/actions/Data.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 registerAddCustomBlockEvent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        registerAddCustomBlockEvent: function () {
            const thisInstance = this;
            let contents = this.container.find('.contents');
            contents.find('.addCustomBlock').on('click', function (e) {
                let addBlockContainer = contents.find('.addBlockModal').clone(true, true),

    Function registerSubmitEvent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        registerSubmitEvent: function () {
            var thisInstance = this;
            var form = jQuery('#EditView');
            form.on('submit', function (e) {
                if (form.data('submit') == 'true' && form.data('performCheck') == 'true') {
    Severity: Minor
    Found in public_html/layouts/basic/modules/Settings/Roles/resources/Roles.js - About 1 hr to fix

      Function changeCustomFilterElementView has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              changeCustomFilterElementView: function () {
                  const thisInstance = this;
                  let filterSelectElement = this.getFilterSelectElement();
                  if (filterSelectElement.length > 0 && filterSelectElement.is('select')) {
                      App.Fields.Picklist.showSelect2ElementView(filterSelectElement, {
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/List.js - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language