The method calc_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// for all the students -> get average
$rescount = 0;
$sum = 0;
$bestResult = 0;
- 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 assigning values to variables in if clauses and the like (line '175', column '17'). Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid unused local variables such as '$courseId'. Open
$courseId = $this->getCourseId();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$courseId'. Open
$courseId = $this->getCourseId();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$sessionId'. Open
$sessionId = $this->get_session_id();
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The property $survey_data is not named in camelCase. Open
class SurveyLink extends AbstractLink
{
private $survey_table;
/** @var \Chamilo\CourseBundle\Entity\CSurvey */
private $survey_data;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
The property $survey_table is not named in camelCase. Open
class SurveyLink extends AbstractLink
{
private $survey_table;
/** @var \Chamilo\CourseBundle\Entity\CSurvey */
private $survey_data;
- Read upRead up
- Exclude checks
CamelCasePropertyName
Since: 0.2
It is considered best practice to use the camelCase notation to name attributes.
Example
class ClassName {
protected $property_name;
}
Source
Method name "SurveyLink::get_link" is not in camel caps format Open
public function get_link()
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
return $this->survey_data->getCode().': '.self::html_to_text($this->survey_data->getTitle());
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
return [$data['answered'] ? $max_score : 0, $max_score];
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
$this->survey_data = $survey;
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
return $this->survey_data->getSubtitle();
- Exclude checks
Missing function doc comment Open
public function get_link()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course = api_get_course_entity($course_id);
- Exclude checks
Missing function doc comment Open
public function needs_max()
- Exclude checks
Method name "SurveyLink::has_results" is not in camel caps format Open
public function has_results()
- Exclude checks
Variable "tbl_survey" is not in valid camel caps format Open
$tbl_survey = Database::get_course_table(TABLE_SURVEY);
- Exclude checks
Variable "tbl_survey_invitation" is not in valid camel caps format Open
$tbl_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
return [0, $max_score];
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
if (empty($this->survey_data)) {
- Exclude checks
Method name "SurveyLink::get_name" is not in camel caps format Open
public function get_name()
- Exclude checks
Method name "SurveyLink::needs_name_and_description" is not in camel caps format Open
public function needs_name_and_description()
- Exclude checks
Variable "tbl_survey" is not in valid camel caps format Open
FROM $tbl_survey AS s
- Exclude checks
Method name "SurveyLink::needs_results" is not in camel caps format Open
public function needs_results()
- Exclude checks
Variable "tbl_survey" is not in valid camel caps format Open
$tbl_survey = Database::get_course_table(TABLE_SURVEY);
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
s.iid = $ref_id AND
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
return [$data['answered'] ? $max_score : 0, $max_score];
- Exclude checks
Variable "sql_result" is not in valid camel caps format Open
while ($data = Database::fetch_array($sql_result)) {
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
$sum += $data['answered'] ? $max_score : 0;
- Exclude checks
Method name "SurveyLink::get_type_name" is not in camel caps format Open
public function get_type_name()
- Exclude checks
Method name "SurveyLink::is_allowed_to_change_name" is not in camel caps format Open
public function is_allowed_to_change_name()
- Exclude checks
Missing function doc comment Open
public function needs_results()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = $this->getCourseId();
- Exclude checks
Method name "SurveyLink::get_description" is not in camel caps format Open
public function get_description()
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
$max_score = 1;
- Exclude checks
Variable "get_individual_score" is not in valid camel caps format Open
if ($get_individual_score) {
- Exclude checks
Method name "SurveyLink::is_valid_link" is not in camel caps format Open
public function is_valid_link()
- Exclude checks
Variable "max_score" is not in valid camel caps format Open
$sum = $sum / $max_score;
- Exclude checks
Variable "survey_id" is not in valid camel caps format Open
$survey_id = $survey->getIid();
- Exclude checks
Method name "SurveyLink::get_survey_data" is not in camel caps format Open
private function get_survey_data()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
if (empty($this->course_id)) {
- Exclude checks
Method name "SurveyLink::needs_max" is not in camel caps format Open
public function needs_max()
- Exclude checks
Variable "sql_result" is not in valid camel caps format Open
$sql_result = Database::query($sql);
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
s.iid = $ref_id AND
- Exclude checks
Variable "get_individual_score" is not in valid camel caps format Open
if ($get_individual_score) {
- Exclude checks
Method name "SurveyLink::get_survey_table" is not in camel caps format Open
private function get_survey_table()
- Exclude checks
Variable "sql_result" is not in valid camel caps format Open
$sql_result = Database::query($sql);
- Exclude checks
Variable "sql_result" is not in valid camel caps format Open
if ($data = Database::fetch_array($sql_result)) {
- Exclude checks
Method name "SurveyLink::get_all_links" is not in camel caps format Open
public function get_all_links()
- Exclude checks
Method name "SurveyLink::calc_score" is not in camel caps format Open
public function calc_score($studentId = null, $type = null)
- Exclude checks
Variable "get_individual_score" is not in valid camel caps format Open
$get_individual_score = !is_null($studentId);
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
return $this->survey_data;
- Exclude checks
Method name "SurveyLink::html_to_text" is not in camel caps format Open
private static function html_to_text($string)
- Exclude checks
Variable "survey_data" is not in valid camel caps format Open
return $this->survey_data->getCode().': '.self::html_to_text($this->survey_data->getTitle());
- Exclude checks
Missing function doc comment Open
public function needs_name_and_description()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
$ref_id = $this->get_ref_id();
- Exclude checks
Method name "SurveyLink::get_icon_name" is not in camel caps format Open
public function get_icon_name()
- Exclude checks
Variable "survey_table" is not in valid camel caps format Open
return $this->survey_table;
- Exclude checks
Variable "sql_result" is not in valid camel caps format Open
$data = Database::fetch_array($sql_result);
- Exclude checks
Variable "tbl_survey" is not in valid camel caps format Open
FROM $tbl_survey AS s
- Exclude checks
Missing function doc comment Open
public function is_allowed_to_change_name()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
$ref_id = $this->get_ref_id();
- Exclude checks
Variable "tbl_survey_invitation" is not in valid camel caps format Open
JOIN $tbl_survey_invitation AS i
- Exclude checks
Variable "survey_id" is not in valid camel caps format Open
api_get_cidreq_params($this->getCourseId(), $sessionId).'&survey_id='.$survey_id;
- Exclude checks
Variable "survey_table" is not in valid camel caps format Open
$this->survey_table = Database::get_course_table(TABLE_SURVEY);
- Exclude checks
The variable $course_id is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->course_id)) {
exit('Error in get_all_links() : course ID not set');
}
- 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_survey_invitation is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $survey_id is not named in camelCase. Open
public function get_link()
{
if ('true' === api_get_setting('survey.hide_survey_reporting_button')) {
return 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 $ref_id is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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_survey is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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 $ref_id is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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_survey_invitation is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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_survey is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $sql_result is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $sql_result is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $survey_id is not named in camelCase. Open
public function get_link()
{
if ('true' === api_get_setting('survey.hide_survey_reporting_button')) {
return 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 $tbl_survey is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $sql_result is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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 $ref_id is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $get_individual_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $max_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $course_id is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->course_id)) {
exit('Error in get_all_links() : course ID not set');
}
- 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 $ref_id is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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_survey is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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 $sql_result is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- 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 $get_individual_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $get_individual_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 $sql_result is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- 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 method get_type_name is not named in camelCase. Open
public function get_type_name()
{
return get_lang('Survey');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method needs_max is not named in camelCase. Open
public function needs_max()
{
return false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method needs_results is not named in camelCase. Open
public function needs_results()
{
return false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method has_results is not named in camelCase. Open
public function has_results()
{
$ref_id = $this->get_ref_id();
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_description is not named in camelCase. Open
public function get_description()
{
$this->get_survey_data();
return $this->survey_data->getSubtitle();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_link is not named in camelCase. Open
public function get_link()
{
if ('true' === api_get_setting('survey.hide_survey_reporting_button')) {
return null;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_name is not named in camelCase. Open
public function get_name()
{
$this->get_survey_data();
return $this->survey_data->getCode().': '.self::html_to_text($this->survey_data->getTitle());
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method is_allowed_to_change_name is not named in camelCase. Open
public function is_allowed_to_change_name()
{
return false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method calc_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
// Note: Max score is assumed to be always 1 for surveys,
// only student's participation is to be taken into account.
$max_score = 1;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_all_links is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->course_id)) {
exit('Error in get_all_links() : course ID not set');
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method is_valid_link is not named in camelCase. Open
public function is_valid_link()
{
$sessionId = $this->get_session_id();
$courseId = $this->getCourseId();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method needs_name_and_description is not named in camelCase. Open
public function needs_name_and_description()
{
return false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_survey_table is not named in camelCase. Open
private function get_survey_table()
{
$this->survey_table = Database::get_course_table(TABLE_SURVEY);
return $this->survey_table;
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_icon_name is not named in camelCase. Open
public function get_icon_name()
{
return 'survey';
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method get_survey_data is not named in camelCase. Open
private function get_survey_data()
{
if (empty($this->survey_data)) {
$courseId = $this->getCourseId();
$sessionId = $this->get_session_id();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method html_to_text is not named in camelCase. Open
private static function html_to_text($string)
{
return strip_tags($string);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}