APO-Epsilon/apo-website

View on GitHub

Showing 11,898 of 11,898 total issues

Avoid using undefined variables such as '$toProcessOID' which will lead to PHP notices.
Open

  $size = count($toProcessOID);
Severity: Minor
Found in service_hours_logger.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$db' which will lead to PHP notices.
Open

    $response=$db->query("SELECT event_name,event_type FROM events_listing");
Severity: Minor
Found in create_event_done.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$name' which will lead to PHP notices.
Open

      $name[] = $r['name'];
Severity: Minor
Found in service_hours_logger.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$year' which will lead to PHP notices.
Open

        VALUES (".$toProcessUID[$i].",".$month[$i].",".$day[$i].",".$year[$i].",'".$theDate[$i]."','".$current_semester."','auto-logged item #".$toProcessOID[$i]."',".$toProcessLen[$i].",
Severity: Minor
Found in service_hours_logger.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Method check_attendance has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function check_attendance(){

echo
<<<END
<form method="post" action="$_SERVER[PHP_SELF]" id="show">
Severity: Minor
Found in attendance_admin.php - About 1 hr to fix

    Method assignPLForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function assignPLForm(){
      include('mysql_access.php');
      echo "<h2>Assign Project Leader (Limit 1)</h2>";
      echo <<<FORM
      <form method="post" action="$_SERVER[PHP_SELF]">
    Severity: Minor
    Found in service_admin_forms.php - About 1 hr to fix

      Method display_create_form has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function display_create_form($active_semester){
      
      echo
      <<<END
          <form method="post" action="$_SERVER[PHP_SELF]" id="create">
      Severity: Minor
      Found in attendance_admin.php - About 1 hr to fix

        Method display_log_form_init has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

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

          function show_active() {
              $user_id = $_SESSION['sessionID'];
              include('mysql_access.php');
          
              if (isset($_GET['delete'])) {
          Severity: Minor
          Found in event_signup.php - About 1 hr to fix

            Function view has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function view($i){
              include('mysql_access.php');
              $id = $_SESSION['sessionID'];
            
            $sql = "SELECT d.detail_id, d.event_id, d.DOW,
            Severity: Minor
            Found in service_admin_week.php - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function show_active() {
                include('mysql_access.php');
                
                //$response=$db->query("SELECT event_name,L_val,F_val,repeatable FROM events_listing WHERE event_type='Point'");
                //$count = 0;
            Severity: Minor
            Found in check_requirements.php - About 1 hr 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 list_attendance_stats has a Cognitive Complexity of 10 (exceeds 5 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.php - About 1 hr 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 removeEmptyDirectories has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function removeEmptyDirectories($submoduleArray) {
                foreach ($submoduleArray as $submoduleKey => $submoduleValue) {
                    $dir = new RecursiveDirectoryIterator($submoduleKey, FilesystemIterator::SKIP_DOTS);
                    foreach (new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
                        if ($file->isDir()) {
            Severity: Minor
            Found in includes/clean_up_submodules.php - About 1 hr 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 attendance_check has a Cognitive Complexity of 10 (exceeds 5 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: Minor
            Found in attendance_check.php - About 1 hr 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 recorded_hours has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function recorded_hours(){
              include('mysql_access.php');
              global $current_semester;
              //this is shit code. could be written in OOP.
              // not shit code INVENTIVE code.
            Severity: Minor
            Found in service_hours_logger.php - About 1 hr 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 doubleTapToGo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.doubleTapToGo = function( params )
                {
                    if( !( 'ontouchstart' in window ) &&
                        !navigator.msMaxTouchPoints &&
                        !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
            Severity: Minor
            Found in js/doubleTapToGo.js - About 1 hr to fix

              Method process_form has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function process_form() {
                include ('mysql_access.php');
                $id = $_SESSION['sessionID'];
                $event = $_POST['event'];
                $month = $_POST['month'];
              Severity: Minor
              Found in check_hours.php - About 1 hr to fix

                Function doubleTapToGo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $.fn.doubleTapToGo = function( params )
                    {
                        if( !( 'ontouchstart' in window ) &&
                            !navigator.msMaxTouchPoints &&
                            !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;
                Severity: Minor
                Found in r8conf2016/js/doubleTapToGo.js - About 1 hr to fix

                  Method list_hours has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function list_hours($user_id) {
                    include ('mysql_access.php');
                    $sql = "SELECT * FROM `recorded_hours` WHERE `user_id` = $user_id ORDER BY `year` DESC, `month` DESC, `day` DESC";
                    $results = $db->query($sql) or die("Error - Contact Webmaster");
                    echo "<div style='margin: 0px auto; width: 100%; text-align: center;'>
                  Severity: Minor
                  Found in check_hours.php - About 1 hr to fix

                    Method HashPassword has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function HashPassword($password)
                    {
                      $random = '';
                    
                      if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
                    Severity: Minor
                    Found in PasswordHash.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language