fossasia/engelsystem

View on GitHub

Showing 198 of 271 total issues

Function view_user_shifts has a Cognitive Complexity of 324 (exceeds 5 allowed). Consider refactoring.
Open

function view_user_shifts() {
  global $user, $privileges;
  global $ical_shifts;

  $ical_shifts = array();
Severity: Minor
Found in includes/controller/user_shifts_controller.php - About 6 days 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 user_shifts has a Cognitive Complexity of 287 (exceeds 5 allowed). Consider refactoring.
Open

function user_shifts() {
  global $user, $privileges;
  $timezone_identifiers = DateTimeZone::listIdentifiers();
  $timezone = $user['timezone'];
  date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Minor
Found in includes/controller/user_shifts_controller.php - About 5 days 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_shifts has a Cognitive Complexity of 164 (exceeds 5 allowed). Consider refactoring.
Open

function admin_shifts() {
  global $user;
  $timezone_identifiers = DateTimeZone::listIdentifiers();
  $timezone = $user['timezone'];
  date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Minor
Found in includes/controller/admin_shifts_controller.php - About 3 days 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_rooms has a Cognitive Complexity of 116 (exceeds 5 allowed). Consider refactoring.
Open

function admin_rooms() {
  global $user;

  $event_source = sql_select("SELECT * FROM `Events` ORDER BY `name`");
  $events = array();
Severity: Minor
Found in includes/controller/admin_rooms_controller.php - About 2 days 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_shifts has 452 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function user_shifts() {
  global $user, $privileges;
  $timezone_identifiers = DateTimeZone::listIdentifiers();
  $timezone = $user['timezone'];
  date_default_timezone_set ("$timezone_identifiers[$timezone]");
Severity: Major
Found in includes/controller/user_shifts_controller.php - About 2 days to fix

    File user_shifts_controller.php has 874 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    function shifts_title() {
      return _("Shifts");
    }
    Severity: Major
    Found in includes/controller/user_shifts_controller.php - About 2 days to fix

      Function guest_register has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
      Open

      function guest_register() {
        global $tshirt_sizes, $enable_tshirt_size, $default_theme;
      
        $msg = "";
        $nick = "";
      Severity: Minor
      Found in includes/controller/guest_login_controller.php - About 2 days 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 user_settings has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
      Open

      function user_settings() {
        global $enable_tshirt_size, $tshirt_sizes, $themes, $locales;
        global $user;
        $msg = "";
        $nick = $user['Nick'];
      Severity: Minor
      Found in includes/controller/user_settings_controller.php - About 2 days 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 view_user_shifts has 382 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function view_user_shifts() {
        global $user, $privileges;
        global $ical_shifts;
      
        $ical_shifts = array();
      Severity: Major
      Found in includes/controller/user_shifts_controller.php - About 1 day to fix

        Method guest_register has 329 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function guest_register() {
          global $tshirt_sizes, $enable_tshirt_size, $default_theme;
        
          $msg = "";
          $nick = "";
        Severity: Major
        Found in includes/controller/guest_login_controller.php - About 1 day to fix

          Method user_settings has 318 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function user_settings() {
            global $enable_tshirt_size, $tshirt_sizes, $themes, $locales;
            global $user;
            $msg = "";
            $nick = $user['Nick'];
          Severity: Major
          Found in includes/controller/user_settings_controller.php - About 1 day to fix

            Method admin_shifts has 314 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function admin_shifts() {
              global $user;
              $timezone_identifiers = DateTimeZone::listIdentifiers();
              $timezone = $user['timezone'];
              date_default_timezone_set ("$timezone_identifiers[$timezone]");
            Severity: Major
            Found in includes/controller/admin_shifts_controller.php - About 1 day to fix

              Function user_messages has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
              Open

              function user_messages() {
                global $user;
              
                if (! isset($_REQUEST['action'])) {
                  $users = user_by_nick($user['UID']);
              Severity: Minor
              Found in includes/controller/user_messages_controller.php - About 1 day 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_import has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
              Open

              function admin_import() {
                global $rooms_import;
                global $user;
                $html = "";
              
              
              Severity: Minor
              Found in includes/controller/admin_import_controller.php - About 1 day 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_active has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
              Open

              function admin_active() {
                global $tshirt_sizes, $shift_sum_formula;
              
                $msg = "";
                $search = "";
              Severity: Minor
              Found in includes/controller/admin_active_controller.php - About 1 day 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_export has a Cognitive Complexity of 57 (exceeds 5 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: Minor
              Found in includes/controller/admin_export_controller.php - About 1 day 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 user_password_recovery_controller has a Cognitive Complexity of 56 (exceeds 5 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: Minor
              Found in includes/controller/users_controller.php - About 1 day 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_import has 218 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function admin_import() {
                global $rooms_import;
                global $user;
                $html = "";
              
              
              Severity: Major
              Found in includes/controller/admin_import_controller.php - About 1 day to fix

                Function admin_user has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                Open

                function admin_user() {
                  global $user, $privileges, $tshirt_sizes, $privileges;
                
                  $html = '';
                
                
                Severity: Minor
                Found in includes/controller/admin_user_controller.php - About 1 day 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 user_angeltype_add_controller has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                Open

                function user_angeltype_add_controller() {
                  global $user, $privileges;
                
                  if (! isset($_REQUEST['angeltype_id'])) {
                    error(_("Angeltype doesn't exist."));
                Severity: Minor
                Found in includes/controller/user_angeltypes_controller.php - About 1 day 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

                Severity
                Category
                Status
                Source
                Language