Missing class import via use statement (line '64', 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_courses uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sql = "SELECT c.code, c.title
FROM $tbl_course c
WHERE
c.code LIKE '$needle%'
- 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 "assigned_courses_code" is not in valid camel caps format Open
if (count($assigned_courses_code) > 0) {
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
$without_assigned_courses ";
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
$assigned_courses_code = array_keys($assigned_courses_to_hrm);
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
$assigned_courses_code = array_keys($assigned_courses_to_hrm);
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
$tool_name = get_lang('Assign courses to platform\'s administrator');
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
$xajax_response = new xajaxResponse();
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
Display::display_header($tool_name);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
$without_assigned_courses = '';
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
if (count($assigned_courses_code) > 0) {
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
$without_assigned_courses = ' AND c.code NOT IN('.implode(',', $assigned_courses_code).')';
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
c.code LIKE '$needle' $without_assigned_courses AND
- Exclude checks
Closing brace indented incorrectly; expected 8 spaces, found 4 Open
} ?>
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
$without_assigned_courses = ' AND c.code NOT IN('.implode(',', $assigned_courses_code).')';
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
c.code LIKE '$needle%' $without_assigned_courses AND
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 0 Open
} ?>
- Exclude checks
Variable "user_anonymous" is not in valid camel caps format Open
$user_anonymous = api_get_anonymous_id();
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
if ($affected_rows) {
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
<?php echo '<button class="btn btn--success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>'; ?>
- Exclude checks
Variable "tbl_course_rel_access_url" is not in valid camel caps format Open
global $tbl_course, $tbl_course_rel_access_url, $user_id;
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
$assigned_courses_code = array_keys($assigned_courses_to_hrm);
- Exclude checks
Variable "tbl_course_rel_access_url" is not in valid camel caps format Open
LEFT JOIN $tbl_course_rel_access_url a
- Exclude checks
Variable "tbl_course" is not in valid camel caps format Open
FROM $tbl_course c
- Exclude checks
Variable "tbl_course_rel_access_url" is not in valid camel caps format Open
LEFT JOIN $tbl_course_rel_access_url a
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
return $xajax_response;
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
WHERE c.code LIKE '$needle' $without_assigned_courses
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
foreach ($assigned_courses_to_hrm as $enreg) {
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
global $tbl_course, $tbl_course_rel_access_url, $user_id;
- Exclude checks
Variable "tbl_course" is not in valid camel caps format Open
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
- Exclude checks
Variable "tbl_course_rel_user" is not in valid camel caps format Open
$tbl_course_rel_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
$without_assigned_courses = ' AND c.code NOT IN('.implode(',', $assigned_courses_code).')';
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
- Exclude checks
Variable "UserList" is not in valid camel caps format Open
$UserList = [];
- Exclude checks
Variable "courses_list" is not in valid camel caps format Open
$courses_list = isset($_POST['CoursesList']) ? $_POST['CoursesList'] : [];
- Exclude checks
Variable "add_type" is not in valid camel caps format Open
<?php if ('multiple' == $add_type) {
- Exclude checks
Variable "assigned_courses_to_hrm" is not in valid camel caps format Open
if (is_array($assigned_courses_to_hrm)) {
- Exclude checks
Missing function doc comment Open
function search_courses($needle, $type)
- Exclude checks
Variable "add_type" is not in valid camel caps format Open
$add_type = 'multiple';
- Exclude checks
Consider putting global function "search_courses" in a static class Open
function search_courses($needle, $type)
- Exclude checks
Variable "xajax_response" is not in valid camel caps format Open
$xajax_response->addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
- Exclude checks
Variable "tbl_course" is not in valid camel caps format Open
FROM $tbl_course c
- Exclude checks
Variable "tbl_course_rel_access_url" is not in valid camel caps format Open
$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
- 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
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
$affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
- Exclude checks
Variable "tool_name" is not in valid camel caps format Open
$tool_name = get_lang('Assign courses to session\'s administrator');
- Exclude checks
Variable "tbl_course" is not in valid camel caps format Open
global $tbl_course, $tbl_course_rel_access_url, $user_id;
- 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 "tbl_course" is not in valid camel caps format Open
FROM $tbl_course c
- 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;">
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
if (UserManager::is_admin($user_id)) {
- Exclude checks
Variable "this_section" is not in valid camel caps format Open
$this_section = SECTION_PLATFORM_ADMIN;
- 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 courses to HR manager');
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
$without_assigned_courses = ' AND c.code NOT IN('.implode(',', $assigned_courses_code).')';
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$user_id = (int) ($_GET['user']);
- Exclude checks
Variable "tbl_course" is not in valid camel caps format Open
FROM $tbl_course c
- Exclude checks
Variable "courses_list" is not in valid camel caps format Open
$affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$actionsLeft .= '<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$user = api_get_user_entity($user_id);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
if (UserManager::is_admin($user_id)) {
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
$assigned_courses_code = array_keys($assigned_courses_to_hrm);
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
foreach ($assigned_courses_code as &$value) {
- Exclude checks
Variable "without_assigned_courses" is not in valid camel caps format Open
$without_assigned_courses = '';
- Exclude checks
Variable "assigned_courses_code" is not in valid camel caps format Open
foreach ($assigned_courses_code as &$value) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
} ?>
- Exclude checks
Closing brace indented incorrectly; expected 8 spaces, found 4 Open
} ?>
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 0 Open
} ?>
- Exclude checks
The variable $assigned_courses_code is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_course_rel_access_url is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses_to_hrm is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_course is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_course_rel_access_url is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_course is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses_to_hrm is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses_code is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_course is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses_code is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses_code is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses is not named in camelCase. Open
function search_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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_courses($needle, $type)
{
global $tbl_course, $tbl_course_rel_access_url, $user_id;
$xajax_response = new xajaxResponse();
- 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();
}
}