YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getNumberFields has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNumberFields(?string $searchModuleName = null): array
    {
        $cacheKey = $searchModuleName ?? '-';
        if (isset($this->numberFieldsCache[$cacheKey])) {
            return $this->numberFieldsCache[$cacheKey];
Severity: Minor
Found in app/Mail/ScannerEngine/Outlook.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 getEmailsFields has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEmailsFields(?string $searchModuleName = null): array
    {
        $cacheKey = $searchModuleName ?? '-';
        if (isset($this->emailsFieldsCache[$cacheKey])) {
            return $this->emailsFieldsCache[$cacheKey];
Severity: Minor
Found in app/Mail/ScannerEngine/Outlook.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 verifyDkim has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyDkim(): array
    {
        if (isset($this->dkimCache)) {
            return $this->dkimCache;
        }
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 getBoards has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getBoards(string $moduleName, bool $privileges = false): array
    {
        if (!\App\Cache::has('KanbanGetBoards', $moduleName)) {
            $dataReader = (new \App\Db\Query())->from('s_#__kanban_boards')
                ->where(['tabid' => \App\Module::getModuleId($moduleName)])
Severity: Minor
Found in app/Utils/Kanban.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 validateNotIn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static function validateNotIn(string $name, array $row, string $sapi)
    {
        unset($name);
        if (isset($row[$sapi])) {
            $value = $row[$sapi];
Severity: Minor
Found in app/Utils/ConfReport.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 getNextBusinessDay has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getNextBusinessDay(\DateTime &$date, array $days): ?array
    {
        $tempDay = (int) $date->format('N') + 1;
        $counter = 1;
        $result = null;
Severity: Minor
Found in app/Utils/ServiceContracts.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 getContent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getContent($trim = false)
    {
        if (!$trim) {
            return $this->content;
        }
Severity: Minor
Found in app/EmailParser.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 getValuesToSave has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function getValuesToSave(): array
    {
        $forSave = [];
        $tableName = $this->getTableName();
        if (!$this->getId()) {
Severity: Minor
Found in app/Fields/Picklist/Item.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 getUserLabel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getUserLabel($id)
    {
        if (isset(self::$userLabelCache[$id])) {
            return self::$userLabelCache[$id];
        }
Severity: Minor
Found in app/Fields/Owner.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 getAllProviders has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllProviders(): array
    {
        if (self::$providersCache) {
            return self::$providersCache;
        }
Severity: Minor
Found in app/Map/Address.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 getPicklistValueImage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getPicklistValueImage($templateId, $moduleName, $treeId)
    {
        $value = ['name' => ''];
        $rows = self::getValuesById((int) $templateId);
        if (empty($rows[$treeId])) {
Severity: Minor
Found in app/Fields/Tree.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 getOptions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getOptions(): array
    {
        $caPathOrFile = \Composer\CaBundle\CaBundle::getSystemCaRootBundlePath();
        $options = [
            'headers' => [
Severity: Minor
Found in app/RequestHttp.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 getAccessibleGroups has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
    {
        $cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
        if (!\App\Cache::has('getAccessibleGroups', $cacheKey)) {
            $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
Severity: Minor
Found in app/Fields/Owner.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 isExists has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isExists(int $id, bool $active = true): bool
    {
        $cacheKey = $active ? 'UserIsExists' : 'UserIsExistsInactive';
        if (Cache::has($cacheKey, $id)) {
            return Cache::get($cacheKey, $id);
Severity: Minor
Found in app/User.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 getActiveAdminId has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getActiveAdminId()
    {
        $key = '';
        $cacheName = 'ActiveAdminId';
        if (Cache::has($cacheName, $key)) {
Severity: Minor
Found in app/User.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 varExport has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function varExport($variable)
    {
        if (\is_array($variable)) {
            $toImplode = [];
            if (static::isAssoc($variable)) {
Severity: Minor
Found in app/Utils.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 loadFiles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadFiles($path = false)
    {
        $dir = new \DirectoryIterator($path ?: $this->path);
        foreach ($dir as $fileinfo) {
            if ('dir' !== $fileinfo->getType() && 'php' === $fileinfo->getExtension()) {
Severity: Minor
Found in app/Db/Importer.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 getCurrentUserActivityReminderInSeconds has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCurrentUserActivityReminderInSeconds()
    {
        $activityReminder = $this->reminder_interval;
        $activityReminderInSeconds = '';
        if ('None' != $activityReminder) {
Severity: Minor
Found in modules/Users/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 getHeadLocks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHeadLocks()
    {
        $return = '';
        foreach ($this->getLocks() as $lock) {
            switch ($lock) {
Severity: Minor
Found in modules/Users/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 profileField has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function profileField(): int
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $i = 0;
        $profileIds = \vtlib\Profile::getAllIds();
Severity: Minor
Found in app/Db/Fixer.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