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 {
switch ($type) {
case 'best':
return [$bestResult, $weight];
break;
- 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 '156', column '21'). Open
public function calc_score($studentId = null, $type = null)
{
$threadInfo = $this->getThreadData();
$thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$sessionId = $this->get_session_id();
- 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
The method getThreadData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$session_condition = '(session_id = 0 OR session_id IS NULL)';
}
- 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 calc_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// We sent the 0/thread_qualify_max instead of null for correct calculations
return [0, $assignment['thread_qualify_max']];
}
- 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 calc_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Take average
$score = 0;
$counter = 0;
if (Database::num_rows($scores)) {
- 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 calc_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// All students -> get average
$students = []; // user list, needed to make sure we only
// take first attempts into account
$counter = 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
The method get_all_links uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';
}
- 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 local variables such as '$session_condition'. Open
$session_condition = 'tl.session_id='.$sessionId;
- 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 '$tbl_grade_links'. Open
$tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);
- 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 $forum_thread_table is not named in camelCase. Open
class ForumThreadLink extends AbstractLink
{
private $forum_thread_table;
/**
- 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
Variable "course_id" is not in valid camel caps format Open
c_id = ".$this->course_id." AND
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- Exclude checks
Variable "thread_title" is not in valid camel caps format Open
return $thread_title;
- Exclude checks
Method name "ForumThreadLink::delete_linked_data" is not in camel caps format Open
public function delete_linked_data()
- Exclude checks
Method name "ForumThreadLink::get_name" is not in camel caps format Open
public function get_name()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = '.$this->course_id.' AND
- Exclude checks
Missing function doc comment Open
public function needs_max()
- Exclude checks
Missing function doc comment Open
public function save_linked_data()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;
- Exclude checks
Method name "ForumThreadLink::needs_results" is not in camel caps format Open
public function needs_results()
- Exclude checks
Missing function doc comment Open
public function delete_linked_data()
- 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
WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;
- Exclude checks
Method name "ForumThreadLink::get_all_links" is not in camel caps format Open
public function get_all_links()
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = 'tl.session_id='.$sessionId;
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = ".$this->course_id." AND
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
return $this->exercise_data;
- Exclude checks
Method name "ForumThreadLink::is_allowed_to_change_name" is not in camel caps format Open
public function is_allowed_to_change_name()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = '.$this->course_id.' AND
- Exclude checks
Missing function doc comment Open
public function get_link()
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = 'session_id = '.$sessionId;
- Exclude checks
Method name "ForumThreadLink::is_valid_link" is not in camel caps format Open
public function is_valid_link()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
if (!empty($ref_id)) {
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
return $this->exercise_data['thread_title_qualify'];
- Exclude checks
Variable "forum_id" is not in valid camel caps format Open
$forum_id = $row['forum_id'];
- Exclude checks
Variable "forum_id" is not in valid camel caps format Open
'&thread='.$this->get_ref_id().'&gradebook=view&forum='.$forum_id;
- Exclude checks
Missing function doc comment Open
public function get_icon_name()
- Exclude checks
Method name "ForumThreadLink::get_icon_name" is not in camel caps format Open
public function get_icon_name()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;
- Exclude checks
Method name "ForumThreadLink::needs_max" is not in camel caps format Open
public function needs_max()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
if (!empty($ref_id)) {
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
WHERE c_id = '.$this->course_id.' AND iid = '.$ref_id;
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';
- Exclude checks
Variable "forum_thread_table" is not in valid camel caps format Open
return $this->forum_thread_table = Database::get_course_table(TABLE_FORUM_THREAD);
- Exclude checks
Variable "thread_qualify" is not in valid camel caps format Open
$sql = "SELECT * FROM $thread_qualify
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$this->exercise_data = Database::fetch_array($query);
- Exclude checks
Method name "ForumThreadLink::needs_name_and_description" is not in camel caps format Open
public function needs_name_and_description()
- Exclude checks
Method name "ForumThreadLink::save_linked_data" is not in camel caps format Open
public function save_linked_data()
- Exclude checks
Method name "ForumThreadLink::get_type_name" is not in camel caps format Open
public function get_type_name()
- Exclude checks
Missing function doc comment Open
public function needs_results()
- Exclude checks
Method name "ForumThreadLink::get_description" is not in camel caps format Open
public function get_description()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
$ref_id = $this->get_ref_id();
- Exclude checks
Method name "ForumThreadLink::get_forum_thread_table" is not in camel caps format Open
private function get_forum_thread_table()
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = '(session_id = 0 OR session_id IS NULL)';
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
if (!isset($this->exercise_data)) {
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
'.$session_condition;
- Exclude checks
Variable "thread_qualify" is not in valid camel caps format Open
$thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
- Exclude checks
Variable "thread_title" is not in valid camel caps format Open
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
- Exclude checks
Variable "tbl_grade_links" is not in valid camel caps format Open
$tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);
- Exclude checks
Method name "ForumThreadLink::has_results" is not in camel caps format Open
public function has_results()
- Exclude checks
Variable "thread_title_qualify" is not in valid camel caps format Open
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- Exclude checks
Variable "thread_title_qualify" is not in valid camel caps format Open
if (isset($thread_title_qualify) && '' != $thread_title_qualify) {
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course = api_get_course_entity($this->course_id);
- Exclude checks
Method name "ForumThreadLink::calc_score" is not in camel caps format Open
public function calc_score($studentId = null, $type = null)
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = ".$this->course_id." AND
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
- Exclude checks
Variable "thread_title_qualify" is not in valid camel caps format Open
if (isset($thread_title_qualify) && '' != $thread_title_qualify) {
- Exclude checks
Method name "ForumThreadLink::get_link" is not in camel caps format Open
public function get_link()
- Exclude checks
Variable "ref_id" is not in valid camel caps format Open
$ref_id = $this->get_ref_id();
- Exclude checks
The variable $thread_title_qualify is not named in camelCase. Open
public function get_name()
{
$this->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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_grade_links is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->getCourseId())) {
return [];
}
- 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 $thread_qualify is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$threadInfo = $this->getThreadData();
$thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$sessionId = $this->get_session_id();
- 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 $forum_id is not named in camelCase. Open
public function get_link()
{
$sessionId = $this->get_session_id();
$sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
WHERE
- 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 save_linked_data()
{
$weight = $this->get_weight();
$ref_id = $this->get_ref_id();
- 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 $session_condition is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->getCourseId())) {
return [];
}
- 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 $session_condition is not named in camelCase. Open
private function getThreadData()
{
$sessionId = $this->get_session_id();
if ($sessionId) {
$session_condition = 'session_id = '.$sessionId;
- 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 $session_condition is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->getCourseId())) {
return [];
}
- 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 $thread_title_qualify is not named in camelCase. Open
public function get_name()
{
$this->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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 delete_linked_data()
{
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {
// Cleans forum
- 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 $thread_qualify is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$threadInfo = $this->getThreadData();
$thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$sessionId = $this->get_session_id();
- 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 $forum_id is not named in camelCase. Open
public function get_link()
{
$sessionId = $this->get_session_id();
$sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
WHERE
- 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 $thread_title is not named in camelCase. Open
public function get_name()
{
$this->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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 $thread_title_qualify is not named in camelCase. Open
public function get_name()
{
$this->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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 delete_linked_data()
{
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {
// Cleans forum
- 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 save_linked_data()
{
$weight = $this->get_weight();
$ref_id = $this->get_ref_id();
- 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 save_linked_data()
{
$weight = $this->get_weight();
$ref_id = $this->get_ref_id();
- 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 $thread_title is not named in camelCase. Open
public function get_name()
{
$this->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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 delete_linked_data()
{
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {
// Cleans forum
- 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 $session_condition is not named in camelCase. Open
private function getThreadData()
{
$sessionId = $this->get_session_id();
if ($sessionId) {
$session_condition = 'session_id = '.$sessionId;
- 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 $session_condition is not named in camelCase. Open
private function getThreadData()
{
$sessionId = $this->get_session_id();
if ($sessionId) {
$session_condition = 'session_id = '.$sessionId;
- 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('Forum threads');
}
- 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()
{
$table = Database::get_course_table(TABLE_FORUM_POST);
$sql = "SELECT count(*) AS number FROM $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_forum_thread_table is not named in camelCase. Open
private function get_forum_thread_table()
{
return $this->forum_thread_table = Database::get_course_table(TABLE_FORUM_THREAD);
}
- 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_all_links is not named in camelCase. Open
public function get_all_links()
{
if (empty($this->getCourseId())) {
return [];
}
- 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->getThreadData();
$thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : '';
$thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : '';
- 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 get_description is not named in camelCase. Open
public function get_description()
{
return ''; //$this->exercise_data['description'];
}
- 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 delete_linked_data is not named in camelCase. Open
public function delete_linked_data()
{
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {
// Cleans forum
- 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 get_icon_name is not named in camelCase. Open
public function get_icon_name()
{
return 'forum';
}
- 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()
{
$sessionId = $this->get_session_id();
$sql = 'SELECT * FROM '.$this->get_forum_thread_table()."
WHERE
- 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 save_linked_data is not named in camelCase. Open
public function save_linked_data()
{
$weight = $this->get_weight();
$ref_id = $this->get_ref_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 calc_score is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$threadInfo = $this->getThreadData();
$thread_qualify = Database::get_course_table(TABLE_FORUM_THREAD_QUALIFY);
$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 is_valid_link is not named in camelCase. Open
public function is_valid_link()
{
$sessionId = $this->get_session_id();
$sql = 'SELECT count(iid) FROM '.$this->get_forum_thread_table().'
WHERE
- 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() {
}
}