APO-Epsilon/apo-website

View on GitHub

Showing 11,898 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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              <?php
              
              $exec_page = True;
              $active_page = False;
              $public_page = True;
              Severity: Major
              Found in editable_page.php and 1 other location - About 1 day to fix
              r8conf2016/editable_page.php on lines 1..68

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 317.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              <?php
              
              $exec_page = True;
              $active_page = False;
              $public_page = True;
              Severity: Major
              Found in r8conf2016/editable_page.php and 1 other location - About 1 day to fix
              editable_page.php on lines 1..68

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 317.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                if (isset($_POST['update'])) {
                  // Update Information
                  $_POST = array_map('array_map_calllback', $_POST);
                  $user_id = $_SESSION['sessionID'];
              $sql = <<<SQL
              Severity: Major
              Found in updateinfo.php and 1 other location - About 1 day to fix
              status_change.php on lines 25..178

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 297.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                if (isset($_POST['update'])) {
                  // Update Information
                  $_POST = array_map('mysql_real_escape_string', $_POST);
                  $user_id = $_SESSION['sessionID'];
              $sql = <<<SQL
              Severity: Major
              Found in status_change.php and 1 other location - About 1 day to fix
              updateinfo.php on lines 40..352

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 297.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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
                      Severity
                      Category
                      Status
                      Source
                      Language