YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function saveAttachments()
    {
        $userId = $this->getAccountOwner();
        $useTime = $this->get('date');
        $files = $this->get('files');
Severity: Minor
Found in modules/OSSMail/models/Mail.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 getAll has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAll($moduleName = '', bool $fromFile = true)
    {
        $currentUser = \App\User::getCurrentUserModel();
        $cacheName = "{$moduleName}_{$currentUser->getId()}_{$fromFile}";
        if (App\Cache::has('getAllFilters', $cacheName)) {
Severity: Minor
Found in modules/CustomView/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 getProductsServices has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getProductsServices(App\Request $request, Vtiger_Viewer $viewer)
    {
        $fromModule = $request->getByType('fromModule', 'Text');
        $record = $request->getInteger('record');
        $mod = current($request->getArray('mod', 'Alnum'));
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 process has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $sourceModuleName = $request->getByType('source_module', \App\Purifier::ALNUM);
        $moduleName = $request->getModule();
Severity: Minor
Found in modules/CustomView/views/EditAjax.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 updateCard has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateCard($moduleName, $record, $card)
    {
        \App\Log::trace(__METHOD__ . ' | Start CRM ID:' . $record['crmid']);
        $vcard = Sabre\VObject\Reader::read($card['carddata']);
        $vcard->PRODID = self::PRODID;
Severity: Minor
Found in modules/API/models/CardDAV.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 createCard has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function createCard($moduleName, $record)
    {
        \App\Log::trace(__METHOD__ . ' | Start CRM ID:' . $record['crmid']);

        $vcard = new Sabre\VObject\Component\VCard();
Severity: Minor
Found in modules/API/models/CardDAV.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 getLastRelation has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLastRelation($sourceIds, $sourceModule)
    {
        $colors = Vtiger_HistoryRelation_Widget::$colors;
        if (!\is_array($sourceIds)) {
            $sourceIds = [$sourceIds];
Severity: Minor
Found in modules/ModTracker/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 getDetailViewLinks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDetailViewLinks(array $linkParams): array
    {
        $recordModel = $this->getRecord();
        $linkModelList = parent::getDetailViewLinks($linkParams);
        unset($linkModelList['DETAIL_VIEW_ADDITIONAL']);
Severity: Minor
Found in modules/OSSMailView/models/DetailView.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 entityBeforeSave has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityBeforeSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        if (($probability = $recordModel->getField('probability')) && $probability->isActiveField()) {
            if (
Severity: Minor
Found in modules/SSalesProcesses/handlers/Finances.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 setMessagesResult has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function setMessagesResult(App\Request $request)
    {
        if ($request->has('roomType') && $request->has('recordId')) {
            $roomType = $request->getByType('roomType');
            $recordId = $request->getInteger('recordId');
Severity: Minor
Found in modules/Chat/actions/ChatAjax.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value)) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/MultiDependField.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 entityBeforeSave has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function entityBeforeSave(App\EventHandler $eventHandler)
    {
        $recordModel = $eventHandler->getRecordModel();
        $meeting = \App\MeetingService::getInstance();
        if ($meeting->isActive()) {
Severity: Minor
Found in modules/Vtiger/handlers/Meetings.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        $hashValue = \is_array($value) ? implode('|', $value) : $value;
        if (isset($this->validate[$hashValue]) || empty($value)) {
            return;
Severity: Minor
Found in modules/Vtiger/uitypes/InventoryLimit.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 getDbConditionBuilderValue has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDbConditionBuilderValue($value, string $operator)
    {
        $values = [];
        if (!\is_array($value)) {
            $value = $value ? explode('##', $value) : [];
Severity: Minor
Found in modules/Vtiger/uitypes/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 getValueFromImport has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueFromImport($value, $defaultValue = null)
    {
        if ('' === $value && null !== $defaultValue) {
            $value = $defaultValue;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/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 uploadTempFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function uploadTempFile(array $files, int $recordId)
    {
        $db = \App\Db::getInstance();
        $attach = [];
        $maxSize = $this->getFieldInfo()['maxFileSize'];
Severity: Minor
Found in modules/Vtiger/uitypes/MultiAttachment.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 getQueryFields has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function getQueryFields()
    {
        if ($this->has('QueryFields')) {
            return $this->get('QueryFields');
        }
Severity: Minor
Found in modules/Vtiger/models/Relation.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 loadRowData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadRowData(int $recordId, array $params = []): array
    {
        $recordModel = Vtiger_Record_Model::getInstanceById($recordId);
        $recordModuleName = $recordModel->getModuleName();
        $data = [
Severity: Minor
Found in modules/Vtiger/models/Inventory.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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(App\Request $request)
    {
        $moduleName = $request->getModule();
        if ($request->isEmpty('record', true)) {
            $this->record = Vtiger_Record_Model::getCleanInstance($moduleName);
Severity: Minor
Found in modules/Vtiger/actions/Save.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 exportData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportData()
    {
        $headers = $this->getHeaders();

        $addInventoryData = $this->fullData && $this->moduleInstance->isInventory();
Severity: Minor
Found in modules/Vtiger/models/ExportToSpreadsheet.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