APO-Epsilon/apo-website

View on GitHub
rec_sec_home.php

Summary

Maintainability
A
0 mins
Test Coverage

show_active accesses the super-global variable $_SESSION.
Open

function show_active() {
    
    include('mysql_access.php');
    include('retrieve_user.php');
    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    }
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    <p><a href="enter_excuse.php">Excused Absence</a></p>
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

TRUE, FALSE and NULL must be lowercase; expected "false" but found "False"
Open

$public_page = False;
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    <p><a href="rec_sec_attendance_tool.php">Attendance Tool</a></p>
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

TRUE, FALSE and NULL must be lowercase; expected "false" but found "False"
Open

$exec_page = False;
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

TRUE, FALSE and NULL must be lowercase; expected "true" but found "True"
Open

$active_page = True;
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    if ($position == "Webmaster" || $position == "Recording Secretary") {
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    $position = id_to_position($user_id);
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    ?>
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

    <p><a href="missed_meeting.php">Meeting Absence</a></p>
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

    <p><a href="req_view.php">See All Requirements Status</a></p>
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    include('mysql_access.php');
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

End of line character is invalid; expected "\n" but found "\r\n"
Open

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

Spaces must be used to indent lines; tabs are not allowed
Open

    include('retrieve_user.php');
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Whitespace found at end of line
Open

    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Opening brace should be on a new line
Open

function show_active() {
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Space before opening parenthesis of function call prohibited
Open

require_once ('mysql_access.php');
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

Space before opening parenthesis of function call prohibited
Open

require_once ('session.php');
Severity: Minor
Found in rec_sec_home.php by phpcodesniffer

The variable $user_id is not named in camelCase.
Open

function show_active() {
    
    include('mysql_access.php');
    include('retrieve_user.php');
    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $user_id is not named in camelCase.
Open

function show_active() {
    
    include('mysql_access.php');
    include('retrieve_user.php');
    $user_id = $_SESSION['sessionID'];    
Severity: Minor
Found in rec_sec_home.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status