The method display_notes() has an NPath complexity of 288. The configured NPath complexity threshold is 200. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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
Avoid unused local variables such as '$course_id'. Open
$course_id = api_get_course_int_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
Avoid unused local variables such as '$course_id'. Open
$course_id = api_get_course_int_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 method display_notes uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$sort_direction = 'DESC';
$link_sort_direction = 'ASC';
}
- 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 parameter $notebook_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_id)) {
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $notebook_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
return [];
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Variable "course_id" is not in valid camel caps format Open
c_id = $course_id AND
- Exclude checks
Variable "session_img" is not in valid camel caps format Open
$session_img = api_get_session_image($row['session_id'], $user);
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
$notebook_id = (int) $notebook_id;
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
echo '<a href="index.php?'.api_get_cidreq().'&action=changeview&view=title&direction='.$link_sort_direction.'">'.
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
if (empty($notebook_id)) {
- Exclude checks
Method name "NotebookManager::display_notes" is not in camel caps format Open
public static function display_notes()
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = api_get_course_int_id();
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
$affected_rows = Database::affected_rows($result);
- Exclude checks
Variable "sort_direction" is not in valid camel caps format Open
$sort_direction = 'ASC';
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
href="index.php?'.api_get_cidreq().'&action=changeview&view=update_date&direction='.$link_sort_direction.'">'.
- Exclude checks
Variable "sort_direction" is not in valid camel caps format Open
$order_by = " ORDER BY `$notebookView` $sort_direction ";
- Exclude checks
Variable "condition_session" is not in valid camel caps format Open
$condition_session
- Exclude checks
Variable "order_by" is not in valid camel caps format Open
$cond_extra $order_by
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
$notebook_id = (int) $notebook_id;
- Exclude checks
Variable "sort_direction" is not in valid camel caps format Open
$sort_direction = 'DESC';
- Exclude checks
Variable "session_img" is not in valid camel caps format Open
$row['title'].$session_img.' <div class="pull-right">'.$actions.'</div>',
- Exclude checks
Method name "NotebookManager::javascript_notebook" is not in camel caps format Open
public static function javascript_notebook()
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
$link_sort_direction = 'DESC';
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
iid='".$notebook_id."' AND
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
href="index.php?'.api_get_cidreq().'&action=changeview&view=creation_date&direction='.$link_sort_direction.'">'.
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = api_get_course_int_id();
- Exclude checks
Variable "order_by" is not in valid camel caps format Open
$order_by = " ORDER BY `$notebookView` $sort_direction ";
- Exclude checks
Method name "NotebookManager::get_note_information" is not in camel caps format Open
public static function get_note_information($notebook_id)
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
public static function get_note_information($notebook_id)
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
public static function delete_note($notebook_id)
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
$notebook_id = (int) $notebook_id;
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
if (empty($notebook_id)) {
- Exclude checks
Variable "condition_session" is not in valid camel caps format Open
$condition_session = api_get_session_condition($sessionId);
- Exclude checks
Variable "sort_direction" is not in valid camel caps format Open
$sort_direction = 'ASC';
- Exclude checks
Variable "cond_extra" is not in valid camel caps format Open
$cond_extra $order_by
- Exclude checks
Missing function doc comment Open
public static function saveNote(array $values, $userId = 0, $courseId = 0, $sessionId = 0)
- Exclude checks
Method name "NotebookManager::delete_note" is not in camel caps format Open
public static function delete_note($notebook_id)
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
$link_sort_direction = 'DESC';
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
WHERE iid = '".$notebook_id."' ";
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
$course_id = api_get_course_int_id();
- Exclude checks
Variable "link_sort_direction" is not in valid camel caps format Open
$link_sort_direction = 'ASC';
- Exclude checks
Variable "notebook_id" is not in valid camel caps format Open
$notebook_id = (int) $notebook_id;
- Exclude checks
Variable "cond_extra" is not in valid camel caps format Open
$cond_extra = 'update_date' === $notebookView ? " AND update_date <> ''" : ' ';
- Exclude checks
Variable "affected_rows" is not in valid camel caps format Open
if (1 != $affected_rows) {
- Exclude checks
The variable $course_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 $notebook_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 $notebook_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 $notebook_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $notebook_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 $notebook_id is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 $sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $cond_extra is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $order_by is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $notebook_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $course_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $condition_session is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $affected_rows is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $condition_session is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $notebook_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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_img is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $session_img is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $notebook_id is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $order_by is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $affected_rows is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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 $link_sort_direction is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 $cond_extra is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 method get_note_information is not named in camelCase. Open
public static function get_note_information($notebook_id)
{
if (empty($notebook_id)) {
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 javascript_notebook is not named in camelCase. Open
public static function javascript_notebook()
{
return "<script>
function confirmation (name)
{
- 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 display_notes is not named in camelCase. Open
public static function display_notes()
{
$sessionId = api_get_session_id();
$user = api_get_user_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 delete_note is not named in camelCase. Open
public static function delete_note($notebook_id)
{
$notebook_id = (int) $notebook_id;
if (empty($notebook_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() {
}
}