Avoid unused local variables such as '$count'. Open
list($count, $results) = xapian_query($query_string, null, $offset, $length, $extra);
- Read upRead up
- Exclude checks
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 '$key'. Open
foreach ($results as $key => $row) {
- Read upRead up
- Exclude checks
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 $query_string is not named in camelCase. Open
function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = null)
{
list($count, $results) = xapian_query($query_string, null, $offset, $length, $extra);
return chamilo_preprocess_results($results);
- Read upRead up
- Exclude checks
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 $query_string is not named in camelCase. Open
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = null)
{
return xapian_query($query_string, null, $offset, $length, $extra);
}
- Read upRead up
- Exclude checks
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 "tool_processor_path" is not in valid camel caps format Open
if (file_exists($tool_processor_path)) {
- Exclude checks
Variable "processed_results" is not in valid camel caps format Open
return [count($processed_results), $processed_results];
- Exclude checks
Variable "results_by_tool" is not in valid camel caps format Open
$results_by_tool[$row['toolid']][] = $row;
- Exclude checks
Variable "tool_processor_path" is not in valid camel caps format Open
require_once $tool_processor_path;
- Exclude checks
Expected 51 spaces after parameter type; 4 found Open
* @param int $offset Offset to the first item to retrieve. Optional
- Exclude checks
Consider putting global function "chamilo_preprocess_results" in a static class Open
function chamilo_preprocess_results($results)
- Exclude checks
Variable "tool_processor" is not in valid camel caps format Open
$tool_processor = new $tool_processor_class($rows);
- Exclude checks
Variable "processed_results" is not in valid camel caps format Open
$processed_results = array_merge($tool_processor->process(), $processed_results);
- Exclude checks
Variable "tool_processor" is not in valid camel caps format Open
$processed_results = array_merge($tool_processor->process(), $processed_results);
- Exclude checks
Variable "query_string" is not in valid camel caps format Open
list($count, $results) = xapian_query($query_string, null, $offset, $length, $extra);
- Exclude checks
Expected 48 spaces after parameter type; 1 found Open
* @param string $query_string The search string
- Exclude checks
Consider putting global function "chamilo_query_query" in a static class Open
function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = null)
- Exclude checks
Consider putting global function "chamilo_query_simple_query" in a static class Open
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = null)
- Exclude checks
Variable "results_by_tool" is not in valid camel caps format Open
$results_by_tool = [];
- Exclude checks
Variable "tool_processor_path" is not in valid camel caps format Open
$tool_processor_path = api_get_path(LIBRARY_PATH).'search/tool_processors/'.$tool_processor_class.'.class.php';
- Exclude checks
Variable "processed_results" is not in valid camel caps format Open
$processed_results = array_merge($tool_processor->process(), $processed_results);
- Exclude checks
Missing parameter name Open
* @param array extra Extra queries to join with. Optional
- Exclude checks
Variable "query_string" is not in valid camel caps format Open
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = null)
- Exclude checks
Variable "results_by_tool" is not in valid camel caps format Open
foreach ($results_by_tool as $toolid => $rows) {
- Exclude checks
Variable "processed_results" is not in valid camel caps format Open
$processed_results = [];
- Exclude checks
Variable "processed_results" is not in valid camel caps format Open
return [count($processed_results), $processed_results];
- Exclude checks
Missing function doc comment Open
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = null)
- Exclude checks
Variable "query_string" is not in valid camel caps format Open
return xapian_query($query_string, null, $offset, $length, $extra);
- Exclude checks
Variable "tool_processor_class" is not in valid camel caps format Open
$tool_processor_class = $toolid.'_processor';
- Exclude checks
Variable "tool_processor_class" is not in valid camel caps format Open
$tool_processor_path = api_get_path(LIBRARY_PATH).'search/tool_processors/'.$tool_processor_class.'.class.php';
- Exclude checks
Missing parameter name Open
* @param int length Number of items to retrieve. Optional
- Exclude checks
Consider putting global function "chamilo_get_boolean_query" in a static class Open
function chamilo_get_boolean_query($term)
- Exclude checks
Variable "tool_processor_class" is not in valid camel caps format Open
$tool_processor = new $tool_processor_class($rows);
- Exclude checks
Variable "query_string" is not in valid camel caps format Open
function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = null)
- Exclude checks
Consider putting global function "chamilo_join_queries" in a static class Open
function chamilo_join_queries($query1, $query2 = null, $op = 'or')
- Exclude checks
The variable $processed_results is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $results_by_tool is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $query_string is not named in camelCase. Open
function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = null)
{
list($count, $results) = xapian_query($query_string, null, $offset, $length, $extra);
return chamilo_preprocess_results($results);
- 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 $tool_processor_class is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor_path is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $processed_results is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $processed_results is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor_path is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $processed_results is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $processed_results is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $results_by_tool is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor_class is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor_path is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $results_by_tool is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $tool_processor_class is not named in camelCase. Open
function chamilo_preprocess_results($results)
{
// group by toolid
$results_by_tool = [];
if (count($results) > 0) {
- 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 $query_string is not named in camelCase. Open
function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = null)
{
return xapian_query($query_string, null, $offset, $length, $extra);
}
- 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();
}
}