fossasia/engelsystem

View on GitHub
includes/view/AngelTypes_view.php

Summary

Maintainability
D
2 days
Test Coverage

Showing 10 of 10 total issues

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

function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
$buttons = [
button(page_link_to('angeltypes'), _("Angeltypes"), 'back')
];
 
 
Severity: Minor
Found in includes/view/AngelTypes_view.php - About 5 hrs to fix

Method AngelType_view has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
$buttons = [
button(page_link_to('angeltypes'), _("Angeltypes"), 'back')
];
 
 
Severity: Major
Found in includes/view/AngelTypes_view.php - About 4 hrs to fix

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

    function AngelType_render_membership($user_angeltype) {
    $membership = "";
    if ($user_angeltype['user_angeltype_id'] != null) {
    if ($user_angeltype['restricted']) {
    if ($user_angeltype['confirm_user_id'] == null)
    Severity: Minor
    Found in includes/view/AngelTypes_view.php - About 1 hr to fix

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

    function AngelTypes_about_view($angeltypes, $user_logged_in) {
    global $faq_url;
     
    $content = array(
    buttons(array(
    Severity: Minor
    Found in includes/view/AngelTypes_view.php - About 1 hr to fix

    Method AngelTypes_about_view has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function AngelTypes_about_view($angeltypes, $user_logged_in) {
    global $faq_url;
     
    $content = array(
    buttons(array(
    Severity: Minor
    Found in includes/view/AngelTypes_view.php - About 1 hr to fix

      Method AngelType_view has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function AngelType_view($angeltype, $members, $user_angeltype, $admin_user_angeltypes, $admin_angeltypes, $coordinator, $user_driver_license, $user) {
      Severity: Major
      Found in includes/view/AngelTypes_view.php - About 1 hr to fix

        Method AngelType_edit_view has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function AngelType_edit_view($name, $restricted, $description, $coordinator_mode, $requires_driver_license) {
        Severity: Minor
        Found in includes/view/AngelTypes_view.php - About 35 mins to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          function AngelType_delete_view($angeltype) {
          return page_with_title(sprintf(_("Delete angeltype %s"), $angeltype['name']), array(
          info(sprintf(_("Do you want to delete angeltype %s?"), $angeltype['name']), true),
          buttons(array(
          button(page_link_to('angeltypes'), _("cancel"), 'cancel'),
          Severity: Major
          Found in includes/view/AngelTypes_view.php and 1 other location - About 4 hrs to fix
          includes/view/ShiftTypes_view.php on lines 10..18

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          if ($angeltype['user_angeltype_id'] != null)
          $buttons[] = button(page_link_to('user_angeltypes') . '&action=delete&user_angeltype_id=' . $angeltype['user_angeltype_id'], _("leave"), 'cancel');
          else
          $buttons[] = button(page_link_to('user_angeltypes') . '&action=add&angeltype_id=' . $angeltype['id'], _("join"), 'add');
          Severity: Major
          Found in includes/view/AngelTypes_view.php and 1 other location - About 1 hr to fix
          includes/controller/angeltypes_controller.php on lines 228..232

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          $member['actions'] = table_buttons([
          button(page_link_to('user_angeltypes') . '&action=confirm&user_angeltype_id=' . $member['user_angeltype_id'], _("confirm"), 'btn-xs'),
          button(page_link_to('user_angeltypes') . '&action=delete&user_angeltype_id=' . $member['user_angeltype_id'], _("deny"), 'btn-xs')
          ]);
          Severity: Major
          Found in includes/view/AngelTypes_view.php and 1 other location - About 1 hr to fix
          includes/view/ShiftTypes_view.php on lines 62..65

          There are no issues that match your filters.

          Category
          Status