jhuesser/bzu-jodel-clone

View on GitHub
functions/usermanipulation.php

Summary

Maintainability
A
3 hrs
Test Coverage

Showing 4 of 4 total issues

Function manipulateUser has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function manipulateUser($user, $role, $mycaps){
global $apiroot;
$execute = false;
switch($role){
case 0:
Severity: Minor
Found in functions/usermanipulation.php - About 1 hr to fix

Method manipulateUser has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function manipulateUser($user, $role, $mycaps){
global $apiroot;
$execute = false;
switch($role){
case 0:
Severity: Minor
Found in functions/usermanipulation.php - About 1 hr to fix

The function manipulateUser() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10.
Confirmed

function manipulateUser($user, $role, $mycaps){
global $apiroot;
$execute = false;
switch($role){
case 0:
Severity: Minor
Found in functions/usermanipulation.php by phpmd

Avoid unused local variables such as '$config'.
Open

global $apiroot, $config;
Severity: Minor
Found in functions/usermanipulation.php by phpmd
Category
Status