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>';
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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.
*
- Read upRead up
- Exclude checks
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.'" />';
- Exclude checks
Doc comment for parameter $answers does not match actual variable name $questionData Open
* @param array $answers
- Exclude checks
Variable "total_number_of_answers" is not in valid camel caps format Open
if ($total_number_of_answers > 2) {
- Exclude checks
Variable "total_number_of_answers" is not in valid camel caps format Open
$total_number_of_answers = count($formData['answers']);
- Exclude checks
Variable "total_number_of_answers" is not in valid camel caps format Open
if ($total_number_of_answers > 2) {
- Exclude checks
Doc comment for parameter $questionData does not match actual variable name $form Open
* @param array $questionData
- Exclude checks
Variable "question_values" is not in valid camel caps format Open
$question_values = [];
- Exclude checks
Variable "question_values" is not in valid camel caps format Open
$this->html .= $question_values[$count];
- Exclude checks
Variable "total_number_of_answers" is not in valid camel caps format Open
if ($key < $total_number_of_answers - 1) {
- Exclude checks
Class name "ch_personality" is not in camel caps format Open
class ch_personality extends survey_question
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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>';
- Read upRead up
- Exclude checks
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();
}
}