chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '112', column '63').
Open

                                        $this->metadata = new scormMetadata('manifest', $child);
Severity: Minor
Found in public/main/lp/scormItem.class.php by phpmd

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 '106', column '54').
Open

                                        $oItem = new scormItem('manifest', $child);
Severity: Minor
Found in public/main/lp/scormItem.class.php by phpmd

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

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

        foreach ($this->sub_items as $id => $dummy) {
Severity: Minor
Found in public/main/lp/scormItem.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

The property $mastery_score is not named in camelCase.
Open

class scormItem extends learnpathItem
{
    public $identifier = '';
    public $identifierref = '';
    public $isvisible = '';
Severity: Minor
Found in public/main/lp/scormItem.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 $rel_order is not named in camelCase.
Open

    public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
    {
        $list[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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 $abs_order is not named in camelCase.
Open

    public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
    {
        $list[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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 $from_outside is not named in camelCase.
Open

    public function save($from_outside = true, $prereqs_complete = false)
    {
        parent::save($from_outside, $prereqs_complete);
        // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
        $this->scorm_contact = true;
Severity: Minor
Found in public/main/lp/scormItem.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);
        // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
        $this->scorm_contact = true;
Severity: Minor
Found in public/main/lp/scormItem.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 $scorm_contact is not named in camelCase.
Open

class scormItem extends learnpathItem
{
    public $identifier = '';
    public $identifierref = '';
    public $isvisible = '';
Severity: Minor
Found in public/main/lp/scormItem.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 scormItem extends learnpathItem
{
    public $identifier = '';
    public $identifierref = '';
    public $isvisible = '';
Severity: Minor
Found in public/main/lp/scormItem.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 class scormItem is not named in CamelCase.
Open

class scormItem extends learnpathItem
{
    public $identifier = '';
    public $identifierref = '';
    public $isvisible = '';
Severity: Minor
Found in public/main/lp/scormItem.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 property $max_time_allowed is not named in camelCase.
Open

class scormItem extends learnpathItem
{
    public $identifier = '';
    public $identifierref = '';
    public $isvisible = '';
Severity: Minor
Found in public/main/lp/scormItem.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

Spaces must be used for alignment; tabs are not allowed
Open

 * @author    Yannick Warnier    <ywarnier@beeznest.org>

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

    public $scorm_contact;

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

                                            $this->max_score = $child->firstChild->nodeValue;

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

                                            $this->prereq_string = $child->firstChild->nodeValue;

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

                                        $tmp_children = $child->childNodes;

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

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

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

                                        $tmp_children = $child->childNodes;

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

Missing parameter name
Open

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

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

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

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

                                        $tmp_children = $child->childNodes;

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

            'maxtimeallowed' => $this->max_time_allowed,

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

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

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

                                        $tmp_children = $child->childNodes;

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

Spaces must be used for alignment; tabs are not allowed
Open

 * @author    Yannick Warnier    <ywarnier@beeznest.org>

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

                    $this->scorm_contact = false;

Missing parameter name
Open

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

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

            'max_score' => $this->max_score,

Superfluous parameter comment
Open

     * @param int    $course_id

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

                                            $this->max_time_allowed = $child->firstChild->nodeValue;

Method name "scormItem::get_flat_list" is not in camel caps format
Open

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

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 "rel_order" is not in valid camel caps format
Open

            'rel_order' => $rel_order,

Missing parameter name
Open

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

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

            'masteryscore' => $this->mastery_score,

Missing parameter name
Open

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

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

    public $sub_items = [];

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

                                        $tmp_children = $child->childNodes;

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

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

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

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

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

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

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

                                        if (1 == $tmp_children->length && '' != $child->firstChild->nodeValue) {

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

                                            $this->mastery_score = $child->firstChild->nodeValue;

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

        $abs_order++;

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

                                        $tmp_children = $child->childNodes;

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

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

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

    public $max_time_allowed = '00:00:00';

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

    public $mastery_score = '';

Missing parameter name
Open

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

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

            'abs_order' => $abs_order,

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

        $this->scorm_contact = true;

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

                                            $this->sub_items[$oItem->identifier] = $oItem;

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

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

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

class scormItem 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[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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);
        // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
        $this->scorm_contact = true;
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $tmp_children is not named in camelCase.
Open

    public function __construct($type = 'manifest', &$element = null)
    {
        if (isset($element)) {
            // Parsing using PHP5 DOMXML methods.
            switch ($type) {
Severity: Minor
Found in public/main/lp/scormItem.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 $rel_order is not named in camelCase.
Open

    public function get_flat_list(&$list, &$abs_order, $rel_order = 1, $level = 0)
    {
        $list[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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);
        // Under certain conditions, the scorm_contact should not be set, because no scorm signal was sent.
        $this->scorm_contact = true;
Severity: Minor
Found in public/main/lp/scormItem.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[] = [
            'abs_order' => $abs_order,
            'datafromlms' => $this->datafromlms,
Severity: Minor
Found in public/main/lp/scormItem.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