YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function getOpenTicketStatus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getOpenTicketStatus()
    {
        $getTicketStatusClosed = self::getTicketStatusNotModify();
        \App\Log::trace(__METHOD__);
        if (empty($getTicketStatusClosed)) {
Severity: Minor
Found in modules/Settings/SupportProcesses/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 post has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function post(App\Request $request)
    {
        $moduleName = $request->getModule(false);
        $moduleModel = Settings_Vtiger_Module_Model::getInstance($moduleName);
        $fieldModel = $moduleModel->getFieldInstanceByName('image');
Severity: Minor
Found in modules/Settings/Media/files/Images.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $qualifiedModuleName = $request->getModule(false);
        $supportedModules = Settings_RecordNumbering_Module_Model::getSupportedModules();
        $sourceModule = $request->getByType('sourceModule', 2);
Severity: Minor
Found in modules/Settings/RecordNumbering/views/CustomRecordNumbering.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 updateRecords has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateRecords($recordModel, $relatedData, $fieldValue)
    {
        $relatedModuleName = $relatedData[0];
        $relatedFieldName = $relatedData[1];
        $targetModel = Vtiger_RelationListView_Model::getInstance($recordModel, $relatedModuleName);
Severity: Minor
Found in modules/com_vtiger_workflow/tasks/VTUpdateRelatedFieldTask.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 getRenewalValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRenewalValue()
    {
        if ($this->isEmpty('product') || !\App\Record::isExists($this->get('product'), 'Products')) {
            return 'PLL_NOT_APPLICABLE_VERIFICATION';
        }
Severity: Minor
Found in modules/Assets/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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $moduleName = $request->getModule();
        $sourceRecord = $request->getInteger('sourceRecord');
        $sourceModule = $request->getByType('sourceModule', 2);
Severity: Minor
Found in modules/OSSMail/actions/GetMail.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 11 (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/SSalesProcesses/dashboards/TeamsEstimatedSales.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 getListViewDisplayValue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getListViewDisplayValue($value, $record = false, $recordModel = false, $rawText = false)
    {
        $value = \App\Json::decode($value);
        if (!$value) {
            return '';
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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        $value = \App\Json::decode($value);
        if (!$value) {
            return '';
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 validate has a Cognitive Complexity of 11 (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/SharedOwner.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 getRecurringInfo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRecurringInfo($value)
    {
        $result = [];
        if ($value) {
            $values = explode(';', $value);
Severity: Minor
Found in modules/Vtiger/uitypes/Recurrence.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 getValueToExport has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValueToExport($value, int $recordId)
    {
        $value = trim($value);
        if (!empty($value)) {
            $recordModule = \App\Record::getType($value);
Severity: Minor
Found in modules/Vtiger/uitypes/Reference.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 getRecordsFromArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordsFromArray(array $rows)
    {
        $listViewRecordModels = $relatedFields = [];
        $moduleModel = $this->getModule();
        foreach ($this->getQueryGenerator()->getRelatedFields() as $fieldInfo) {
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 duplicateValueFromRecord has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function duplicateValueFromRecord(&$value, App\Request $request): bool
    {
        $fieldName = $this->getFieldModel()->getName();
        $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('_duplicateRecord'), $request->getModule());
        $copyValue = $recordModel->get($fieldName);
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 updateUploadFiles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateUploadFiles(array $value, Vtiger_Record_Model $recordModel)
    {
        $previousValue = $recordModel->get($this->getFieldModel()->getName());
        $previousValue = ($previousValue && !\App\Json::isEmpty($previousValue)) ? \App\Fields\File::parse(\App\Json::decode($previousValue)) : [];
        $value = \App\Fields\File::parse($value);
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 getInstance has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstance($value, $force = false)
    {
        if (!self::$cachedInstances || $force) {
            self::$cachedInstances = self::getAll();
        }
Severity: Minor
Found in modules/Vtiger/models/Action.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 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFields()
    {
        if (!$this->fields) {
            $moduleBlockFields = Vtiger_Field_Model::getAllForModule($this->targetModuleModel);
            $this->fields = [];
Severity: Minor
Found in modules/Vtiger/models/ChartFilter.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 deleteField has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function deleteField(string $fieldName): bool
    {
        $db = \App\Db::getInstance();
        $dbCommand = $db->createCommand();
        $transaction = $db->beginTransaction();
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 getAdvancedLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAdvancedLinks()
    {
        $moduleModel = $this->getModule();
        $advancedLinks = [];

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

    public function getFields(): array
    {
        $summaryFields = [];
        $fields = $this->recordModel->getModule()->getFields();
        foreach ($fields as $fieldName => $fieldModel) {
Severity: Minor
Found in modules/Vtiger/models/RecordPopover.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