YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    private function getValuesToSave(array $data): array
    {
        $forSave = [];
        if (!$this->getId()) {
            $forSave[$this->getModule()->baseTable][$this->getModule()->baseIndex] = \App\Db::getInstance('admin')->getUniqueId('vtiger_users');
Severity: Minor
Found in modules/Settings/Groups/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 executeActions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function executeActions($account, OSSMail_Mail_Model $mail, $folder, $params = false)
    {
        \App\Log::trace('Start execute actions: ' . $account['username'], 'MailScanner');

        $actions = [];
Severity: Minor
Found in modules/OSSMailScanner/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 validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validate(array $data): array
    {
        if (isset($data['id'])) {
            $data['id'] = \App\Purifier::purifyByType($data['id'], 'Integer');
        }
Severity: Minor
Found in modules/Settings/BusinessHours/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 getExternalUrl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getExternalUrl($moduleName = false, $record = false, $view = false, $type = false): string
    {
        $url = 'mailto:';
        $request = new App\Request([]);
        if ($moduleName) {
Severity: Minor
Found in modules/OSSMail/models/Module.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 getFieldInfo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInfo(): array
    {
        $this->loadFieldInfo();
        //Change the default search operator
        if ('date_start' == $this->get('name')) {
Severity: Minor
Found in modules/Calendar/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 updateReminderPostpone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateReminderPostpone(string $time)
    {
        switch ($time) {
            case '15m':
                $datatime = date('Y-m-d H:i:s', strtotime('+15 min'));
Severity: Minor
Found in modules/Calendar/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 process has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $currentUserId = \App\User::getCurrentUserId();
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/OSSTimeControl/dashboards/TimeControl.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 compare has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function compare(App\Request $request): array
    {
        $this->parseCsv->heading = false;
        $this->parseCsv->auto($this->path);
        $this->storage = $request->getInteger('storage');
Severity: Minor
Found in modules/Products/models/Stocktaking.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 recordCreate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function recordCreate($cal)
    {
        \App\Log::trace(__METHOD__ . ' | Start Cal ID' . $cal['id']);
        $calendar = \App\Integrations\Dav\Calendar::loadFromContent($cal['calendardata']);
        foreach ($calendar->getRecordInstance() as $recordModel) {
Severity: Minor
Found in modules/API/models/CalDAV.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 recordUpdate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function recordUpdate(Vtiger_Record_Model $record, $cal)
    {
        \App\Log::trace(__METHOD__ . ' | Start Cal ID:' . $cal['crmid']);
        $calendar = \App\Integrations\Dav\Calendar::loadFromContent($cal['calendardata'], $record, $cal['uid']);
        foreach ($calendar->getRecordInstance() as $recordModel) {
Severity: Minor
Found in modules/API/models/CalDAV.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 getModulesAndCount has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getModulesAndCount(Vtiger_Record_Model $parentRecordModel)
    {
        $modules = [];
        foreach (self::MODULES as $moduleName) {
            $count = 0;
Severity: Minor
Found in modules/Products/models/SummaryWidget.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 reviewChanges has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function reviewChanges(App\Request $request)
    {
        $moduleName = $request->getModule();
        $sourceModule = $request->getByType('sourceModule', 2);
        $request->set('module', $sourceModule);
Severity: Minor
Found in modules/ModTracker/actions/ChangesReviewedOn.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 findEmailInRelated has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function findEmailInRelated(Vtiger_Record_Model $recordModel): string
    {
        $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, 'Contacts');
        $query = $relationListView->getRelationQuery();
        $tabIndex = $relationListView->getRelatedModuleModel()->getEntityInstance()->tab_name_index;
Severity: Minor
Found in modules/OSSMailView/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 getFilePath has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFilePath(): string
    {
        $path = '';
        if ($fileDetails = $this->getFileDetails()) {
            $fileName = $fileDetails['name'];
Severity: Minor
Found in modules/Documents/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 checkPermissionByRoom has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkPermissionByRoom(App\Request $request): void
    {
        switch ($request->getByType('roomType')) {
            case 'crm':
                $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $sourceModule = $request->getByType('sourceModule', 2);
        $records = $request->getArray('recordsId', 'Integer');
        if ($sourceModule) {
Severity: Minor
Found in modules/ModTracker/actions/LastRelation.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $documentIdsList = $this->getRecordsListFromRequest($request);
        if (!empty($documentIdsList)) {
Severity: Minor
Found in modules/Documents/actions/MoveDocuments.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 getEditViewDisplayValue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEditViewDisplayValue($value, $recordModel = false)
    {
        $value = \App\Json::decode($value);
        $id = false;
        if ($recordModel) {
Severity: Minor
Found in modules/Vtiger/uitypes/MultiImage.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (empty($value)) {
            return '';
        }
Severity: Minor
Found in modules/Vtiger/uitypes/DocumentsFileUpload.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPicklistValues()
    {
        $params = $this->getFieldModel()->getFieldParams();
        $condition = ['and',
            ['<>', 'vtiger_field.presence', 1],
Severity: Minor
Found in modules/Vtiger/uitypes/MultiListFields.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