fossasia/engelsystem

View on GitHub

Showing 198 of 271 total issues

Method user_angeltype_add_controller has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function user_angeltype_add_controller() {
  global $user, $privileges;

  if (! isset($_REQUEST['angeltype_id'])) {
    error(_("Angeltype doesn't exist."));
Severity: Major
Found in includes/controller/user_angeltypes_controller.php - About 3 hrs to fix

    Method Users_view has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function Users_view($users, $order_by, $arrived_count, $active_count, $force_active_count, $freeloads_count, $tshirts_count, $voucher_count) {
      $search = "";
      $users_matched = [];
      if (isset($_REQUEST['search']))
        $search = strip_request_item('search');
    Severity: Major
    Found in includes/view/User_view.php - About 2 hrs to fix

      Method admin_free has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function admin_free() {
        global $privileges;
      
        $search = "";
        if (isset($_REQUEST['search']))
      Severity: Major
      Found in includes/controller/admin_free_controller.php - About 2 hrs to fix

        Method user_driver_license_edit_controller has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function user_driver_license_edit_controller() {
          global $privileges, $user;
        
          if (isset($_REQUEST['user_id'])) {
            $user_source = User($_REQUEST['user_id']);
        Severity: Major
        Found in includes/controller/user_driver_licenses_controller.php - About 2 hrs to fix

          Function Shift_signup_allowed has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function Shift_signup_allowed($shift, $angeltype, $user_angeltype = null, $user_shifts = null) {
            global $user, $privileges;
          
            if ($user_shifts == null) {
              $user_shifts = Shifts_by_user($user);
          Severity: Minor
          Found in includes/model/Shifts_model.php - About 2 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method guest_login has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function guest_login() {
            global $user, $privileges;
          
            $nick = "";
          
          
          Severity: Major
          Found in includes/controller/guest_login_controller.php - About 2 hrs to fix

            Method header_toolbar has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function header_toolbar() {
              global $p, $privileges, $user, $enable_tshirt_size, $max_freeloadable_shifts;
              $settings = array();
              $no_migrated = "";
              if (test_import()) {
            Severity: Major
            Found in includes/sys_menu.php - About 2 hrs to fix

              Method User_insert has 21 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function User_insert($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $password_hash, $comment, $hometown, $twitter, $facebook, $github, $organization, $organization_web, $timezone, $planned_arrival_date) {
              Severity: Major
              Found in includes/model/User_model.php - About 2 hrs to fix

                Function Shift_view has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                function Shift_view($shift, $shifttype, $room, $shift_admin, $angeltypes_source, $user_shift_admin, $admin_rooms, $admin_shifttypes, $user_shifts, $signed_up) {
                  $parsedown = new Parsedown();
                
                  $angeltypes = [];
                  foreach ($angeltypes_source as $angeltype)
                Severity: Minor
                Found in includes/view/Shifts_view.php - About 2 hrs to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method user_password_recovery_controller has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function user_password_recovery_controller() {
                  if (isset($_REQUEST['token'])) {
                    $user_source = User_by_password_recovery_token($_REQUEST['token']);
                    if ($user_source === false)
                      engelsystem_error("Unable to load user.");
                Severity: Major
                Found in includes/controller/users_controller.php - About 2 hrs to fix

                  Function admin_create_groups has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function admin_create_groups() {
                  
                    global $user;
                  
                    $name = "";
                  Severity: Minor
                  Found in includes/controller/admin_cgroups_controller.php - About 2 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Function Users_view has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Users_view($users, $order_by, $arrived_count, $active_count, $force_active_count, $freeloads_count, $tshirts_count, $voucher_count) {
                    $search = "";
                    $users_matched = [];
                    if (isset($_REQUEST['search']))
                      $search = strip_request_item('search');
                  Severity: Minor
                  Found in includes/view/User_view.php - About 2 hrs to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method angeltype_edit_controller has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function angeltype_edit_controller() {
                    global $privileges, $user;
                  
                    $name = "";
                    $restricted = false;
                  Severity: Major
                  Found in includes/controller/angeltypes_controller.php - About 2 hrs to fix

                    Method shifttype_edit_controller has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function shifttype_edit_controller() {
                      $shifttype_id = null;
                      $name = "";
                      $angeltype_id = null;
                      $description = "";
                    Severity: Major
                    Found in includes/controller/shifttypes_controller.php - About 2 hrs to fix

                      Method update_user has 17 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      function update_user($eNick, $eName, $eVorname, $eTelefon, $eHandy, $eAlter, $eDECT, $eemail, $email_shiftinfo, $ejabber, $eSize, $eGekommen, $eAktiv, $force_active, $eTshirt, $Hometown, $id) {
                      Severity: Major
                      Found in includes/model/User_model.php - About 2 hrs to fix

                        Function admin_news has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function admin_news() {
                          global $user;
                        
                          if (! isset($_GET["action"])) {
                            redirect(page_link_to("news"));
                        Severity: Minor
                        Found in includes/controller/admin_news_controller.php - About 2 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method update_user_details has 16 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function update_user_details($nick, $prename, $lastname, $age, $tel, $dect, $mobile, $mail, $email_shiftinfo, $jabber, $tshirt_size, $hometown, $planned_arrival_date, $planned_departure_date, $timezone, $uid) {
                        Severity: Major
                        Found in includes/model/User_model.php - About 2 hrs to fix

                          Method user_angeltype_update_controller has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function user_angeltype_update_controller() {
                            global $user, $privileges;
                          
                            if (! in_array('admin_angel_types', $privileges)) {
                              error(_("You are not allowed to set coordinator rights."));
                          Severity: Minor
                          Found in includes/controller/user_angeltypes_controller.php - About 1 hr to fix

                            Method admin_create_groups has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function admin_create_groups() {
                            
                              global $user;
                            
                              $name = "";
                            Severity: Minor
                            Found in includes/controller/admin_cgroups_controller.php - About 1 hr to fix

                              Method admin_news has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function admin_news() {
                                global $user;
                              
                                if (! isset($_GET["action"])) {
                                  redirect(page_link_to("news"));
                              Severity: Minor
                              Found in includes/controller/admin_news_controller.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language