chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/plugin.lib.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$pluginData' which will lead to PHP notices.
Open

            return $pluginData[$pluginName];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$pluginData' which will lead to PHP notices.
Open

            $pluginData[$pluginName] = $plugin_info;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$plugin_info' which will lead to PHP notices.
Open

                    if (isset($plugin_info) && isset($plugin_info['plugin_class']) && $obj->isCoursePlugin) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$plugin_info' which will lead to PHP notices.
Open

                    if (isset($plugin_info) && isset($plugin_info['plugin_class']) && $obj->isCoursePlugin) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Remove error control operator '@' on line 66.
Open

    public function read_plugins_from_path()
    {
        /* We scan the plugin directory. Each folder is a potential plugin. */
        $pluginPath = api_get_path(SYS_PLUGIN_PATH);
        $plugins = [];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Remove error control operator '@' on line 72.
Open

    public function read_plugins_from_path()
    {
        /* We scan the plugin directory. Each folder is a potential plugin. */
        $pluginPath = api_get_path(SYS_PLUGIN_PATH);
        $plugins = [];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

The method getAllPluginContentsByRegion uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $_template = [];
                $_template['plugin_info'] = $plugin_info;
            }
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getPluginInfo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $plugin_file = api_get_path(SYS_PLUGIN_PATH)."$pluginName/plugin.php";

            $plugin_info = [];
            if (file_exists($plugin_file)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method load_plugin_lang_variables uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                /*$interfaceLanguageId = api_get_language_id($language_interface);
                $interfaceLanguageInfo = api_get_language_info($interfaceLanguageId);
                $languageParentId = intval($interfaceLanguageInfo['parent_id']);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method add_course_settings_form uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        $element = &$form->createElement(
                            $setting['type'],
                            $setting['name'],
                            '',
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

                        $templatePluginFile = "$plugin_name/$pluginTemplate"; // for twig
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 '$forced'.
Open

    public function getPluginInfo($pluginName, $forced = false)
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

Avoid unused parameters such as '$template'.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

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

        $regionContent = $this->loadRegion(
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 local variables such as '$v'.
Open

                foreach ($groups as $k => $v) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 parameter $plugin_name is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_regions is not named in camelCase.
Open

class AppPlugin
{
    public $plugin_regions = [
        'main_top',
        'main_bottom',
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 "plugin_name" is not in valid camel caps format
Open

        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

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

            $pluginData[$pluginName] = $plugin_info;

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

            return $plugin_info;

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

            return $plugin_info['templates'];

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

                        $access_url_id,

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

    public function load_plugin_lang_variables($plugin_name)

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

        $english_path = $root.$plugin_name.'/lang/english.php';

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

            if (isset($plugin_info) && isset($plugin_info['templates'])) {

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

            if (file_exists($plugin_file)) {

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

        $access_url_id = api_get_current_access_url_id();

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

                $plugin_path = api_get_path(SYS_PLUGIN_PATH).$pluginName.'/plugin.php';

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

            if (!empty($obj->course_settings)) {

Doc comment for parameter $forced does not match actual variable name $template
Open

     * @param bool             $forced

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

            $path = $root.$plugin_name."/lang/$language_interface.php";

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

                if (file_exists($plugin_path)) {

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

                    if (isset($plugin_info) && isset($plugin_info['plugin_class']) && $obj->isCoursePlugin) {

Multi-line function call not indented correctly; expected 16 spaces but found 8
Open

        );

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

        if (is_readable($english_path)) {

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

        if ('english' != $language_interface) {

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

        $plugin_file = api_get_path(SYS_PLUGIN_PATH)."$plugin_name/index.php";

Doc comment for parameter $region does not match actual variable name $pluginName
Open

     * @param string           $region

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

            if (isset($plugin_info) && isset($plugin_info['templates'])) {

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

            $path = $root.$plugin_name."/lang/$language_interface.php";

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

            self::load_plugin_lang_variables($plugin_name);

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

                require $plugin_file;

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

                $_template['plugin_info'] = $plugin_info;

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

            $plugin_file = api_get_path(SYS_PLUGIN_PATH)."$pluginName/plugin.php";

Method name "AppPlugin::add_to_region" is not in camel caps format
Open

    public function add_to_region($plugin, $region)

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

                    if (isset($plugin_info) && isset($plugin_info['plugin_class']) && $obj->isCoursePlugin) {

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

        return $this->plugin_regions;

Method name "AppPlugin::load_plugin_lang_variables" is not in camel caps format
Open

    public function load_plugin_lang_variables($plugin_name)

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

            include $english_path;

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

            require $plugin_file;

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

            $plugin_info['settings'] = $settings_filtered;

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

                    require $plugin_path;

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

        $plugin_file = api_get_path(SYS_PLUGIN_PATH)."$plugin_name/index.php";

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

                $_template['plugin_info'] = $plugin_info;

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

            $settings_filtered = [];

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

                $settings_filtered[$item['variable']] = $item['selected_value'];

Missing function doc comment
Open

    public function setInstalledPluginListObject()

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

        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

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

            $plugin_info = [];

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

        if (isset($plugin_info) && isset($plugin_info['templates'])) {

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

                $templateList = $plugin_info['templates'];

Doc comment for parameter $region does not match actual variable name $plugin_name
Open

     * @param string           $region

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

        $language_interface = api_get_language_isocode();

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

        if (isset($plugin_info) && isset($plugin_info['templates'])) {

Method name "AppPlugin::get_installed_plugins" is not in camel caps format
Open

    public function get_installed_plugins($fromDatabase = true)

Doc comment for parameter $forced does not match actual variable name $template
Open

     * @param bool             $forced

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

            $plugin_settings = api_get_settings_params(

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

            $plugin_info['settings'] = $settings_filtered;

Method name "AppPlugin::install_course_plugins" is not in camel caps format
Open

    public function install_course_plugins($courseId)

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

                foreach ($obj->course_settings as $setting) {

Missing function doc comment
Open

    public function getInstalledPluginsInCurrentUrl()

Doc comment for parameter $template does not match actual variable name $region
Open

     * @param Twig_Environment $template

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

        $plugin_info['current_region'] = $region;

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

        if (file_exists($plugin_file)) {

Multi-line function call not indented correctly; expected 20 spaces but found 12
Open

            '

Method name "AppPlugin::read_plugins_from_path" is not in camel caps format
Open

    public function read_plugins_from_path()

Method name "AppPlugin::is_valid_plugin" is not in camel caps format
Open

    public function is_valid_plugin($pluginName)

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

        sort($this->plugin_regions);

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

        $english_path = $root.$plugin_name.'/lang/english.php';

Doc comment for parameter $template does not match actual variable name $region
Open

     * @param Twig_Environment $template

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

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)

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

            foreach ($plugin_settings as $item) {

Method name "AppPlugin::add_course_settings_form" is not in camel caps format
Open

    public function add_course_settings_form($form)

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

    public $plugin_regions = [

Method name "AppPlugin::get_areas_by_plugin" is not in camel caps format
Open

    public function get_areas_by_plugin($pluginName)

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

                        $templatePluginFile = "$plugin_name/$pluginTemplate"; // for twig

Method name "AppPlugin::get_templates_list" is not in camel caps format
Open

    public function get_templates_list($pluginName)

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

        $plugin_info = $this->getPluginInfo($pluginName);

The 'getAllPluginContentsByRegion()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

The 'get_templates_list()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

Multi-line function call not indented correctly; expected 16 spaces but found 8
Open

        );

Expected 0 spaces before closing bracket; newline found
Open

                $form->addHtml('

Line indented incorrectly; expected at least 16 spaces, found 8
Open

        );

Multi-line function call not indented correctly; expected 20 spaces but found 12
Open

            '

Line indented incorrectly; expected at least 16 spaces, found 12
Open

            '

The variable $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $settings_filtered is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $language_interface is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $settings_filtered is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $language_interface is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $settings_filtered is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $english_path is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_name is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $english_path is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $language_interface is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $_template is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $english_path is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $_template is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_file is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_settings is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $_template is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $_template is not named in camelCase.
Open

    public function getAllPluginContentsByRegion($plugin_name, $region, $template, $forced = false)
    {
        // The plugin_info variable is available inside the plugin index
        $plugin_info = $this->getPluginInfo($plugin_name, $forced);

Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_settings is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function getPluginInfo($pluginName, $forced = false)
    {
        //$pluginData = Session::read('plugin_data');
        if (0) {
            //if (isset($pluginData[$pluginName]) && $forced == false) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_path is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_path is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $access_url_id is not named in camelCase.
Open

    public function removeAllRegions($plugin)
    {
        $access_url_id = api_get_current_access_url_id();
        if (!empty($plugin)) {
            api_delete_settings_params(
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_path is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $access_url_id is not named in camelCase.
Open

    public function removeAllRegions($plugin)
    {
        $access_url_id = api_get_current_access_url_id();
        if (!empty($plugin)) {
            api_delete_settings_params(
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 $plugin_info is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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 load_plugin_lang_variables is not named in camelCase.
Open

    public function load_plugin_lang_variables($plugin_name)
    {
        $language_interface = api_get_language_isocode();
        $root = api_get_path(SYS_PLUGIN_PATH);
        $strings = null;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method is_valid_plugin is not named in camelCase.
Open

    public function is_valid_plugin($pluginName)
    {
        if (is_dir(api_get_path(SYS_PLUGIN_PATH).$pluginName)) {
            if (is_file(api_get_path(SYS_PLUGIN_PATH).$pluginName.'/index.php')) {
                return true;
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method read_plugins_from_path is not named in camelCase.
Open

    public function read_plugins_from_path()
    {
        /* We scan the plugin directory. Each folder is a potential plugin. */
        $pluginPath = api_get_path(SYS_PLUGIN_PATH);
        $plugins = [];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method get_areas_by_plugin is not named in camelCase.
Open

    public function get_areas_by_plugin($pluginName)
    {
        $result = api_get_settings('Plugins');
        $areas = [];
        foreach ($result as $row) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method add_to_region is not named in camelCase.
Open

    public function add_to_region($plugin, $region)
    {
        api_add_setting(
            $plugin,
            $region,
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method get_installed_plugins is not named in camelCase.
Open

    public function get_installed_plugins($fromDatabase = true)
    {
        return $this->getInstalledPlugins($fromDatabase);
    }
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method add_course_settings_form is not named in camelCase.
Open

    public function add_course_settings_form($form)
    {
        $pluginList = $this->getInstalledPluginListObject();
        /** @var Plugin $obj */
        foreach ($pluginList as $obj) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method install_course_plugins is not named in camelCase.
Open

    public function install_course_plugins($courseId)
    {
        $pluginList = $this->getInstalledPluginListObject();

        if (!empty($pluginList)) {
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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

The method get_templates_list is not named in camelCase.
Open

    public function get_templates_list($pluginName)
    {
        $plugin_info = $this->getPluginInfo($pluginName);
        if (isset($plugin_info) && isset($plugin_info['templates'])) {
            return $plugin_info['templates'];
Severity: Minor
Found in public/main/inc/lib/plugin.lib.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