Avoid unused local variables such as '$dummy'. Open
foreach ($this->sub_items as $id => $dummy) {
- 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 parameters such as '$rel_order'. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
- 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
The property $command_line is not named in camelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- 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 parameter $from_outside is not named in camelCase. Open
public function save($from_outside = true, $prereqs_complete = false)
{
parent::save($from_outside, $prereqs_complete = false);
// Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
$this->aicc_contact = true;
- 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 $prereqs_complete is not named in camelCase. Open
public function save($from_outside = true, $prereqs_complete = false)
{
parent::save($from_outside, $prereqs_complete = false);
// Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
$this->aicc_contact = true;
- 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 property $core_vendor is not named in camelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- 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 parameter $course_id is not named in camelCase. Open
public function __construct($type = 'config', $params = [], $course_id = null)
{
if (isset($params)) {
switch ($type) {
case 'db':
- 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 property $system_vendor is not named in camelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- 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 parameter $abs_order is not named in camelCase. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
{
$list[] = [
'au_type' => $this->au_type,
'command_line' => $this->command_line,
- 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 class aiccItem is not named in CamelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
The parameter $rel_order is not named in camelCase. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
{
$list[] = [
'au_type' => $this->au_type,
'command_line' => $this->command_line,
- 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 property $au_type is not named in camelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- 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 $sub_items is not named in camelCase. Open
class aiccItem extends learnpathItem
{
public $identifier = ''; // AICC AU's system_id
public $identifierref = '';
public $parameters = ''; // AICC AU's web_launch
- 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 "max_score" is not in valid camel caps format Open
$this->max_score = Database::escape_string($value);
- Exclude checks
Variable "core_vendor" is not in valid camel caps format Open
$this->core_vendor = Database::escape_string(
- Exclude checks
Member variable "command_line" is not in valid camel caps format Open
public $command_line = ''; // AICC AU's command_line
- Exclude checks
Missing parameter name Open
* @param string Type of construction needed ('db' or 'config', default = 'config')
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
public function __construct($type = 'config', $params = [], $course_id = null)
- Exclude checks
Member variable "system_vendor" is not in valid camel caps format Open
public $system_vendor = ''; // AICC AU's system_vendor
- Exclude checks
Variable "command_line" is not in valid camel caps format Open
$this->command_line = Database::escape_string(
- Exclude checks
Member variable "sub_items" is not in valid camel caps format Open
public $sub_items = []; // AICC elements (des)
- Exclude checks
Variable "au_type" is not in valid camel caps format Open
$this->au_type = Database::escape_string($value);
- Exclude checks
Variable "course_id" is not in valid camel caps format Open
parent::__construct($params, api_get_user_id(), $course_id);
- Exclude checks
Variable "sub_items" is not in valid camel caps format Open
$oSubitem = &$this->sub_items[$id];
- Exclude checks
Variable "aicc_contact" is not in valid camel caps format Open
$this->aicc_contact = false;
- Exclude checks
Variable "system_vendor" is not in valid camel caps format Open
$this->system_vendor = Database::escape_string(
- Exclude checks
Variable "prereqs_complete" is not in valid camel caps format Open
parent::save($from_outside, $prereqs_complete = false);
- Exclude checks
Member variable "core_vendor" is not in valid camel caps format Open
public $core_vendor = ''; // AICC AU's core_vendor
- Exclude checks
Member variable "au_type" is not in valid camel caps format Open
public $au_type = ''; // AICC AU's type
- Exclude checks
Missing parameter name Open
* @param mixed Depending on the type given, DB id for the lp_item or parameters array
- Exclude checks
Variable "prereq_string" is not in valid camel caps format Open
'prerequisites' => (!empty($this->prereq_string) ? $this->prereq_string : ''),
- Exclude checks
Variable "sub_items" is not in valid camel caps format Open
foreach ($this->sub_items as $id => $dummy) {
- Exclude checks
Missing parameter name Open
* @param bool Save from URL params (1) or from object attributes (0)
- Exclude checks
Variable "au_type" is not in valid camel caps format Open
'au_type' => $this->au_type,
- Exclude checks
Variable "command_line" is not in valid camel caps format Open
'command_line' => $this->command_line,
- Exclude checks
Missing parameter name Open
* @param array Reference to the array to complete with the current item
- Exclude checks
Variable "rel_order" is not in valid camel caps format Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
- Exclude checks
Variable "core_vendor" is not in valid camel caps format Open
'core_vendor' => $this->core_vendor,
- Exclude checks
Method name "aiccItem::get_flat_list" is not in camel caps format Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
- Exclude checks
Variable "from_outside" is not in valid camel caps format Open
public function save($from_outside = true, $prereqs_complete = false)
- Exclude checks
Variable "prereqs_complete" is not in valid camel caps format Open
public function save($from_outside = true, $prereqs_complete = false)
- Exclude checks
Missing parameter name Open
* @param int Optional level. If not given, assumes it's level 0
- Exclude checks
Variable "prereq_string" is not in valid camel caps format Open
'prerequisites' => (!empty($this->prereq_string) ? $this->prereq_string : ''),
- Exclude checks
Missing parameter name Open
* @param int Optional absolute order (pointer) of the item in this learning path
- Exclude checks
Variable "abs_order" is not in valid camel caps format Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
- Exclude checks
Variable "abs_order" is not in valid camel caps format Open
$abs_order++;
- Exclude checks
Variable "abs_order" is not in valid camel caps format Open
$oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);
- Exclude checks
Variable "aicc_contact" is not in valid camel caps format Open
$this->aicc_contact = true;
- Exclude checks
Missing parameter name Open
* @param int Optional relative order of the item at this level
- Exclude checks
Variable "from_outside" is not in valid camel caps format Open
parent::save($from_outside, $prereqs_complete = false);
- Exclude checks
Class name "aiccItem" is not in camel caps format Open
class aiccItem extends learnpathItem
- Exclude checks
The variable $abs_order is not named in camelCase. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
{
$list[] = [
'au_type' => $this->au_type,
'command_line' => $this->command_line,
- 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 $abs_order is not named in camelCase. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
{
$list[] = [
'au_type' => $this->au_type,
'command_line' => $this->command_line,
- 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 __construct($type = 'config', $params = [], $course_id = null)
{
if (isset($params)) {
switch ($type) {
case 'db':
- 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 $from_outside is not named in camelCase. Open
public function save($from_outside = true, $prereqs_complete = false)
{
parent::save($from_outside, $prereqs_complete = false);
// Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
$this->aicc_contact = true;
- 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 $prereqs_complete is not named in camelCase. Open
public function save($from_outside = true, $prereqs_complete = false)
{
parent::save($from_outside, $prereqs_complete = false);
// Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
$this->aicc_contact = true;
- 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_flat_list is not named in camelCase. Open
public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
{
$list[] = [
'au_type' => $this->au_type,
'command_line' => $this->command_line,
- 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() {
}
}