The function getQuestions has 13 parameters. Consider reducing the number of parameters to less than 10. Open
function getQuestions(
$getCount,
$start,
$length,
$exerciseId,
- Exclude checks
The function getQuestions() has an NPath complexity of 1728. The configured NPath complexity threshold is 200. Open
function getQuestions(
$getCount,
$start,
$length,
$exerciseId,
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The function get_action_icon_for_question has 12 parameters. Consider reducing the number of parameters to less than 10. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Exclude checks
Missing class import via use statement (line '530', column '23'). Open
$extraField = new ExtraField('question');
- 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 get_action_icon_for_question uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$res = "<a href='".api_get_self()."?".
api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>";
$res .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete'));
$res .= "</a>";
- 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
The method getQuestions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$qb->select('qq.iid as id', 'qq.question', 'qq.type', 'qq.level', 'IDENTITY(qr.quiz) as exerciseId')
->setFirstResult($start)
->setMaxResults($length);
- 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
Avoid unused parameters such as '$selectedCourse'. Open
$selectedCourse,
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$sessionId'. Open
$sessionId,
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$formValues'. Open
$formValues = []
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$in_questionname'. Open
$in_questionname,
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The parameter $in_session_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_courseCategoryId is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_answerType is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_exercise_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_action is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_questiontype is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_selected_course is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_exerciseLevel is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $from_exercise is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_questionname is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_questionid is not named in camelCase. Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
$courseInfo = api_get_course_info_by_id($in_selectedcourse);
$question = Question::read($in_questionid, $courseInfo);
$questionType = null;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_selectedcourse is not named in camelCase. Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
$courseInfo = api_get_course_info_by_id($in_selectedcourse);
$question = Question::read($in_questionid, $courseInfo);
$questionType = null;
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $in_addA is not named in camelCase. Open
function getLinkForQuestion(
$in_addA,
$fromExercise,
$questionId,
$questionType,
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Variable "is_allowedToEdit" is not in valid camel caps format Open
if ($is_allowedToEdit) {
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->read();
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
foreach ($list_recup as $course_id => $question_data) {
- Exclude checks
Variable "is_allowedToEdit" is not in valid camel caps format Open
$is_allowedToEdit = api_is_allowed_to_edit(null, true);
- Exclude checks
Variable "exercise_id_changed" is not in valid camel caps format Open
$exercise_id_changed = isset($_GET['exercise_id_changed']) ? (int) $_GET['exercise_id_changed'] : null;
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$current_course = api_get_course_info();
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_id = (int) $_GET['course_id'];
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj->addToList($fromExercise);
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$courseId = $current_course['real_id'];
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
unset($old_question_obj);
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "_course" is not in valid camel caps format Open
$_course = api_get_course_info();
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->updateTitle(
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "question_copy" is not in valid camel caps format Open
$question_copy = isset($_REQUEST['question_copy']) ? (int) $_REQUEST['question_copy'] : 0;
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
if ($old_question_obj) {
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "question_data" is not in valid camel caps format Open
foreach ($list_recup as $course_id => $question_data) {
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$origin_course_id = (int) $course_id;
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
$session_id = isset($_REQUEST['session_id']) ? (int) $_REQUEST['session_id'] : null;
- Exclude checks
Variable "course_id_changed" is not in valid camel caps format Open
$course_id_changed = isset($_GET['course_id_changed']) ? (int) $_GET['course_id_changed'] : null;
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->selectTitle().' - '.get_lang('Copy')
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
if ($old_question_obj) {
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj->addToList($fromExercise);
- Exclude checks
Variable "list_recup" is not in valid camel caps format Open
foreach ($list_recup as $course_id => $question_data) {
- Exclude checks
Variable "question_copy" is not in valid camel caps format Open
if (!isset($_POST['recup']) && 0 != $question_copy && isset($fromExercise)) {
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$current_course = api_get_course_info();
- Exclude checks
Variable "question_copy" is not in valid camel caps format Open
$old_question_id = $question_copy;
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
unset($new_question_obj);
- Exclude checks
Variable "question_data" is not in valid camel caps format Open
foreach ($question_data as $old_question_id) {
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course = api_get_course_int_id();
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->read();
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj = Question::read($old_question_id, $origin_course_info);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "this_section" is not in valid camel caps format Open
$this_section = SECTION_COURSES;
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course = isset($_GET['selected_course']) ? (int) $_GET['selected_course'] : null;
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "list_recup" is not in valid camel caps format Open
$list_recup = $_POST['recup'];
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_id = (int) $course_id;
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
$old_question_id = $question_copy;
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));
- Exclude checks
Variable "old_question_id" is not in valid camel caps format Open
foreach ($question_data as $old_question_id) {
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
'session_id' => $session_id,
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = array_merge($course_list, [$courseInfo]);
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = array_merge($course_list, [$courseInfo]);
- Exclude checks
Variable "course_select_list" is not in valid camel caps format Open
$course_select_list = ['-1' => get_lang('Select')];
- Exclude checks
Variable "course_select_list" is not in valid camel caps format Open
$course_select_list[$courseItemId] = '> ';
- Exclude checks
Variable "new_question_list" is not in valid camel caps format Open
$new_question_list,
- Exclude checks
Missing function doc comment Open
function getQuestions(
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
$questionId,
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
echo '<input type="hidden" name="selected_course" value="'.$selected_course.'">';
- Exclude checks
Consider putting global function "get_action_icon_for_question" in a static class Open
function get_action_icon_for_question(
- Exclude checks
Variable "in_questiontype" is not in valid camel caps format Open
$in_questiontype,
- Exclude checks
Variable "in_session_id" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "in_exercise_id" is not in valid camel caps format Open
$in_exercise_id
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
unset($new_question_obj);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
unset($old_question_obj);
- Exclude checks
Variable "course_select_list" is not in valid camel caps format Open
$course_select_list[$courseItemId] .= $courseInfo['title'];
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
(empty($session_id) ? 0 : $session_id),
- Exclude checks
Variable "question_list" is not in valid camel caps format Open
$question_list = Question::getQuestionTypeList();
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if ($selected_course == api_get_course_int_id()) {
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
if (!$myObjEx->hasQuestion($in_questionid)) {
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
if ($old_question_obj) {
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
unset($new_question_obj);
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = [$courseInfo];
- Exclude checks
Variable "new_question_list" is not in valid camel caps format Open
$new_question_list = [];
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$question_type = get_question_type_for_question($selected_course, $questionId);
- Exclude checks
Variable "in_questiontype" is not in valid camel caps format Open
$in_questiontype,
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_id = (int) $_GET['course_id'];
- Exclude checks
Variable "course_info" is not in valid camel caps format Open
$course_info = api_get_course_info();
- Exclude checks
Variable "new_question_list" is not in valid camel caps format Open
$new_question_list['-1'] = get_lang('All');
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
$session_id,
- Exclude checks
Variable "_course" is not in valid camel caps format Open
echo '<input type="hidden" name="cidReq" value="'.$_course['real_id'].'">';
- Exclude checks
Variable "in_courseCategoryId" is not in valid camel caps format Open
$in_courseCategoryId,
- Exclude checks
Variable "in_exercise_id" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "in_exerciseLevel" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>";
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$current_course = api_get_course_info();
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
if ($session['session_id'] == $session_id) {
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if (empty($selected_course) || '-1' == $selected_course) {
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$course_info = api_get_course_info_by_id($selected_course);
- Exclude checks
Variable "session_select_list" is not in valid camel caps format Open
$session_select_list,
- Exclude checks
Variable "in_action" is not in valid camel caps format Open
$in_action,
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$new_answer_obj = new Answer($questionId, $origin_course_id);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
if (!empty($session_id) && '-1' != $session_id && !empty($sessionList)) {
- Exclude checks
Variable "course_id_changed" is not in valid camel caps format Open
if ($course_id_changed) {
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
(empty($session_id) ? 0 : $session_id),
- Exclude checks
Variable "question_list" is not in valid camel caps format Open
foreach ($question_list as $key => $item) {
- Exclude checks
Variable "new_question_list" is not in valid camel caps format Open
$new_question_list[$key] = get_lang($item[1]);
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
->setSelected($session_id);
- Exclude checks
Variable "question_type" is not in valid camel caps format Open
$row[] = $question_type;
- Exclude checks
Variable "in_answerType" is not in valid camel caps format Open
$in_answerType,
- Exclude checks
Variable "from_exercise" is not in valid camel caps format Open
api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>";
- Exclude checks
Variable "course_id_changed" is not in valid camel caps format Open
'course_id_changed' => $course_id_changed,
- Exclude checks
Variable "origin_course_id" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = [];
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = $sessionInfo['courses'];
- Exclude checks
Consider putting global function "getExtraFieldConditions" in a static class Open
function getExtraFieldConditions(array $formValues, $queryType = 'from')
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
$link = function($page, $text, $label, $isActive = false) use ($url) {
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course,
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course,
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
if (isQuestionInActiveQuiz($in_questionid)) {
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
if (!empty($session_id) && '-1' != $session_id && !empty($sessionList)) {
- Exclude checks
Variable "course_select_list" is not in valid camel caps format Open
$course_select_list[$courseItemId] = '';
- Exclude checks
Variable "exercise_id_changed" is not in valid camel caps format Open
if (1 == $exercise_id_changed) {
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list[$row['iid']] .= $exerciseTitle;
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
$session_id,
- Exclude checks
Variable "in_addA" is not in valid camel caps format Open
if ($in_addA) {
- Exclude checks
Variable "in_action" is not in valid camel caps format Open
switch ($in_action) {
- Exclude checks
Variable "in_session_id" is not in valid camel caps format Open
$in_session_id,
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
if (!empty($course_list)) {
- Exclude checks
Variable "course_info" is not in valid camel caps format Open
$course_info = api_get_course_info_by_id($selected_course);
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course,
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list[$row['iid']] = '';
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
->setSelected($selected_course);
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course,
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$selected_course,
- Exclude checks
Missing blank line before return statement Open
return '<li class="page-item'.$activeClass.'"><a class="page-link" href="'.$url.'&page='.$page.'" aria-label="'.$label.'">'.$text.'</a></li>';
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
$session_id,
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
$in_questionid,
- Exclude checks
Variable "in_selected_course" is not in valid camel caps format Open
$in_selected_course,
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>";
- Exclude checks
Consider putting global function "isQuestionInActiveQuiz" in a static class Open
function isQuestionInActiveQuiz($questionId)
- Exclude checks
Variable "in_selectedcourse" is not in valid camel caps format Open
$courseInfo = api_get_course_info_by_id($in_selectedcourse);
- Exclude checks
Variable "is_allowedToEdit" is not in valid camel caps format Open
if (!$is_allowedToEdit) {
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
'selected_course' => $selected_course,
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$origin_course_info = api_get_course_info_by_id($origin_course_id);
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "new_id" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj = new Answer($questionId, $origin_course_id);
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list['0'] = get_lang('All tests');
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list['-1'] = get_lang('Orphan questions');
- Exclude checks
Variable "session_id" is not in valid camel caps format Open
$session_id,
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if ($selected_course == api_get_course_int_id()) {
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj = Question::read($new_id);
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$categoryList = TestCategory::getCategoriesIdAndName($selected_course);
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 4 Open
$new_question_list,
- Exclude checks
Consider putting global function "getQuestions" in a static class Open
function getQuestions(
- Exclude checks
Variable "question_type" is not in valid camel caps format Open
if (empty($question_type)) {
- Exclude checks
Consider putting global function "reset_menu_exo_lvl_type" in a static class Open
function reset_menu_exo_lvl_type()
- Exclude checks
Consider putting global function "getLinkForQuestion" in a static class Open
function getLinkForQuestion(
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$courseId = $current_course['real_id'];
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_question_obj->addToList($fromExercise);
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
foreach ($course_list as $item) {
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if ($selected_course == api_get_course_int_id()) {
- Exclude checks
Variable "question_type" is not in valid camel caps format Open
$question_type = get_question_type_for_question($selected_course, $questionId);
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
echo '<input type="hidden" name="course_id" value="'.$selected_course.'">';
- Exclude checks
Consider putting global function "reset_menu_lvl_type" in a static class Open
function reset_menu_lvl_type()
- Exclude checks
Variable "in_session_id" is not in valid camel caps format Open
$in_session_id,
- Exclude checks
Variable "in_answerType" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if ($row['iid'] == $fromExercise && $selected_course == api_get_course_int_id()) {
- Exclude checks
Variable "new_question_list" is not in valid camel caps format Open
$new_question_list[$key] = get_lang($item[1]);
- Exclude checks
Variable "in_exerciseLevel" is not in valid camel caps format Open
$in_exerciseLevel,
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
unset($old_question_obj);
- Exclude checks
Variable "exercise_id_changed" is not in valid camel caps format Open
'exercise_id_changed' => $exercise_id_changed,
- Exclude checks
Variable "new_question_obj" is not in valid camel caps format Open
$new_answer_obj->duplicate($new_question_obj, $current_course);
- Exclude checks
Variable "session_select_list" is not in valid camel caps format Open
$session_select_list[$item['session_id']] = $item['session_name'];
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list = [];
- Exclude checks
Variable "exercise_list" is not in valid camel caps format Open
if (is_array($exercise_list)) {
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list[$row['iid']] = '> ';
- Exclude checks
Variable "my_exercise_list" is not in valid camel caps format Open
$my_exercise_list,
- Exclude checks
Variable "in_exercise_id" is not in valid camel caps format Open
$in_exercise_id,
- Exclude checks
Variable "from_exercise" is not in valid camel caps format Open
"&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";
- Exclude checks
Variable "current_course" is not in valid camel caps format Open
$new_id = $old_question_obj->duplicate($current_course);
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
$course_list = CourseManager::get_courses_list(0, 0, 'title');
- Exclude checks
Variable "course_list" is not in valid camel caps format Open
if (!in_array($courseInfo['real_id'], $course_list)) {
- Exclude checks
Variable "exercise_list" is not in valid camel caps format Open
foreach ($exercise_list as $row) {
- Exclude checks
Variable "_course" is not in valid camel caps format Open
if (!empty($_course)) {
- Exclude checks
Variable "course_select_list" is not in valid camel caps format Open
$course_select_list,
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 4 Open
'answerType',
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
$row[] = TestCategory::getCategoryNameForQuestion($questionId, $selected_course);
- Exclude checks
Variable "in_addA" is not in valid camel caps format Open
$in_addA,
- Exclude checks
Variable "from_exercise" is not in valid camel caps format Open
$from_exercise,
- Exclude checks
Variable "in_selected_course" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "in_courseCategoryId" is not in valid camel caps format Open
$getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";
- Exclude checks
Variable "from_exercise" is not in valid camel caps format Open
$from_exercise,
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
$in_questionid,
- Exclude checks
Consider putting global function "get_question_type_for_question" in a static class Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
- Exclude checks
Variable "in_action" is not in valid camel caps format Open
$res = $in_action;
- Exclude checks
Variable "old_question_obj" is not in valid camel caps format Open
$old_question_obj = Question::read($questionId, $origin_course_info);
- Exclude checks
Variable "origin_course_info" is not in valid camel caps format Open
$old_question_obj = Question::read($questionId, $origin_course_info);
- Exclude checks
Variable "new_answer_obj" is not in valid camel caps format Open
$new_answer_obj->read();
- Exclude checks
Variable "session_select_list" is not in valid camel caps format Open
$session_select_list = ['-1' => get_lang('Select')];
- Exclude checks
Variable "selected_course" is not in valid camel caps format Open
if (empty($selected_course) || '-1' == $selected_course) {
- Exclude checks
Variable "exercise_list" is not in valid camel caps format Open
$exercise_list = ExerciseLib::get_all_exercises_for_course_id(
- Exclude checks
Variable "in_questionname" is not in valid camel caps format Open
$in_questionname,
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
"&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";
- Exclude checks
Variable "in_selected_course" is not in valid camel caps format Open
"&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";
- Exclude checks
Variable "in_questionid" is not in valid camel caps format Open
$question = Question::read($in_questionid, $courseInfo);
- Exclude checks
Variable "in_selectedcourse" is not in valid camel caps format Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 4 Open
'answerType',
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
$questionId,
- Exclude checks
Multi-line function call not indented correctly; expected 8 spaces but found 4 Open
$new_question_list,
- Exclude checks
The variable $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_exerciseLevel is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $from_exercise is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_selectedcourse is not named in camelCase. Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
$courseInfo = api_get_course_info_by_id($in_selectedcourse);
$question = Question::read($in_questionid, $courseInfo);
$questionType = null;
- 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 $in_courseCategoryId is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_addA is not named in camelCase. Open
function getLinkForQuestion(
$in_addA,
$fromExercise,
$questionId,
$questionType,
- 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 $in_selected_course is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_action is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_exercise_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_exercise_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_selected_course is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $from_exercise is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $from_exercise is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_action is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_session_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questiontype is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_session_id is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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 $in_questionid is not named in camelCase. Open
function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
$courseInfo = api_get_course_info_by_id($in_selectedcourse);
$question = Question::read($in_questionid, $courseInfo);
$questionType = null;
- 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 $in_answerType is not named in camelCase. Open
function get_action_icon_for_question(
$in_action,
$from_exercise,
$in_questionid,
$in_questiontype,
- 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();
}
}