chamilo/chamilo-lms

View on GitHub
public/main/lp/aiccItem.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused local variables such as '$dummy'.
Open

        foreach ($this->sub_items as $id => $dummy) {
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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)
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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;
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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;
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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':
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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,
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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,
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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);

Variable "core_vendor" is not in valid camel caps format
Open

                                $this->core_vendor = Database::escape_string(

Member variable "command_line" is not in valid camel caps format
Open

    public $command_line = ''; // AICC AU's command_line

Missing parameter name
Open

     * @param    string    Type of construction needed ('db' or 'config', default = 'config')

Variable "course_id" is not in valid camel caps format
Open

    public function __construct($type = 'config', $params = [], $course_id = null)

Member variable "system_vendor" is not in valid camel caps format
Open

    public $system_vendor = ''; // AICC AU's system_vendor

Variable "command_line" is not in valid camel caps format
Open

                                $this->command_line = Database::escape_string(

Member variable "sub_items" is not in valid camel caps format
Open

    public $sub_items = []; // AICC elements (des)

Variable "au_type" is not in valid camel caps format
Open

                                $this->au_type = Database::escape_string($value);

Variable "course_id" is not in valid camel caps format
Open

                    parent::__construct($params, api_get_user_id(), $course_id);

Variable "sub_items" is not in valid camel caps format
Open

            $oSubitem = &$this->sub_items[$id];

Variable "aicc_contact" is not in valid camel caps format
Open

                    $this->aicc_contact = false;

Variable "system_vendor" is not in valid camel caps format
Open

                                $this->system_vendor = Database::escape_string(

Variable "prereqs_complete" is not in valid camel caps format
Open

        parent::save($from_outside, $prereqs_complete = false);

Member variable "core_vendor" is not in valid camel caps format
Open

    public $core_vendor = ''; // AICC AU's core_vendor

Member variable "au_type" is not in valid camel caps format
Open

    public $au_type = ''; // AICC AU's type

Missing parameter name
Open

     * @param    mixed    Depending on the type given, DB id for the lp_item or parameters array

Variable "prereq_string" is not in valid camel caps format
Open

            'prerequisites' => (!empty($this->prereq_string) ? $this->prereq_string : ''),

Variable "sub_items" is not in valid camel caps format
Open

        foreach ($this->sub_items as $id => $dummy) {

Missing parameter name
Open

     * @param    bool    Save from URL params (1) or from object attributes (0)

Variable "au_type" is not in valid camel caps format
Open

            'au_type' => $this->au_type,

Variable "command_line" is not in valid camel caps format
Open

            'command_line' => $this->command_line,

Missing parameter name
Open

     * @param    array    Reference to the array to complete with the current item

Variable "rel_order" is not in valid camel caps format
Open

    public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)

Variable "core_vendor" is not in valid camel caps format
Open

            'core_vendor' => $this->core_vendor,

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)

Variable "from_outside" is not in valid camel caps format
Open

    public function save($from_outside = true, $prereqs_complete = false)

Variable "prereqs_complete" is not in valid camel caps format
Open

    public function save($from_outside = true, $prereqs_complete = false)

Missing parameter name
Open

     * @param    int    Optional level. If not given, assumes it's level 0

Variable "prereq_string" is not in valid camel caps format
Open

            'prerequisites' => (!empty($this->prereq_string) ? $this->prereq_string : ''),

Missing parameter name
Open

     * @param    int    Optional absolute order (pointer) of the item in this learning path

Variable "abs_order" is not in valid camel caps format
Open

    public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)

Variable "abs_order" is not in valid camel caps format
Open

        $abs_order++;

Variable "abs_order" is not in valid camel caps format
Open

            $oSubitem->get_flat_list($list, $abs_order, $i, $level + 1);

Variable "aicc_contact" is not in valid camel caps format
Open

        $this->aicc_contact = true;

Missing parameter name
Open

     * @param    int    Optional relative order of the item at this level

Variable "from_outside" is not in valid camel caps format
Open

        parent::save($from_outside, $prereqs_complete = false);

Class name "aiccItem" is not in camel caps format
Open

class aiccItem extends learnpathItem

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,
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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,
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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':
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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;
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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;
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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,
Severity: Minor
Found in public/main/lp/aiccItem.class.php by phpmd

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

There are no issues that match your filters.

Category
Status