View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
18875Bug reportsUser / Groups / Rolespublic2026-11-24 21:42
Reportergabrieljenik Assigned To 
PrioritynormalSeveritytweak 
Status closedResolutionwon't fix 
Product Version5.4.x 
Summary18875: Refactor models/services/SurveyPermissions.php
Description

When working on 18468, a complexity check was not passed:

application/models/services/SurveyPermissions.php:10 ExcessiveClassComplexity The class SurveyPermissions has an overall complexity of 56 which is very high. The configured complexity threshold is 50.

Agreed with Olle we should:
1 - Suppress the check for the method on master. --> Done.
2 - Refactor on Dev

Now we need to refactor.


The method getUserGroupNames is not called by any other method in the class, and it also does not use this, and seems semantically kinda unrelated since it does not deal with permissions. Moving it out would reduce the complexity of the class slightly.

Hm but only from 56 to 52, when I test it on this branch. Current limit is set to 50.


What about also moving out getTooltipAllPermissions to another class? It's kinda related to presentation, and the only this access is survey id, which can be given as an argument, or constructor in a new class.

More relevant on dev branch than 5.x branch tho. Maybe just suppress it in LS5 then? @SuppressWarnings(PHPMD.ExcessiveClassComplexity)

TagsNo tags attached.
Bug heat2
Complete LimeSurvey version number (& build)6.x
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMariaDB 10.1.48
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache
PHP Version8.1
Git branch / Pull Request URL

Relationships

related to 18468 closedc_schmitz User with rights to view other users can not see them at the survey permission screen 

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2023-06-12 15:05

developer   ~75547

I don't really understand the point under this file ?

A lot must be in Permisssion , not link to Survey. Must have on all other object with Permission. And for some object there are some specificity.

Issue History

Date Modified Username Field Change
2023-06-12 14:46 gabrieljenik New Issue
2023-06-12 14:46 gabrieljenik Issue generated from: 18468
2023-06-12 14:46 gabrieljenik Relationship added related to 18468
2023-06-12 14:47 gabrieljenik Status new => confirmed
2023-06-12 15:05 DenisChenu Note Added: 75547
2023-06-12 15:05 DenisChenu Bug heat 0 => 2
2023-08-07 16:08 gabrieljenik Priority none => normal
2023-08-07 16:08 gabrieljenik Severity block => tweak
2023-08-07 16:08 gabrieljenik Project Bug reports => @10@
2026-11-24 21:42 c_schmitz Status confirmed => closed
2026-11-24 21:42 c_schmitz Resolution open => won't fix