APO-Epsilon/apo-website

View on GitHub

Showing 11,898 of 11,898 total issues

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

function did_user_attend ($uid,$eid)
{
    include('mysql_access.php');
    $query = "SELECT user_id FROM events_signup WHERE event_id = '$eid' AND user_id = '$uid'";
    $results=$db->query($query);
Severity: Major
Found in retrieve_event.php and 1 other location - About 1 hr to fix
retrieve_event.php on lines 66..85

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

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

function is_user_excused ($uid,$eid)
{
    include('mysql_access.php');
    $query = "SELECT user_id FROM excused WHERE event_id = '$eid' AND user_id = '$uid'";
    $results=$db->query($query);
Severity: Major
Found in retrieve_event.php and 1 other location - About 1 hr to fix
retrieve_event.php on lines 45..64

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

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 top_hours has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function top_hours() {
  include ('mysql_access.php');
  global $current_semester;
  $sql = "SELECT contact_information.firstname, contact_information.lastname, SUM( hours ) AS  `sum_hours` FROM  `recorded_hours` ,  `contact_information` WHERE contact_information.id = recorded_hours.user_id AND `semester` = '$current_semester' GROUP BY (`user_id`) ORDER BY  `sum_hours` DESC LIMIT 10";
  $result = $db->query($sql);
Severity: Minor
Found in top_hours.php - About 1 hr to fix

    Method list_attendance_stats has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function list_attendance_stats($user_id){
    
        $sql = "SELECT
                events.name AS name, SUM(events.worth) AS sum_worth, events.worth AS worth
                FROM occurrence
    Severity: Minor
    Found in attendance_check.php - About 1 hr to fix

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

      function check_attendance(){
      
      echo
      <<<END
      <form method="post" action="$_SERVER[PHP_SELF]" id="show">
      Severity: Major
      Found in attendance_admin.php and 1 other location - About 1 hr to fix
      attendance_admin.php on lines 485..520

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

      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

      function display_log_form_init(){
          //begin form
      echo
      <<<END
      <form method="post" action="$_SERVER[PHP_SELF]" id="show">
      Severity: Major
      Found in attendance_admin.php and 1 other location - About 1 hr to fix
      attendance_admin.php on lines 857..889

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

      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

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class PasswordHash {
      Severity: Minor
      Found in PasswordHash.php by phpcodesniffer

      Function process_form has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function process_form() {
        include ('mysql_access.php');
        if ($_POST['action'] == "Reset Vars") {
          if (isset($_SESSION['sessionIDOriginal'])) {
            $sessionIDOriginal = $_SESSION['sessionIDOriginal'];
      Severity: Minor
      Found in change_session_vars.php - About 55 mins 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 displayView has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      function displayView($i){
        include('mysql_access.php');
        $sql = "SELECT c.firstname, c.lastname, c.phone, c.email, a.drive,
            e.name, d.DOW
            FROM contact_information AS c
      Severity: Minor
      Found in service_leader_functions.php - About 55 mins 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

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in rec_sec_attendance_tool.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in leader_list.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in members_list.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 101 and the first side effect is on line 75.
      Open

      <?php
      Severity: Minor
      Found in status_change.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in membership.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in attendance_check.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in pw_reset.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 5 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in service_hours_logger.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 27 and the first side effect is on line 2.
      Open

      <?php
      Severity: Minor
      Found in create_event_done.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 8 and the first side effect is on line 3.
      Open

      <?php
      Severity: Minor
      Found in editable_page.php by phpcodesniffer

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 48 and the first side effect is on line 4.
      Open

      <?php
      Severity: Minor
      Found in permissions.php by phpcodesniffer
      Severity
      Category
      Status
      Source
      Language