YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function getHandlers(string $name): array
    {
        $handlers = static::getByType($name, $this->moduleName);
        if ($this->exceptions['disableHandlers'] ?? null) {
            $handlers = array_intersect_key($handlers, array_flip(self::$mandatoryEventClass));
Severity: Minor
Found in app/EventHandler.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 initFieldValuesByUser has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function initFieldValuesByUser()
    {
        $fieldsData = $this->getMappingFields()[$this->destinyModuleModel->getId()] ?? [];
        $destFieldList = $this->destinyModuleModel->getFieldsById();
        foreach ($this->cleanRecordModels as $key => $cleanRecordModel) {
Severity: Minor
Found in app/RecordConverter.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 getFieldInfo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFieldInfo($mixed, $module = false)
    {
        $fieldInfo = false;
        if (is_numeric($mixed)) {
            if (Cache::has('FieldInfoById', $mixed)) {
Severity: Minor
Found in app/Field.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 loadWhere has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadWhere()
    {
        if (null !== $this->stateCondition) {
            $this->query->andWhere($this->getStateCondition());
        }
Severity: Minor
Found in app/QueryGenerator.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 getOrderBy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOrderBy($order = false): array
    {
        $condition = [];
        if ($order && 'DESC' === strtoupper($order)) {
            foreach ($this->getRelatedTableName() as $formattedName) {
Severity: Minor
Found in app/Conditions/QueryFields/ReferenceField.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 operatorOgu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function operatorOgu(): bool
    {
        $result = false;
        $groups = \App\User::getCurrentUserModel()->getGroups();
        if ($groups) {
Severity: Minor
Found in app/Conditions/RecordFields/OwnerField.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 getCombinations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCombinations($array, $tempString = '')
    {
        $countArray = \count($array);
        $result = '';
        for ($i = 0; $i < $countArray; ++$i) {
Severity: Minor
Found in app/Conditions/QueryFields/MultipicklistField.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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        $scanner = $this->scannerEngine;
        if ($this->checkExceptions('CreatedMail') || false !== $scanner->getMailCrmId()) {
            return;
Severity: Minor
Found in app/Mail/ScannerAction/CreatedMail.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 createUserSharingPrivilegesfile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function createUserSharingPrivilegesfile($userid)
    {
        \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
        require 'user_privileges/user_privileges_' . $userid . '.php';
        $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
Severity: Minor
Found in app/UserPrivilegesFile.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 getAllByType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAllByType(string $displayType, string $moduleName): array
    {
        $recordCollector = [];
        foreach ((new \DirectoryIterator(__DIR__ . '/RecordCollectors')) as $fileinfo) {
            if ('php' === $fileinfo->getExtension() && 'Base' !== ($fileName = $fileinfo->getBasename('.php'))) {
Severity: Minor
Found in app/RecordCollector.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 getCombinations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCombinations($array, $tempString = '')
    {
        $countArray = \count($array);
        $result = '';
        for ($i = 0; $i < $countArray; ++$i) {
Severity: Minor
Found in app/Conditions/QueryFields/CategoryMultipicklistField.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 download has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function download(string $prefix)
    {
        if (!\App\RequestUtil::isNetConnection()) {
            \App\Log::warning('ERR_NO_INTERNET_CONNECTION', __METHOD__);
            static::$lastErrorMessage = 'ERR_NO_INTERNET_CONNECTION';
Severity: Minor
Found in app/Installer/Languages.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 getComments has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getComments($params = false)
    {
        [$limit, $showAuthor] = array_pad(explode('|', $params, 2), 2, false);
        $query = (new \App\Db\Query())->select(['commentcontent', 'userid'])->from('vtiger_modcomments')->where(['related_to' => $this->record])->orderBy(['modcommentsid' => SORT_DESC]);
        if ($limit) {
Severity: Minor
Found in app/TextParser.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 getIpByName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getIpByName(string $fromName, ?string $hostName = null): string
    {
        if (']' === substr($fromName, -1) || '[' === substr($fromName, 0, 1)) {
            $fromName = rtrim(ltrim($fromName, '['), ']');
        }
Severity: Minor
Found in app/Mail/Rbl.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 getUnlockQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUnlockQuery(\App\Request $request): \App\Db\Query
    {
        $columns = [];
        foreach ($request->getArray('columns') as $key => $value) {
            $columns[$key] = $value['data'];
Severity: Minor
Found in app/Controller/Components/Action/InterestsConflict.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 getMailType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMailType(): int
    {
        if ($this->has('mailType')) {
            return $this->get('mailType');
        }
Severity: Minor
Found in app/Mail/ScannerEngine/Outlook.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 getFieldInstances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstances(): array
    {
        $company = \App\Company::getCompany();
        $fields = [];
        foreach (self::COMPANY_FORM_FIELDS as $fieldName) {
Severity: Minor
Found in app/YetiForce/Order.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 send has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function send(string $url, string $method, array $option = []): bool
    {
        $this->error = null;
        $this->success = false;
        $this->basicValidations($url);
Severity: Minor
Found in app/YetiForce/ApiClient.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 getHtmlLink has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getHtmlLink(int $id, ?string $moduleName = null, ?int $length = null, bool $fullUrl = false): string
    {
        $state = self::getState($id);
        if (null === $state) {
            return '<i class="color-red-500" title="' . $id . '">' . Language::translate('LBL_RECORD_DOES_NOT_EXIST') . '</i>';
Severity: Minor
Found in app/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 getConfirmQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
    {
        $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
        $columns = [];
        foreach ($request->getArray('columns') as $key => $value) {
Severity: Minor
Found in app/Controller/Components/Action/InterestsConflict.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