fossasia/engelsystem

View on GitHub
includes/controller/admin_questions_controller.php

Summary

Maintainability
C
1 day
Test Coverage

Showing 4 of 4 total issues

Function admin_questions has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

function admin_questions() {
global $user;
 
if (! isset($_REQUEST['action'])) {
$unanswered_questions_table = array();
Severity: Minor
Found in includes/controller/admin_questions_controller.php - About 5 hrs to fix

Method admin_questions has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function admin_questions() {
global $user;
 
if (! isset($_REQUEST['action'])) {
$unanswered_questions_table = array();
Severity: Major
Found in includes/controller/admin_questions_controller.php - About 3 hrs to fix

    Avoid too many return statements within this method.
    Open

    return error("No question found.", true);
    Severity: Major
    Found in includes/controller/admin_questions_controller.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

      return error("Incomplete call, missing Question ID.", true);
      Severity: Major
      Found in includes/controller/admin_questions_controller.php - About 30 mins to fix
        Category
        Status