chamilo/chamilo-lms

View on GitHub
public/main/exercise/export/scorm/ScormExercise.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '173', column '30').
Open

        $scormQuestion = new ScormQuestion();

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 '$charset'.
Open

        global $charset;

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 '$em'.
Open

        $em = Database::getManager();

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

Method name "ScormExercise::end_js" is not in camel caps format
Open

    public function end_js()

Method name "ScormExercise::start_header" is not in camel caps format
Open

    public function start_header()

Method name "ScormExercise::end_body" is not in camel caps format
Open

    public function end_body()

Method name "ScormExercise::end_header" is not in camel caps format
Open

    private function end_header()

Method name "ScormExercise::start_body" is not in camel caps format
Open

    public function start_body()

Method name "ScormExercise::end_page" is not in camel caps format
Open

    public function end_page()

Method name "ScormExercise::start_js" is not in camel caps format
Open

    private function start_js()

Method name "ScormExercise::common_js" is not in camel caps format
Open

    public function common_js()

The method common_js is not named in camelCase.
Open

    public function common_js()
    {
        $js = file_get_contents(api_get_path(SYS_CODE_PATH).'exercise/export/scorm/common.js');

        return $js."\n";

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 end_page is not named in camelCase.
Open

    public function end_page()
    {
        return '</html>';
    }

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 end_js is not named in camelCase.
Open

    public function end_js()
    {
        return '</script>';
    }

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 start_js is not named in camelCase.
Open

    private function start_js()
    {
        return '<script>';
    }

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 end_header is not named in camelCase.
Open

    private function end_header()
    {
        return '</head>';
    }

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 start_body is not named in camelCase.
Open

    public function start_body()
    {
        return '<body>'.
            '<h1>'.$this->exercise->selectTitle().'</h1><p>'.$this->exercise->selectDescription().'</p>'.
            '<form id="chamilo_scorm_form" method="post" action="">'.

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 end_body is not named in camelCase.
Open

    public function end_body()
    {
        $button = '<input
            id="chamilo_scorm_submit"
            class="btn btn--primary"

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 start_header is not named in camelCase.
Open

    public function start_header()
    {
        return '<head>';
    }

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