The method calc_score() has an NPath complexity of 3926664. The configured NPath complexity threshold is 200. Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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
Missing class import via use statement (line '202', column '26'). Open
$cache = new \Symfony\Component\Cache\Adapter\ApcuAdapter();
- 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
Missing class import via use statement (line '208', column '25'). Open
$exercise = new Exercise($courseId);
- 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_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 = api_get_session_condition($sessionId, true, true);
}
- 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 {
if ($cacheAvailable) {
$cacheItem = $cache->getItem($key);
$cacheItem->set(null);
$cache->save($cacheItem);
- 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
// normal way of getting the info
$students = []; // user list, needed to make sure we only
// take first attempts into account
- 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 {
if (in_array('session_id', $lpData) && (int) $lpData['session_id'] == $sessionId) {
$lpList[] = $lpData['lp_id'];
}
}
- 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_exercise_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Try with iid
$sql = 'SELECT * FROM '.$table.'
WHERE
iid = '.$exerciseId;
- 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 {
$lpCondition = null;
if (!empty($exercise->lpList)) {
//$lpId = $exercise->getLpBySession($sessionId);
$lpList = [];
- 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 {
$sql = "SELECT * FROM $tblHp hp
INNER JOIN $tblDoc doc
ON (hp.title = doc.path AND doc.c_id = hp.c_id)
WHERE
- 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 {
$studentCount = count($this->getStudentList());
$sumResult = array_sum($link->getUserScoreList());
$result = [$sumResult, $studentCount];
}
- 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 {
switch ($type) {
case 'best':
$result = [$bestResult, $weight];
if ($cacheAvailable) {
- 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_exercise_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$table = Database::get_course_table(TABLE_QUIZ_TEST);
}
- 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_exercise_data uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
// Try wit id
$sql = 'SELECT * FROM '.$table.'
WHERE
c_id = '.$this->course_id.' AND
- 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 '283', column '17'). Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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 parameters such as '$getOnlyHotPotatoes'. Open
public function get_all_links($getOnlyHotPotatoes = false)
- 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 local variables such as '$session_condition'. Open
$session_condition = api_get_session_condition(0, true);
- 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 '$attempt'. Open
while ($attempt = Database::fetch_array($attempts)) {
- 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 '$uploadPath'. Open
$uploadPath = null;
- 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 '$cacheDriver'. Open
$cacheDriver = null;
- 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 $exercise_data is not named in camelCase. Open
class ExerciseLink extends AbstractLink
{
public $checkBaseExercises = false;
private $exercise_table;
private $exercise_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 $exercise_table is not named in camelCase. Open
class ExerciseLink extends AbstractLink
{
public $checkBaseExercises = false;
private $exercise_table;
private $exercise_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 $is_hp is not named in camelCase. Open
class ExerciseLink extends AbstractLink
{
public $checkBaseExercises = false;
private $exercise_table;
private $exercise_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 "ExerciseLink::has_results" is not in camel caps format Open
public function has_results()
- Exclude checks
Variable "student_count" is not in valid camel caps format Open
$student_count++;
- Exclude checks
Method name "ExerciseLink::get_exercise_data" is not in camel caps format Open
public function get_exercise_data()
- Exclude checks
Method name "ExerciseLink::get_exercise_table" is not in camel caps format Open
private function get_exercise_table()
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = api_get_session_condition($sessionId, true, true);
- Exclude checks
Method name "ExerciseLink::needs_name_and_description" is not in camel caps format Open
public function needs_name_and_description()
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
if (1 == $this->is_hp) {
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
$this->is_hp = $hp;
- Exclude checks
Method name "ExerciseLink::get_type_name" is not in camel caps format Open
public function get_type_name()
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
return $this->exercise_data;
- Exclude checks
Variable "exercise_was_added_in_lp" is not in valid camel caps format Open
if (false == $exercise->exercise_was_added_in_lp) {
- Exclude checks
Method name "ExerciseLink::needs_results" is not in camel caps format Open
public function needs_results()
- Exclude checks
Method name "ExerciseLink::is_allowed_to_change_name" is not in camel caps format Open
public function is_allowed_to_change_name()
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$this->exercise_data = Database::fetch_array($result);
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course = api_get_course_entity($this->course_id);
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = ($this->getCourseId());
- Exclude checks
Variable "student_count" is not in valid camel caps format Open
if (0 == $student_count) {
- Exclude checks
Method name "ExerciseLink::get_description" is not in camel caps format Open
public function get_description()
- Exclude checks
Missing function doc comment Open
public function getStats($type)
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = $course_id AND
- Exclude checks
Method name "ExerciseLink::calc_score" is not in camel caps format Open
public function calc_score($studentId = null, $type = null)
- Exclude checks
Method name "ExerciseLink::needs_max" is not in camel caps format Open
public function needs_max()
- Exclude checks
Missing function doc comment Open
public function needs_results()
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
$this->exercise_data = Database::fetch_array($result);
- Exclude checks
Method name "ExerciseLink::get_all_links" is not in camel caps format Open
public function get_all_links($getOnlyHotPotatoes = false)
- Exclude checks
Variable "tbl_stats" is not in valid camel caps format Open
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
- Exclude checks
Variable "student_count" is not in valid camel caps format Open
$result = [$sum, $student_count];
- Exclude checks
Method name "ExerciseLink::get_link" is not in camel caps format Open
public function get_link()
- Exclude checks
Method name "ExerciseLink::is_valid_link" is not in camel caps format Open
public function is_valid_link()
- Exclude checks
Missing function doc comment Open
public function needs_max()
- Exclude checks
Missing function doc comment Open
public function is_allowed_to_change_name()
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
if (empty($this->exercise_data)) {
- Exclude checks
Variable "exercise_data" is not in valid camel caps format Open
if (empty($this->exercise_data)) {
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
if (1 == $this->is_hp) {
- Exclude checks
Variable "exercise_table" is not in valid camel caps format Open
$this->exercise_table = Database::get_course_table(TABLE_QUIZ_TEST);
- Exclude checks
Variable "student_count" is not in valid camel caps format Open
$student_count = 0;
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
if (1 == $this->is_hp) {
- Exclude checks
Missing function doc comment Open
public function getBestScore()
- Exclude checks
Method name "ExerciseLink::get_name" is not in camel caps format Open
public function get_name()
- Exclude checks
Missing function doc comment Open
public function getLpListToString()
- Exclude checks
Missing function doc comment Open
public function needs_name_and_description()
- Exclude checks
Method name "ExerciseLink::get_icon_name" is not in camel caps format Open
public function get_icon_name()
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
if (1 == $this->is_hp) {
- Exclude checks
Variable "is_hp" is not in valid camel caps format Open
if (!$this->is_hp) {
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
c_id = '.$this->course_id.' AND
- Exclude checks
Variable "exercise_table" is not in valid camel caps format Open
return $this->exercise_table;
- Exclude checks
Variable "session_condition" is not in valid camel caps format Open
$session_condition = api_get_session_condition(0, true);
- Exclude checks
Variable "tbl_stats" is not in valid camel caps format Open
FROM $tbl_stats
- Exclude checks
The variable $student_count is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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_stats is not named in camelCase. Open
public function has_results()
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sessionId = $this->get_session_id();
$course_id = ($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 $student_count is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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 $student_count is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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 $student_count is not named in camelCase. Open
public function calc_score($studentId = null, $type = null)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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 has_results()
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sessionId = $this->get_session_id();
$course_id = ($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 $session_condition is not named in camelCase. Open
public function get_all_links($getOnlyHotPotatoes = false)
{
$exerciseTable = $this->get_exercise_table();
$lpItemTable = Database::get_course_table(TABLE_LP_ITEM);
if (empty($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 $session_condition is not named in camelCase. Open
public function get_all_links($getOnlyHotPotatoes = false)
{
$exerciseTable = $this->get_exercise_table();
$lpItemTable = Database::get_course_table(TABLE_LP_ITEM);
if (empty($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 $course_id is not named in camelCase. Open
public function has_results()
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sessionId = $this->get_session_id();
$course_id = ($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_stats is not named in camelCase. Open
public function has_results()
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sessionId = $this->get_session_id();
$course_id = ($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 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 is_valid_link is not named in camelCase. Open
public function is_valid_link()
{
$exerciseData = $this->get_exercise_data();
return !empty($exerciseData);
- 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()
{
$data = $this->get_exercise_data();
return isset($data['description']) ? $data['description'] : 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_exercise_data is not named in camelCase. Open
public function get_exercise_data()
{
if (1 == $this->is_hp) {
$table = Database::get_course_table(TABLE_DOCUMENT);
} else {
- 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_type_name is not named in camelCase. Open
public function get_type_name()
{
if (1 == $this->is_hp) {
return 'HotPotatoes';
}
- 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($getOnlyHotPotatoes = false)
{
$exerciseTable = $this->get_exercise_table();
$lpItemTable = Database::get_course_table(TABLE_LP_ITEM);
if (empty($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_icon_name is not named in camelCase. Open
public function get_icon_name()
{
return 'exercise';
}
- 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()
{
$data = $this->get_exercise_data();
return $data['title'];
- 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();
$data = $this->get_exercise_data();
$exerciseId = $data['iid'];
- 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)
{
$allowStats = ('true' === api_get_setting('gradebook.allow_gradebook_stats'));
if ($allowStats) {
$link = $this->entity;
- 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_exercise_table is not named in camelCase. Open
private function get_exercise_table()
{
$this->exercise_table = Database::get_course_table(TABLE_QUIZ_TEST);
return $this->exercise_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 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 has_results is not named in camelCase. Open
public function has_results()
{
$tbl_stats = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$sessionId = $this->get_session_id();
$course_id = ($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() {
}
}