YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function process has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        try {
            $checker = (new \App\Security\Dependency())->securityChecker();
            $this->status = $checker ? 0 : 1;
Severity: Minor
Found in app/SystemWarnings/Security/Dependencies.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 getFieldsPermissions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFieldsPermissions($tabId, $readOnly = true)
    {
        Log::trace('Entering ' . __METHOD__ . ": $tabId");
        if (Cache::has(__METHOD__ . User::getCurrentUserId(), $tabId)) {
            $fields = Cache::get(__METHOD__ . User::getCurrentUserId(), $tabId);
Severity: Minor
Found in app/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 getByType has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getByType(string $name, ?string $moduleName = '', bool $active = true): array
    {
        $handlersByType = [];
        $cacheName = 'All' . ($active ? ':active' : '');
        if (Cache::has('EventHandlerByType', $cacheName)) {
Severity: Minor
Found in app/EventHandler.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 parseConditions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private static function parseConditions(?array $conditions, \Vtiger_Record_Model $recordModel): bool
    {
        if (empty($conditions) || empty($conditions['rules'])) {
            return true;
        }
Severity: Minor
Found in app/Condition.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 getColumnPermission has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getColumnPermission($tabMix, $columnName, $readOnly = true)
    {
        $tabId = $tabMix;
        if (!is_numeric($tabMix)) {
            $tabId = Module::getModuleId($tabMix);
Severity: Minor
Found in app/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 initForCustomViewById has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function initForCustomViewById($viewId, $onlyFields = false)
    {
        $this->fields[] = 'id';
        $customView = CustomView::getInstance($this->moduleName, $this->user);
        foreach ($customView->getColumnsListByCvid($viewId) as $cvColumn) {
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 getOrderBy has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOrderBy($order = false): array
    {
        if ($order && 'DESC' === strtoupper($order)) {
            $sort = SORT_DESC;
        } else {
Severity: Minor
Found in app/Conditions/QueryFields/DateField.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 verifyDmarc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyDmarc(): array
    {
        $fromDomain = explode('@', $this->getHeaderEmail('from'))[1] ?? '';
        $status = self::DMARC_NONE;
        if (empty($fromDomain) || !($dmarcRecord = $this->getDmarcRecord($fromDomain))) {
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 process has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): string
    {
        $relatedModuleName = 'Documents';
        if (!$this->textParser->recordModel
            || !\App\Privilege::isPermitted($relatedModuleName)
Severity: Minor
Found in app/TextParser/RelatedAttachments.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 13 (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/TableDiscountSTwoLang.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 find has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($value)
    {
        if (empty($value) || !\App\RequestUtil::isNetConnection()) {
            return [];
        }
Severity: Minor
Found in app/Map/Address/OpenCageGeocoder.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 formatToDb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatToDb($value, $leadingZeros = false)
    {
        if ($leadingZeros) {
            $delim = ['/', '.'];
            foreach ($delim as $delimiter) {
Severity: Minor
Found in app/Fields/Date.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 getActiveProviders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getActiveProviders(): array
    {
        if (self::$activeProvidersCache) {
            return self::$activeProvidersCache;
        }
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 getRelatedValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedValue(bool $reload = false): string
    {
        if (!isset($this->relatedValue) || $reload) {
            $value = [];
            preg_match_all('/{{picklist:([a-zA-Z0-9_]+)}}|\$\((\w+) : ([,"\+\#\%\.\=\-\[\]\&\w\s\|\)\(\:]+)\)\$/u', $this->get('prefix') . $this->get('postfix'), $matches);
Severity: Minor
Found in app/Fields/RecordNumber.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 anonymize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function anonymize(): self
    {
        if (empty($this->data)) {
            return $this;
        }
Severity: Minor
Found in app/Anonymization.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 initUsers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
    {
        $cacheKeyMod = 'private' === $private ? $this->moduleName : '';
        $cacheKeyAss = \is_array($assignedUser) ? md5(json_encode($assignedUser)) : $assignedUser;
        $cacheKeyRole = \is_array($roles) ? md5(json_encode($roles)) : $roles;
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 verifyDatabaseAccess has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function verifyDatabaseAccess(string $server, string $database, string $user, string $password, int $port): array
    {
        try {
            $db = self::connectToDatabase($server, $database, $user, $password, $port);
            if (0 === \count($db->getSchema()->getSchemaNames())) {
Severity: Minor
Found in app/Integrations/Wapro.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 syncAccount has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function syncAccount(array $data): int
    {
        $recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');
        if ($id = $this->findAccount($data, $recordModel)) {
            $recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/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 afterSaveToDb has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function afterSaveToDb()
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $this->cleanAttachments();
        if ($this->isNew() || false !== $this->getPreviousValue('roleid') || false !== $this->getPreviousValue('is_admin')) {
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 updateForeignKey has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateForeignKey(Base $importer)
    {
        if (!isset($importer->foreignKey)) {
            return;
        }
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

Severity
Category
Status
Source
Language