chamilo/chamilo-lms

View on GitHub
public/main/gradebook/lib/fe/scoredisplayform.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method __construct() has an NPath complexity of 504. The configured NPath complexity threshold is 200.
Open

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The parameter $form_name is not named in camelCase.
Open

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

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

        parent::__construct($form_name, 'post', $action);

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

    public function __construct($form_name, $action = null)

Expected 6 spaces after parameter type; 1 found
Open

     * @param null $action

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

                    <img style="display: '.(($counter >= $nr_items) ? 'inline' : 'none').';" id="plus-'.($counter + 1).'" src="'.Display::returnIconPath('add.png').'" alt="'.get_lang('Add').'" title="'.get_lang('Add').'"></a>

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

        $nr_items = ('0' != count($customdisplays)) ? count($customdisplays) : '1';

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

                    <img style="display: '.(($counter >= $nr_items && 1 != $counter) ? 'inline' : 'none').';" id="min-'.$counter.'" src="'.Display::returnIconPath('delete.png').'" alt="'.get_lang('Delete').'" title="'.get_lang('Delete').'"></a>

Missing parameter name
Open

     * @param $form_name

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

                '<div id='.$counter.' style="display: '.(($counter <= $nr_items) ? 'inline' : 'none').';">    

Missing function doc comment
Open

    public function validate()

The variable $nr_items is not named in camelCase.
Open

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

    public function __construct($form_name, $action = null)
    {
        parent::__construct($form_name, 'post', $action);
        $displayscore = ScoreDisplay::instance();
        $customdisplays = $displayscore->get_custom_score_display_settings();

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

There are no issues that match your filters.

Category
Status