chamilo/chamilo-lms

View on GitHub
public/main/survey/ch_personality.php

Summary

Maintainability
A
0 mins
Test Coverage

The method createForm() has an NPath complexity of 486. The configured NPath complexity threshold is 200.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.php by phpmd

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

Missing class import via use statement (line '104', column '25').
Open

        $question = new ch_yesno();
Severity: Minor
Found in public/main/survey/ch_personality.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

The class ch_personality is not named in CamelCase.
Open

class ch_personality extends survey_question
{
    /**
     * This function creates the form elements for the multiple response questions.
     *
Severity: Minor
Found in public/main/survey/ch_personality.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

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

                $question_values[] = '<input size="3" type="text" id="values['.$key.']" name="values['.$key.']" value="'.$value.'" />';

Doc comment for parameter $answers does not match actual variable name $questionData
Open

     * @param array $answers

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

                if ($total_number_of_answers > 2) {

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

        $total_number_of_answers = count($formData['answers']);

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

                if ($total_number_of_answers > 2) {

Doc comment for parameter $questionData does not match actual variable name $form
Open

     * @param array $questionData

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

        $question_values = [];

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

                    $this->html .= $question_values[$count];

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

                if ($key < $total_number_of_answers - 1) {

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

class ch_personality extends survey_question

The variable $total_number_of_answers is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $question_values is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $total_number_of_answers is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $total_number_of_answers is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $question_values is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $question_values is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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 $total_number_of_answers is not named in camelCase.
Open

    public function createForm($surveyData, $formData)
    {
        parent::createForm($surveyData, $formData);
        $this->html .= '    <tr>';
        $this->html .= '        <td colspan="2"><strong>'.get_lang('Display').'</strong></td>';
Severity: Minor
Found in public/main/survey/ch_personality.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

There are no issues that match your filters.

Category
Status