fossasia/engelsystem

View on GitHub

Showing 198 of 271 total issues

Function admin_arrive has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

function admin_arrive() {
  $msg = "";
  $search = "";
  if (isset($_REQUEST['search']))
    $search = strip_request_item('search');
Severity: Minor
Found in includes/controller/admin_arrive_controller.php - About 7 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_settings has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

function admin_settings() {

  $ok = false;
  $msg = "";
  $event_name = "";
Severity: Minor
Found in includes/controller/admin_settings_controller.php - About 7 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_rooms has 180 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function admin_rooms() {
  global $user;

  $event_source = sql_select("SELECT * FROM `Events` ORDER BY `name`");
  $events = array();
Severity: Major
Found in includes/controller/admin_rooms_controller.php - About 7 hrs to fix

    Function user_myshifts has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    function user_myshifts() {
      global $LETZTES_AUSTRAGEN;
      global $user, $privileges;
      $timezone_identifiers = DateTimeZone::listIdentifiers();
      $timezone = $user['timezone'];
    Severity: Minor
    Found in includes/controller/user_myshifts_controller.php - About 6 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_arrive has 171 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function admin_arrive() {
      $msg = "";
      $search = "";
      if (isset($_REQUEST['search']))
        $search = strip_request_item('search');
    Severity: Major
    Found in includes/controller/admin_arrive_controller.php - About 6 hrs to fix

      File guest_login_controller.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      function login_title() {
        return _("Login");
      }
      Severity: Minor
      Found in includes/controller/guest_login_controller.php - About 6 hrs to fix

        Function admin_groups has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

        function admin_groups() {
          global $user;
        
          $html = "";
          $groups = Groups_by_name();
        Severity: Minor
        Found in includes/controller/admin_groups_controller.php - About 6 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_active has 155 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function admin_active() {
          global $tshirt_sizes, $shift_sum_formula;
        
          $msg = "";
          $search = "";
        Severity: Major
        Found in includes/controller/admin_active_controller.php - About 6 hrs to fix

          Function user_driver_license_edit_controller has a Cognitive Complexity of 39 (exceeds 5 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: Minor
          Found in includes/controller/user_driver_licenses_controller.php - About 5 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

          File User_model.php has 410 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          /**
           * User model
           */
          Severity: Minor
          Found in includes/model/User_model.php - About 5 hrs to fix

            Method admin_export has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function admin_export() {
              // Export User data
              if(isset($_REQUEST['download'])){
                $filename = tempnam('/tmp', '.csv'); //  Temporary File Name
                create_temporary_table(); // Create temporary table
            Severity: Major
            Found in includes/controller/admin_export_controller.php - About 5 hrs to fix

              Method admin_user has 141 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function admin_user() {
                global $user, $privileges, $tshirt_sizes, $privileges;
              
                $html = '';
              
              
              Severity: Major
              Found in includes/controller/admin_user_controller.php - About 5 hrs to fix

                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

                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 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

                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_events has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                function admin_events() {
                
                  global $user;
                  $timezone_identifiers = DateTimeZone::listIdentifiers();
                  $timezone = $user['timezone'];
                Severity: Minor
                Found in includes/controller/admin_events_controller.php - About 5 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 angeltype_edit_controller has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                Open

                function angeltype_edit_controller() {
                  global $privileges, $user;
                
                  $name = "";
                  $restricted = false;
                Severity: Minor
                Found in includes/controller/angeltypes_controller.php - About 5 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 install_admin has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                Open

                function install_admin() {
                
                  $ok = false;
                  $msg = "";
                  $username = "";
                Severity: Minor
                Found in install.php - About 5 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_messages has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function user_messages() {
                  global $user;
                
                  if (! isset($_REQUEST['action'])) {
                    $users = user_by_nick($user['UID']);
                Severity: Major
                Found in includes/controller/user_messages_controller.php - About 5 hrs to fix

                  Function header_toolbar has a Cognitive Complexity of 34 (exceeds 5 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: Minor
                  Found in includes/sys_menu.php - About 5 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_view has 118 lines of code (exceeds 25 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: Major
                  Found in includes/view/User_view.php - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language