fossasia/engelsystem

View on GitHub

Showing 198 of 271 total issues

Function shifttype_edit_controller has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

function shifttype_edit_controller() {
  $shifttype_id = null;
  $name = "";
  $angeltype_id = null;
  $description = "";
Severity: Minor
Found in includes/controller/shifttypes_controller.php - About 4 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_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

    File sys_template.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * List of available themes
     */
    $themes = array(
    Severity: Minor
    Found in includes/sys_template.php - About 4 hrs to fix

      Function User_view has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      function User_view($user_source, $admin_user_privilege, $freeloader, $user_angeltypes, $user_groups, $shifts, $its_me) {
        global $LETZTES_AUSTRAGEN, $privileges;
        $user_name = htmlspecialchars($user_source['Vorname']) . " " . htmlspecialchars($user_source['Name']);
        $myshifts_table = array();
        $timesum = 0;
      Severity: Minor
      Found in includes/view/User_view.php - About 4 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 admin_settings has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function admin_settings() {
      
        $ok = false;
        $msg = "";
        $event_name = "";
      Severity: Major
      Found in includes/controller/admin_settings_controller.php - About 4 hrs to fix

        File User_view.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * Available T-Shirt sizes
         */
        Severity: Minor
        Found in includes/view/User_view.php - About 4 hrs to fix

          File admin_import_controller.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          function admin_import_title() {
            return _("Frab import");
          }
          Severity: Minor
          Found in includes/controller/admin_import_controller.php - About 3 hrs to fix

            File user_settings_controller.php has 325 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            function settings_title() {
              return _("Settings");
            }
            function user_settings() {
            Severity: Minor
            Found in includes/controller/user_settings_controller.php - About 3 hrs to fix

              File admin_shifts_controller.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              function admin_shifts_title() {
                return _("Create shifts");
              }
              Severity: Minor
              Found in includes/controller/admin_shifts_controller.php - About 3 hrs to fix

                File user_angeltypes_controller.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                /**
                 * Display a hint for team/angeltype coordinators if there are unconfirmed users for his angeltype.
                 */
                Severity: Minor
                Found in includes/controller/user_angeltypes_controller.php - About 3 hrs to fix

                  Method install_admin has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function install_admin() {
                  
                    $ok = false;
                    $msg = "";
                    $username = "";
                  Severity: Major
                  Found in install.php - About 3 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

                      Function user_questions has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function user_questions() {
                        global $user;
                        if (! isset($_REQUEST['action'])) {
                          $open_questions = select_open_questions($user['UID']);
                          $answered_questions = select_ansd_questions($user['UID']);
                      Severity: Minor
                      Found in includes/controller/user_questions_controller.php - About 3 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 admin_events has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function admin_events() {
                      
                        global $user;
                        $timezone_identifiers = DateTimeZone::listIdentifiers();
                        $timezone = $user['timezone'];
                      Severity: Major
                      Found in includes/controller/admin_events_controller.php - About 3 hrs to fix

                        Function guest_login has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function guest_login() {
                          global $user, $privileges;
                        
                          $nick = "";
                        
                        
                        Severity: Minor
                        Found in includes/controller/guest_login_controller.php - About 3 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 admin_free has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function admin_free() {
                          global $privileges;
                        
                          $search = "";
                          if (isset($_REQUEST['search']))
                        Severity: Minor
                        Found in includes/controller/admin_free_controller.php - About 3 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 Shift_view has 81 lines of code (exceeds 25 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: Major
                        Found in includes/view/Shifts_view.php - About 3 hrs to fix

                          Method insert_user has 25 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

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

                            Method user_myshifts has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function user_myshifts() {
                              global $LETZTES_AUSTRAGEN;
                              global $user, $privileges;
                              $timezone_identifiers = DateTimeZone::listIdentifiers();
                              $timezone = $user['timezone'];
                            Severity: Major
                            Found in includes/controller/user_myshifts_controller.php - About 3 hrs to fix

                              Method admin_groups has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function admin_groups() {
                                global $user;
                              
                                $html = "";
                                $groups = Groups_by_name();
                              Severity: Major
                              Found in includes/controller/admin_groups_controller.php - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language