Missing class import via use statement (line '95', column '34'). Open
$this->stemmer = new XapianStem($lang);
- 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
Missing class import via use statement (line '136', column '32'). Open
$doc = new XapianDocument();
- 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
Missing class import via use statement (line '89', column '29'). Open
$this->db = new XapianWritableDatabase($path, $dbMode);
- 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
Missing class import via use statement (line '90', column '34'). Open
$this->indexer = new XapianTermGenerator();
- 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
Avoid unused local variables such as '$key'. Open
foreach ($chunk->data as $key => $value) {
- 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
FIXME found Open
/* FIXME: think of getting weight */
- Exclude checks
Method name "XapianIndexer::xapian_languages" is not in camel caps format Open
final public function xapian_languages()
- Exclude checks
Method name "XapianIndexer::replace_document" is not in camel caps format Open
public function replace_document($doc, $did)
- Exclude checks
Variable "doc_data" is not in valid camel caps format Open
return $doc_data;
- Exclude checks
Missing parameter name Open
* @param string Chunk of text
- Exclude checks
Variable "doc_data" is not in valid camel caps format Open
$doc_data = $doc->get_data();
- Exclude checks
Method name "XapianIndexer::add_term_to_doc" is not in camel caps format Open
public function add_term_to_doc($term, $doc)
- Exclude checks
Method name "XapianIndexer::get_document_data" is not in camel caps format Open
public function get_document_data($doc)
- Exclude checks
Method name "XapianIndexer::remove_term_from_doc" is not in camel caps format Open
public function remove_term_from_doc($term, $doc)
- Exclude checks
Method name "XapianIndexer::remove_document" is not in camel caps format Open
public function remove_document($did)
- Exclude checks
Variable "xapian_data" is not in valid camel caps format Open
$doc->set_data($chunk->xapian_data, 1);
- Exclude checks
Method name "XapianIndexer::update_terms" is not in camel caps format Open
public function update_terms($did, $terms, $prefix)
- Exclude checks
Abstract class name is not prefixed with "Abstract" Open
abstract class XapianIndexer
- Exclude checks
Missing parameter name Open
* @param int did Xapian::docid
- Exclude checks
Missing parameter name Open
* @param int did Xapian::docid
- Exclude checks
Method name "XapianIndexer::get_document" is not in camel caps format Open
public function get_document($did)
- Exclude checks
The variable $doc_data is not named in camelCase. Open
public function get_document_data($doc)
{
if (null == $this->db) {
$this->connectDb();
}
- 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 $doc_data is not named in camelCase. Open
public function get_document_data($doc)
{
if (null == $this->db) {
$this->connectDb();
}
- 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 method xapian_languages is not named in camelCase. Open
final public function xapian_languages()
{
/* http://xapian.org/docs/apidoc/html/classXapian_1_1Stem.html */
return [
'none' => 'none', //don't stem terms
- Read upRead up
- Exclude checks
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 remove_document is not named in camelCase. Open
public function remove_document($did)
{
if (null == $this->db) {
$this->connectDb();
}
- Read upRead up
- Exclude checks
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_document is not named in camelCase. Open
public function get_document($did)
{
if (null == $this->db) {
$this->connectDb();
}
- Read upRead up
- Exclude checks
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_document_data is not named in camelCase. Open
public function get_document_data($doc)
{
if (null == $this->db) {
$this->connectDb();
}
- Read upRead up
- Exclude checks
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_term_to_doc is not named in camelCase. Open
public function add_term_to_doc($term, $doc)
{
if (!is_a($doc, 'XapianDocument')) {
return false;
}
- Read upRead up
- Exclude checks
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 update_terms is not named in camelCase. Open
public function update_terms($did, $terms, $prefix)
{
$doc = $this->get_document($did);
if (false === $doc) {
return false;
- Read upRead up
- Exclude checks
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 remove_term_from_doc is not named in camelCase. Open
public function remove_term_from_doc($term, $doc)
{
if (!is_a($doc, 'XapianDocument')) {
return false;
}
- Read upRead up
- Exclude checks
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 replace_document is not named in camelCase. Open
public function replace_document($doc, $did)
{
if (!is_a($doc, 'XapianDocument')) {
return false;
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}