Avoid unused local variables such as '$objective'. Open
foreach ($objectives as $index => $objective) {
- 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 parameter $lp_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $item_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $view_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $user_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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
Missing parameter name Open
* @param int Learnpath ID
- Exclude checks
Missing parameter name Open
* @param array Objectives array
- Exclude checks
Variable "item_id" is not in valid camel caps format Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
- Exclude checks
Missing parameter name Open
* @param int View ID
- Exclude checks
Variable "lp_id" is not in valid camel caps format Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
- Exclude checks
Variable "item_id" is not in valid camel caps format Open
error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
- Exclude checks
Variable "view_id" is not in valid camel caps format Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
- Exclude checks
Variable "lp_id" is not in valid camel caps format Open
$mylp = learnpath::getLpFromSession(api_get_course_int_id(), $lp_id, $user_id);
- Exclude checks
Consider putting global function "save_objectives" in a static class Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
- Exclude checks
Variable "lp_id" is not in valid camel caps format Open
error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
- Exclude checks
Missing parameter name Open
* @param int Item ID
- Exclude checks
Variable "use_anonymous" is not in valid camel caps format Open
$use_anonymous = true;
- Exclude checks
Missing parameter name Open
* @param int User ID
- Exclude checks
Variable "view_id" is not in valid camel caps format Open
error_log('In xajax_save_objectives('.$lp_id.','.$user_id.','.$view_id.','.$item_id.',"'.(count($objectives) > 0 ? count($objectives) : '').'")', 0);
- Exclude checks
Variable "user_id" is not in valid camel caps format Open
$mylp = learnpath::getLpFromSession(api_get_course_int_id(), $lp_id, $user_id);
- Exclude checks
Variable "item_id" is not in valid camel caps format Open
$mylpi = &$mylp->items[$item_id];
- Exclude checks
The variable $item_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $item_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $lp_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $user_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $lp_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $user_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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 $view_id is not named in camelCase. Open
function save_objectives($lp_id, $user_id, $view_id, $item_id, $objectives = [])
{
$debug = 0;
$return = '';
if ($debug > 0) {
- 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();
}
}