APO-Epsilon/apo-website

View on GitHub

Showing 167 of 11,898 total issues

Function grade_quiz has a Cognitive Complexity of 124 (exceeds 5 allowed). Consider refactoring.
Open

function grade_quiz() {
    //This part of the code is ridiculously hardcoded for now. Should use SQL to check for correct answers.
    $score = 0;
    //questions
    if(isset($_POST["1"])) {
Severity: Minor
Found in risk_management_quiz.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

File attendance_admin.php has 926 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
require_once ('session.php');
require_once ('mysql_access.php');
?>
<!doctype html>
Severity: Major
Found in attendance_admin.php - About 2 days to fix

    Function displayListing has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring.
    Open

    function displayListing(){
    include('mysql_access.php');
    $id = $_SESSION['sessionID'];
    $sql = "SELECT d.event_id, d.DOW, d.start, d.end, d.length, e.name, o.theDate
    FROM service_details AS d
    Severity: Minor
    Found in service_signup.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 grade_quiz has 315 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function grade_quiz() {
        //This part of the code is ridiculously hardcoded for now. Should use SQL to check for correct answers.
        $score = 0;
        //questions
        if(isset($_POST["1"])) {
    Severity: Major
    Found in risk_management_quiz.php - About 1 day to fix

      Method display_log_form has 294 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function display_log_form(){
      
          $id = $_POST['event'];//WORKS
          $sql = "SELECT events.name AS name, occurrence.date AS date, occurrence.id AS id
                  FROM events
      Severity: Major
      Found in attendance_admin.php - About 1 day to fix

        Method displayListing has 292 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function displayListing(){
          include('mysql_access.php');
          $dateMapNew = array(1,0,6,5,4,3,2);
          $dateMap1 = array(0,6,5,4,3,2,1);
          $currentDOW1 = date('w');//returns integer of DOW
        Severity: Major
        Found in service_admin_week.php - About 1 day to fix

          Method process_add has 288 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function process_add(){//A.K.A. FUNCTION BITCH()
              $name = $_POST['name'];
              $day = $_POST['day'];
              $year = $_POST['year'];
              $month = $_POST['month'];
          Severity: Major
          Found in attendance_admin.php - About 1 day to fix

            Method show_page has 287 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function show_page() {
              include('mysql_access.php');
              global $current_semester;
            
              if (isset($_POST['update'])) {
            Severity: Major
            Found in updateinfo.php - About 1 day to fix

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

              function show_active(){
                  //Start loading external resources
                  ?>
                  <script src='/js/foundation/foundation.js'></script>
                  <script src='/js/foundation/foundation.reveal.js'></script>
              Severity: Major
              Found in upload_photo.php - About 1 day to fix

                Method display has 215 lines of code (exceeds 25 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: Major
                Found in create_event.php - About 1 day to fix

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

                  function displayListing(){
                    include('mysql_access.php');
                    $dateMapNew = array(1,0,6,5,4,3,2);
                    $dateMap1 = array(0,6,5,4,3,2,1);
                    $currentDOW1 = date('w');//returns integer of DOW
                  Severity: Minor
                  Found in service_admin_week.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 show_active has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function show_active() {
                      echo "<h1>Events you are leading:</h1>";
                  
                      $user_id = $_SESSION['sessionID'];
                         include('mysql_access.php');
                  Severity: Minor
                  Found in leader_list.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 display has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function display($group) {
                      if($group == 'All (sorted)') 
                      {
                          echo '<h2>Active Members</h2>';
                          display_active_members();
                  Severity: Minor
                  Found in membership.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 displayListing has 193 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function displayListing(){
                  include('mysql_access.php');
                  $id = $_SESSION['sessionID'];
                  $sql = "SELECT d.event_id, d.DOW, d.start, d.end, d.length, e.name, o.theDate
                  FROM service_details AS d
                  Severity: Major
                  Found in service_signup.php - About 7 hrs to fix

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

                    function display($event_type) {
                            include('mysql_access.php');
                            $user_id = $_SESSION['sessionID'];
                    
                            echo "Displaying " . $event_type . " Events";
                    Severity: Minor
                    Found in event_signup.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 show_page has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function show_page() {
                      require_once('mysql_access.php');
                    ?>
                      <div class='large-12 medium-12 small-12 column'>
                        <h1>Member Information</h1>
                    Severity: Major
                    Found in members_list.php - About 7 hrs to fix

                      Function display_event_table has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function display_event_table($rtype)
                      {
                          include('mysql_access.php');
                          $user_id = $_SESSION['sessionID'];
                          //get events for the user
                      Severity: Minor
                      Found in check_requirements.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 show_form has 184 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function show_form() {
                      if(isset($result)) {
                        echo $result;
                      }
                      $month_no = date('n');
                      Severity: Major
                      Found in service_hours.php - About 7 hrs to fix

                        File risk_management_quiz.php has 463 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 risk_management_quiz.php - About 7 hrs to fix

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

                          function show_active() {
                          
                              include('mysql_access.php');
                              $position = $_SESSION['sessionposition'];
                              echo $position;
                          Severity: Minor
                          Found in edit_exec.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

                          Severity
                          Category
                          Status
                          Source
                          Language