YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function process(App\Request $request)
    {
        $fields = Settings_MailIntegration_ConfigForm_Model::getFields($request->getModule(false));
        $field = $request->getByType('updateField');
        if (!isset($fields[$field])) {
Severity: Minor
Found in modules/Settings/MailIntegration/actions/SaveConfigForm.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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $response = new Vtiger_Response();
        $result = ['success' => false, 'message' => \App\Language::translate('LBL_UPLOAD_ERROR', $request->getModule(false))];
        if (!empty($_FILES['imported_list'])) {
Severity: Minor
Found in modules/Settings/MailRbl/actions/UploadList.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 duplicate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function duplicate(App\Request $request)
    {
        $response = new Vtiger_Response();
        $moduleName = $request->getModule(false);
        $result = true;
Severity: Minor
Found in modules/Settings/PublicHoliday/actions/Holiday.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 expression has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function expression()
    {
        $la1 = $this->la(1);
        $la2 = $this->la(2);
        if ($this->checkSymbol($la1, 'if')) {

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 getPrivileges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPrivileges($userId)
    {
        $recordId = false;
        if (!empty($this->get('sourceRecord'))) {
            $recordId = $this->get('sourceRecord');
Severity: Minor
Found in modules/PermissionInspector/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 getValuesFromSource has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValuesFromSource(App\Request $request, $moduleName = false)
    {
        $data = parent::getValuesFromSource($request, $moduleName);
        $sourceModule = $request->getByType('sourceModule', 2);
        if ($sourceModule && $request->has('sourceRecord')) {
Severity: Minor
Found in modules/SMSNotifier/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 getEntityCount has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEntityCount(): array
    {
        $colors = \App\Fields\Picklist::getColors('activitytype', false);
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $startDate = DateTimeField::convertToDBTimeZone($this->get('start'));
Severity: Minor
Found in modules/Calendar/models/Calendar.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 getRelatedFields has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedFields(Vtiger_Record_Model $recordModel): array
    {
        $phones = [];
        $relatedId = $recordModel->get('related_to') ?: $recordModel->getField('related_to')->get('fieldvalue');
        $fieldModel = $this->getFieldModel();
Severity: Minor
Found in modules/SMSNotifier/uitypes/Phone.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 getFieldInstances has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstances()
    {
        $fieldInstances = [];
        if ($this->isCreate() || $this->isUpdate() || $this->isTransferEdit()) {
            $dataReader = (new \App\Db\Query())->from('vtiger_modtracker_detail')->where(['id' => $this->get('id')])->createCommand()->query();
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 getApiDisplayValue has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getApiDisplayValue($value, Vtiger_Record_Model $recordModel, array $params = [])
    {
        $return = [];
        if ($recordModel && !empty($value)) {
            if ('I' === $recordModel->getValueByField('filelocationtype')) {
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 getRoomsMessages has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRoomsMessages(App\Request $request)
    {
        $result = [];
        $roomList = \App\Chat::getRoomsByUser();
        $areNewEntries = false;
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 detail has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function detail(App\Request $request)
    {
        $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
        if ('PLL_PRESENTATION' === $recordModel->get('knowledgebase_view')) {
            $content = [];
Severity: Minor
Found in modules/KnowledgeBase/actions/KnowledgeBaseAjax.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 transfer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function transfer(int $relatedRecordId, int $fromRecordId, int $toRecordId): bool
    {
        $result = $this->updateDB($toRecordId, ['crmid' => $fromRecordId, 'ossmailviewid' => $relatedRecordId]);
        if ($result && $parentId = \Users_Privileges_Model::getParentRecord($toRecordId)) {
            $parentIdFromRecordId = \Users_Privileges_Model::getParentRecord($fromRecordId);
Severity: Minor
Found in modules/OSSMailView/relations/GetEmails.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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function validate($value, $isUserFormat = false)
    {
        if (empty($value) || (!\is_array($value) && \App\Json::isEmpty($value))) {
            return;
        }
Severity: Minor
Found in modules/Vtiger/uitypes/ChangesJson.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 getReferenceList has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getReferenceList()
    {
        if (isset($this->referenceList)) {
            return $this->referenceList;
        }
Severity: Minor
Found in modules/Vtiger/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 getListViewMassActions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewMassActions($linkParams)
    {
        $currentUser = Users_Record_Model::getCurrentUserModel();
        $moduleModel = $this->getModule();
        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
Severity: Minor
Found in modules/Vtiger/models/ListView.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 getCustomHeaderFields has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomHeaderFields()
    {
        $moduleName = $this->getModuleName();
        $path = 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'headerfields';
        if (!is_dir($path)) {
Severity: Minor
Found in modules/Vtiger/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 getRelatedModuleRecordIds has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRelatedModuleRecordIds(App\Request $request, $recordIds, $relModData)
    {
        $basicModule = $request->getModule();
        $parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);
        $relatedIds = [];
Severity: Minor
Found in modules/Vtiger/models/TransferOwnership.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 getStructure has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStructure()
    {
        if (!empty($this->structuredValues)) {
            return $this->structuredValues;
        }
Severity: Minor
Found in modules/Vtiger/models/MassEditRecordStructure.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 getFields has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields($type = false)
    {
        $fields = $this->get('fields');
        if (!$fields) {
            $fields = [];
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

Severity
Category
Status
Source
Language