APO-Epsilon/apo-website

View on GitHub

Showing 11,898 of 11,898 total issues

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

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

      if(!$result){
        die("error");
      }else{
        echo"<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
        echo"<select name=\"occurrence_id\">";
    Severity: Major
    Found in service_admin_week.php and 1 other location - About 7 hrs to fix
    service_admin_week.php on lines 438..461

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

    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

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

      if(!$result){
        die("error");
      }else{
        echo"<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">";
        echo"<select name=\"occurrence_id\">";
    Severity: Major
    Found in service_admin_week.php and 1 other location - About 7 hrs to fix
    service_admin_week.php on lines 257..281

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

    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

    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

      File service_admin_week.php has 458 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      require_once ('session.php');
      require_once ('mysql_access.php');
      require_once ('service_admin_functions.php');
      ?>
      Severity: Minor
      Found in service_admin_week.php - About 7 hrs to fix

        Function show_page has a Cognitive Complexity of 44 (exceeds 5 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: Minor
        Found in members_list.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

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

        function str_rand($length = 8, $seeds = 'alphanum')
        {
            include ('mysql_access.php');
            // Possible seeds
            $seedings['alpha'] = 'abcdefghijklmnopqrstuvwqyz';
        Severity: Major
        Found in r8conf2016/login_sendpw.php and 1 other location - About 6 hrs to fix
        login_sendpw.php on lines 6..36

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

        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

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

        function str_rand($length = 8, $seeds = 'alphanum')
        {
            include ('mysql_access.php');
            // Possible seeds
            $seedings['alpha'] = 'abcdefghijklmnopqrstuvwqyz';
        Severity: Major
        Found in login_sendpw.php and 1 other location - About 6 hrs to fix
        r8conf2016/login_sendpw.php on lines 6..36

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

        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

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

        function show_active() {
            
            include('mysql_access.php');
            global $current_semester;
            $user_id = $_SESSION['sessionID'];    
        Severity: Minor
        Found in req_view.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 show_exec has 149 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function show_exec() {
                //Let's get a whole bunch of data
                include('../mysql_access.php');
                //Let's count all the registrants
                $sql = "SELECT COUNT(*) AS num_reg FROM conf_contact_information;";
        Severity: Major
        Found in r8conf2016/registration_summary.php - About 5 hrs to fix

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

          function show_active() {
              
              include('mysql_access.php');
              global $current_semester;
              $user_id = $_SESSION['sessionID'];    
          Severity: Major
          Found in req_view.php - About 5 hrs to fix

            Method display has 143 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function display($event_type) {
                    include('mysql_access.php');
                    $user_id = $_SESSION['sessionID'];
            
                    echo "Displaying " . $event_type . " Events";
            Severity: Major
            Found in event_signup.php - About 5 hrs to fix

              File service_hours.php has 396 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              include ('session.php');
              include ('requirements.php');
              include ('mysql_access.php');
              ?>
              Severity: Minor
              Found in service_hours.php - About 5 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                  else if ($description == 'KCOM' || $description == 'Lancaster' || $description == 'CSI Friday' || $description == 'Ray Miller' || $description == 'Pop-Tab Collection' ||$description == 'Twin Pines' ||$description == 'Humane Society' ||$description == 'Adair Co. Library' ||$description == 'Recycling Center' ||$description == 'Bought Hours' ||$description == 'Camp' ||$description == 'Bake sale' ||$description == 'Large Service Project' ||$description == 'Other Service Project' ||$description == 'Non-APO Hours' || $description == 'NMCAA' || $description == 'Multicultural Affairs Center' || $description == "MAC" || $description == 'Highway Cleanup' || $description == 'SAA Babysitting') {
                    $result = "<div class='entry'>The description cannot be the same as the event. Please enter a valid description.<br/></div>";
                  }
                  else {
                    $insert = "INSERT INTO apo.recorded_hours (user_id, event, month, day, year, date, description, hours, servicetype, fundraising, semester, youth) values('$id', '$event', '$month','$day', '$year', '$date', '$description', '$hours', '$servicetype', '$fundraising', '$semester', '$youth') ON DUPLICATE KEY UPDATE description='NEEDS NEW DESCRIPTION';";
                Severity: Critical
                Found in service_hours.php - About 5 hrs to fix

                  File foundation.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * Foundation Responsive Library
                   * http://foundation.zurb.com
                   * Copyright 2014, ZURB
                   * Free to use under the MIT license.
                  Severity: Minor
                  Found in r8conf2016/js/foundation/foundation.js - About 5 hrs to fix

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

                    function show_active() {
                      include('../mysql_access.php');
                      $big_array = [];
                      $little_array = [];
                    
                    
                    Severity: Minor
                    Found in includes/family_tree_add_ajax.php - About 4 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 110 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function show_active() {
                    
                        include('mysql_access.php');
                        $position = $_SESSION['sessionposition'];
                        echo $position;
                    Severity: Major
                    Found in edit_exec.php - About 4 hrs to fix

                      Method display_event_table has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function display_event_table($rtype)
                      {
                          include('mysql_access.php');
                          $user_id = $_SESSION['sessionID'];
                          //get events for the user
                      Severity: Major
                      Found in check_requirements.php - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language