The method blockFinalExercise uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return false;
}
- 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 setOption uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$params = [
'exercise_id' => $exerciseId,
'c_id' => $courseId,
'session_id' => $sessionId,
- 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 getCourseExercise uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sql .= ' AND is_final = 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 getCourseExercise uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sql .= ' AND is_initial = 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
Missing function doc comment Open
public function getInitialExercise($courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public static function create()
- Exclude checks
Missing function doc comment Open
public function getPositionData($exerciseId, $courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public function blockFinalExercise($userId, $exerciseId, $courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public function isInitialExercise($exerciseId, $courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public function setFinalExercise($exerciseId, $courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public function install()
- Exclude checks
Missing function doc comment Open
public function isFinalExercise($exerciseId, $courseId, $sessionId)
- Exclude checks
Missing function doc comment Open
public function getFinalExercise($courseId, $sessionId)
- Exclude checks
You must use "/**" style comments for a class comment Open
class Positioning extends Plugin
- Exclude checks
Missing function doc comment Open
public function uninstall()
- Exclude checks
Missing function doc comment Open
public function setInitialExercise($exerciseId, $courseId, $sessionId)
- Exclude checks