APO-Epsilon/apo-website

View on GitHub

Showing 167 of 11,898 total issues

Method show_active has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function show_active() {
    include('mysql_access.php');
    $user_id = $_SESSION['sessionID'];    
    $aresponse=$db->query("SELECT status FROM contact_information WHERE id=$user_id");
    $aresult=mysqli_fetch_array($aresponse);
Severity: Major
Found in create_event_done.php - About 3 hrs to fix

    Function display has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    function display($event_type) {
            include('mysql_access.php');
            $user_id = $_SESSION['sessionID'];    
            $response=$db->query("SELECT MAX(event_id) FROM events_listing");
            $result=mysqli_fetch_array($response);
    Severity: Minor
    Found in create_event.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 processAttendance has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function processAttendance($d,$o){
      include('mysql_access.php');
      echo "<h1>Process Attendance</h1>";
      echo "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
    
    
    Severity: Major
    Found in service_leader_functions.php - About 3 hrs to fix

      Method list_stats has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function list_stats($hours_id, $semester) {
        include ('mysql_access.php');
        global $total_query;
        // Total Hours
        $sql = "SELECT SUM(hours) AS `sum_hours` FROM `recorded_hours` WHERE `user_id` = '$hours_id' AND `semester` = '$semester' LIMIT 1";
      Severity: Major
      Found in service_hours.php - About 3 hrs to fix

        Method display_add_form has 90 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function display_add_form($active_semester){
        
            $sql = "SELECT * FROM `apo`.`events`";
            $result = mysql_query($sql);
                if($result){
        Severity: Major
        Found in attendance_admin.php - About 3 hrs to fix

          Function backup_tables has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
          Open

          function backup_tables($tables = '*')
          {
            include('mysql_access.php');
            //get all of the tables
            if($tables == '*')
          Severity: Minor
          Found in backup.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 show_active has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function show_active() {
            include('mysql_access.php');
            //Generate a dropdown box
            $sql = "SELECT id, lastname, firstname FROM contact_information UNION DISTINCT SELECT id, lastname, firstname FROM alumni UNION DISTINCT SELECT id, lastname, firstname FROM alumni_info ORDER BY lastname ASC;";
            $result = $db->query($sql);
          Severity: Major
          Found in family_tree_add.php - About 3 hrs to fix

            File event_signup.php has 310 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            require_once ('session.php');
            require_once ('mysql_access.php');
            ?>
            <!doctype html>
            Severity: Minor
            Found in event_signup.php - About 3 hrs to fix

              Method attendance_check has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function attendance_check($user_id){
                  $sql = "SELECT occurrence.e_id AS e_id, occurrence.id AS id, occurrence.date AS date,
                          events.name AS name, events.worth AS worth, occurrence.type AS type,
                          recorded_attendance.attended AS attended
                          FROM occurrence
              Severity: Major
              Found in attendance_check.php - About 3 hrs to fix

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

                function list_stats($hours_id, $semester) {
                  include ('mysql_access.php');
                  include('requirements.php');
                  // Total Hours
                  $sql = "SELECT SUM(hours) AS `sum_hours` FROM `recorded_hours` WHERE `user_id` = '$hours_id' AND `semester` = '$semester' LIMIT 1";
                Severity: Minor
                Found in check_requirements.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 email_new_pw has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function email_new_pw($to) {
                    
                    include ('mysql_access.php');
                    
                    $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
                Severity: Major
                Found in login_forgotpw.php - About 3 hrs to fix

                  Function show_active has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function show_active() {
                      //Code based on example at https://vikasmahajan.wordpress.com/2010/07/07/inserting-and-displaying-images-in-mysql-using-php/
                      include('../mysql_access.php');
                      $user_id = $_SESSION['sessionID'];
                      $maxsize = 3000000;
                  Severity: Minor
                  Found in includes/upload_photo_process.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 email_new_pw has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function email_new_pw($to) {
                      
                      include ('mysql_access.php');
                      
                      $aresponse=$db->query("SELECT username FROM contact_information WHERE email='$to'");
                  Severity: Minor
                  Found in login_forgotpw.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

                  File service_signup.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  require_once ('session.php');
                  require_once ('mysql_access.php');
                  ?>
                  <!doctype html>
                  Severity: Minor
                  Found in service_signup.php - About 3 hrs to fix

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

                    function initializeNewWeekForm(){
                      include('mysql_access.php');
                      $dateMap1 = array(0,6,5,4,3,2,1);
                      $currentDOW1 = date('w');//returns integer of DOW
                      $z1 = $dateMap1[$currentDOW1];//go through map
                    Severity: Major
                    Found in service_admin_week_setup.php - About 3 hrs to fix

                      File check_requirements.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      require_once ('session.php');
                      require_once ('mysql_access.php');
                      ?>
                      <!doctype html>
                      Severity: Minor
                      Found in check_requirements.php - About 3 hrs to fix

                        Function process_login has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function process_login(){
                          require_once ('mysql_access.php');
                          $username = addslashes($_POST["username"]);
                          $password = addslashes($_POST["password"]);
                          $hasher = new PasswordHash(8, true);
                        Severity: Minor
                        Found in login_process.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 show_active has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function show_active() {
                            include('mysql_access.php');
                            $user_id = $_SESSION['sessionID'];    
                            $aresponse=$db->query("SELECT status FROM contact_information WHERE id=$user_id");
                            $aresult=mysqli_fetch_array($aresponse);
                        Severity: Minor
                        Found in create_event_done.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

                        File upload_photo.php has 287 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        require_once ('session.php');
                        require_once ('mysql_access.php');
                        require_once ('get_photo.php');
                        //Code based on example at https://vikasmahajan.wordpress.com/2010/07/07/inserting-and-displaying-images-in-mysql-using-php/
                        Severity: Minor
                        Found in upload_photo.php - About 2 hrs to fix

                          File create_event.php has 286 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          require_once ('session.php');
                          require_once ('mysql_access.php');
                          ?>
                          <!doctype html>
                          Severity: Minor
                          Found in create_event.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language