YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function addForeignKey has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function addForeignKey(Base $importer)
    {
        if (!isset($importer->foreignKey)) {
            return;
        }
Severity: Minor
Found in app/Db/Importer.php - About 35 mins 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 getMembers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getMembers()
    {
        if (false === static::$membersCache) {
            $members = [];
            $owner = new \App\Fields\Owner();
Severity: Minor
Found in app/PrivilegeUtil.php - About 35 mins 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 flatten has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function flatten(array $array, float $depth = INF): array
    {
        $result = [];
        foreach ($array as $item) {
            if (\is_array($item)) {
Severity: Minor
Found in app/Utils.php - About 35 mins 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 getCompaniesByName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function getCompaniesByName(string $companyName): void
    {
        try {
            $response = \App\RequestHttp::getClient(['auth' => [$this->username, $this->password]])
                ->post($this->url . 'search', ['json' => ['name' => $companyName]]);
Severity: Minor
Found in app/RecordCollectors/ChZefix.php - About 35 mins 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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }
Severity: Minor
Found in app/RecordCollectors/OrbIntelligence.php - About 35 mins 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 getQueryToUsersByGroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQueryToUsersByGroup(int $groupId, bool $recursive = true, int $depth = 0): Db\Query
    {
        ++$depth;
        $query = (new \App\Db\Query())->select(['userid'])->from('vtiger_users2group')->where(['groupid' => $groupId])
            ->union(
Severity: Minor
Found in app/PrivilegeUtil.php - About 35 mins 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 hasModuleActionPermission has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function hasModuleActionPermission($mixed, $action)
    {
        if (!is_a($action, 'Vtiger_Action_Model')) {
            $action = Vtiger_Action_Model::getInstance($action);
        }
Severity: Minor
Found in modules/Users/models/Privileges.php - About 35 mins 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 removeRoleToPicklist has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function removeRoleToPicklist($fields): void
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $db = \App\Db::getInstance();
        $schema = $db->getSchema();
Severity: Minor
Found in app/Db/Updater.php - About 35 mins 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 isActive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isActive($userId = null)
    {
        $isActive = false;
        if (empty($userId)) {
            $userId = \App\User::getCurrentUserRealId();
Severity: Minor
Found in modules/Users/authmethods/Totp.php - About 35 mins 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 search has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }
Severity: Minor
Found in app/RecordCollectors/FrEnterpriseGouv.php - About 35 mins 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 getUserByMember has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getUserByMember($member)
    {
        if (Cache::has('getUserByMember', $member)) {
            return Cache::get('getUserByMember', $member);
        }
Severity: Minor
Found in app/PrivilegeUtil.php - About 35 mins 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 verifyPasswordChange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyPasswordChange(App\User $userModel): void
    {
        $passConfig = \Settings_Password_Record_Model::getUserPassConfig();
        $time = (int) $passConfig['change_time'];
        if (1 === (int) $userModel->getDetail('force_password_change')) {
Severity: Minor
Found in modules/Users/models/Record.php - About 35 mins 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 __getParentEmployees has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __getParentEmployees($id, &$parentAccounts, &$encounteredAccounts)
    {
        $parentId = (new App\Db\Query())
            ->select(['parentid'])
            ->from('vtiger_ossemployees')
Severity: Minor
Found in modules/OSSEmployees/OSSEmployees.php - About 35 mins 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 checkLibrary has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkLibrary($name)
    {
        if (App\Cache::has('checkLibrary', $name)) {
            return App\Cache::get('checkLibrary', $name);
        }
Severity: Minor
Found in modules/Settings/ModuleManager/models/Library.php - About 35 mins 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 getEmployeeHierarchy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEmployeeHierarchy()
    {
        $focus = CRMEntity::getInstance($this->getModuleName());
        $hierarchy = $focus->getEmployeeHierarchy($this->getId());
        foreach ($hierarchy['entries'] as $employeeId => $employeeInfo) {
Severity: Minor
Found in modules/OSSEmployees/models/Record.php - About 35 mins 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 addSystemField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function addSystemField(string $sysName, int $blockId, array $params = []): void
    {
        $missingSystemFields = $this->getMissingSystemFields();
        if (empty($missingSystemFields[$sysName])) {
            throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Module.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        if ('TOTP_OFF' === App\Config::security('USER_AUTHY_MODE')) {
            throw new \App\Exceptions\NoPermitted('ERR_PERMISSION_DENIED', 403);
        }
Severity: Minor
Found in modules/Users/actions/TwoFactorAuthentication.php - About 35 mins 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 getData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getData(App\Request $request)
    {
        $moduleName = $request->getModule();
        $groupId = $request->getInteger('groupID');
        $groupMembers = Settings_Groups_Member_Model::getAllByTypeForGroup($groupId);
Severity: Minor
Found in modules/Users/actions/Groups.php - About 35 mins 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 loadFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadFilter(App\Request $request, array $filter, App\Db\Query &$query)
    {
        foreach ($filter as $key => $value) {
            if ($request->has($key) && '' !== $request->getRaw($key)) {
                switch ($value) {
Severity: Minor
Found in modules/Settings/Log/actions/LogsViewer.php - About 35 mins 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 isAddCustomFieldEnabled has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function isAddCustomFieldEnabled()
    {
        $actionNotSupportedModules = ['calendar', 'events', 'faq', 'helpdesk'];
        $blocksEliminatedArray = ['calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_RELATED_TO', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_INFORMATION'],
            'helpdesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
Severity: Minor
Found in modules/Settings/LayoutEditor/models/Block.php - About 35 mins 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