EotvosCollegium / mars

Function with cyclomatic complexity higher than threshold found PHP-R1006
Anti-pattern
Minor
9 days ago6 months old
updatePermission has a cyclomatic complexity of 19 with "High" risk
282     * @param RoleObject|Workshop|null $object
283     * @return bool
284     */
285    public function updatePermission(User $user, User $target, Role $role, Workshop|RoleObject $object = null): bool286    {
287        if ($role->name == Role::TENANT) {
288            return $user->hasRole([Role::STAFF, Role::STUDENT_COUNCIL => Role::STUDENT_COUNCIL_LEADERS]);
missingData has a cyclomatic complexity of 16 with "High" risk
246     * Determine whether the application is ready to submit.
247     * @return array The missing data.
248     */
249    public function missingData(): array250    {
251        $user = $this->user;
252        $educationalInformation = $user->educationalInformation;
handle has a cyclomatic complexity of 31 with "Very high" risk
 41     *
 42     * @return mixed
 43     */
 44    public function handle() 45    {
 46        if ($this->option('force')) {
 47            //set expression based on arguments