Missing class import via use statement (line '65', column '27'). Open
$xajax_response = new xajaxResponse();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method search_sessions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sql = "SELECT s.id, s.name FROM $tbl_session s
WHERE s.name LIKE '$needle%' $without_assigned_sessions ";
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Variable "this_section" is not in valid camel caps format Open
$this_section = SECTION_PLATFORM_ADMIN;
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$user = api_get_user_entity($user_id);
- Exclude checks
Consider putting global function "search_sessions" in a static class Open
function search_sessions($needle, $type)
- Exclude checks
Missing function doc comment Open
function search_sessions($needle, $type)
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
- Exclude checks
Variable "tbl_session_rel_access_url" is not in valid camel caps format Open
LEFT JOIN $tbl_session_rel_access_url a
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
if (count($assigned_sessions_id) > 0) {
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
WHERE s.name LIKE '$needle%' $without_assigned_sessions
- Exclude checks
Variable "tbl_session_rel_access_url" is not in valid camel caps format Open
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
if (UserManager::is_admin($user_id)) {
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
if (count($assigned_sessions_id) > 0) {
- Exclude checks
Variable "ajax_search" is not in valid camel caps format Open
if ($ajax_search) {
- Exclude checks
Variable "add_type" is not in valid camel caps format Open
$add_type = 'multiple';
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$userInfo = api_get_user_info($user_id);
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id; ?>" style="margin:0px;" <?php if ($ajax_search) {
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
$sql = " SELECT s.id, s.name FROM $tbl_session s
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
- Exclude checks
Variable "current_user_id" is not in valid camel caps format Open
$current_user_id = api_get_user_id();
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
$tool_name = get_lang('Assign sessions to Human Resources manager');
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
$xajax_response = new xajaxResponse();
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
$without_assigned_sessions = ' AND s.id NOT IN('.implode(',', $assigned_sessions_id).')';
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
$xajax_response->addAssign(
- Exclude checks
Variable "user_anonymous" is not in valid camel caps format Open
$user_anonymous = api_get_anonymous_id();
- Exclude checks
Variable "add_type" is not in valid camel caps format Open
$add_type = Security::remove_XSS($_REQUEST['add_type']);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
$without_assigned_sessions = ' AND s.id NOT IN ('.implode(',', $assigned_sessions_id).') ';
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
FROM $tbl_session s
- Exclude checks
Variable "tbl_session_rel_access_url" is not in valid camel caps format Open
LEFT JOIN $tbl_session_rel_access_url a ON (s.id = a.session_id)
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
$sql = "SELECT s.id, s.name FROM $tbl_session s
- Exclude checks
Variable "ajax_search" is not in valid camel caps format Open
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id; ?>" style="margin:0px;" <?php if ($ajax_search) {
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
$without_assigned_sessions = '';
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
$tool_name = get_lang('Assign sessions to platform administrator');
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
$sql = "SELECT s.id, s.name FROM $tbl_session s
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
$affected_rows = SessionManager::subscribeSessionsToDrh(
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
s.name LIKE '$needle%' $without_assigned_sessions AND
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
echo '<button class="btn btn--success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
- Exclude checks
Variable "tbl_session" is not in valid camel caps format Open
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
s.name LIKE '$needle%' $without_assigned_sessions AND
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
WHERE s.name LIKE '$needle%' $without_assigned_sessions ";
- Exclude checks
Variable "sessions_list" is not in valid camel caps format Open
$sessions_list
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
if (UserManager::is_admin($user_id)) {
- Exclude checks
Variable "tbl_session_rel_access_url" is not in valid camel caps format Open
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
- Exclude checks
Variable "UserList" is not in valid camel caps format Open
$UserList = [];
- Exclude checks
Variable "add_type" is not in valid camel caps format Open
<?php if ('multiple' == $add_type) {
- Exclude checks
Variable "ajax_search" is not in valid camel caps format Open
$ajax_search = false;
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
global $user_id;
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
$without_assigned_sessions = ' AND s.id NOT IN('.implode(',', $assigned_sessions_id).')';
- Exclude checks
Variable "sessions_list" is not in valid camel caps format Open
$sessions_list = $_POST['SessionsList'];
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
if ($affected_rows) {
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
$without_assigned_sessions = ' AND s.id NOT IN ('.implode(',', $assigned_sessions_id).') ';
- Exclude checks
Variable "assigned_sessions_id" is not in valid camel caps format Open
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
Display::display_header($tool_name);
- Exclude checks
Variable "without_assigned_sessions" is not in valid camel caps format Open
$without_assigned_sessions = '';
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$user_id = isset($_GET['user']) ? (int) ($_GET['user']) : null;
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
$tool_name = get_lang('Assign sessions to sessions administrator');
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
return $xajax_response;
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
- Exclude checks
Closing brace indented incorrectly; expected 16 spaces, found 20 Open
} ?>
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
if (is_array($assigned_sessions_to_hrm)) {
- Exclude checks
Variable "assigned_sessions_to_hrm" is not in valid camel caps format Open
foreach ($assigned_sessions_to_hrm as $enreg) {
- Exclude checks
Closing brace indented incorrectly; expected 46 spaces, found 0 Open
}?>>
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 20 Open
} ?>
- Exclude checks
Closing brace indented incorrectly; expected 16 spaces, found 20 Open
} ?>
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
} else {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if ($ajax_search) {
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Exclude checks
The variable $xajax_response is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $assigned_sessions_id is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $tbl_session is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $tbl_session_rel_access_url is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $tbl_session is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $without_assigned_sessions is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $xajax_response is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $assigned_sessions_id is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $without_assigned_sessions is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $assigned_sessions_id is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $without_assigned_sessions is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $xajax_response is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $assigned_sessions_to_hrm is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $tbl_session is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $tbl_session_rel_access_url is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $without_assigned_sessions is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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 $assigned_sessions_to_hrm is not named in camelCase. Open
function search_sessions($needle, $type)
{
global $user_id;
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
- Read upRead up
- Exclude checks
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();
}
}