Showing 691 of 718 total issues
Method processResultSet
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processResultSet( CirrusSearchResultSet $value, $query ) {
// these are prefix or full text results
$rows = [];
foreach ( $value as $result ) {
/** @var CirrusSearch\Search\CirrusSearchResult $result */
Method getRequests
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getRequests() {
if ( !$this->request || !$this->response ) {
// we don't actually know at this point how many searches there were,
// or how many results to return...so just bail and return nothing
return [];
Method updateLinkedArticles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function updateLinkedArticles( $titles ): void {
$pages = [];
$wikiPageFactory = MediaWikiServices::getInstance()->getWikiPageFactory();
foreach ( $titles as $title ) {
// Special pages don't get updated, we only index
Method makeRemoteReindexInfo
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function makeRemoteReindexInfo( Connection $source, Connection $dest ) {
if ( $source->getClusterName() === $dest->getClusterName() ) {
return null;
}
Method handleSearchGetNearMatch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function handleSearchGetNearMatch( $term, &$titleResult ) {
global $wgSearchType;
if ( $wgSearchType !== 'CirrusSearch' ) {
return true;
}
Method initializeForRequest
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function initializeForRequest( WebRequest $request ) {
global $wgCirrusSearchPhraseRescoreWindowSize,
$wgCirrusSearchFunctionRescoreWindowSize,
$wgCirrusSearchFragmentSize,
$wgCirrusSearchPhraseRescoreBoost,
Method fix
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fix( $replacement ) {
Assert::precondition( $this->visited, "getFixablePart must be called before trying to fix the query" );
if ( $this->node === null ) {
return null;
}
Method decidePage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function decidePage( Updater $updater, WikiPage $page ) {
try {
$content = $page->getContent();
} catch ( Throwable $ex ) {
LoggerFactory::getInstance( 'CirrusSearch' )->warning(
Method buildChunks
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function buildChunks( $buildChunks ) {
$dbr = $this->getDB( DB_REPLICA, [ 'vslow' ] );
if ( $this->toId === null ) {
$this->toId = $dbr->newSelectQueryBuilder()
->select( 'MAX(page_id)' )
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
SearchConfig $config,
Connection $connection,
Remediator $remediator,
Searcher $searcher,
StatsFactory $statsFactory,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct( Connection $conn, $limit, $offset = 0, SearchConfig $config = null, array $namespaces = null,
User $user = null, $index = false, $profileName = null,
CirrusDebugOptions $debugOptions = null ) {
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Client $client,
$aliasName,
$specificIndexName,
$startOver,
Reindexer $reindexer,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$startOffset,
$endOffset,
KeywordFeature $keyword,
$key,
$value,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Connection $connection,
SearchConfig $config,
array $namespaces = null,
User $user = null,
CirrusDebugOptions $debugOptions = null,
Method getStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getStatus() {
if ( $this->response ) {
// task complete
return $this->response;
}
Method loadDocuments
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function loadDocuments( PageIdentity $title, $sourceFiltering = true ) {
[ $docId, $hasRedirects ] = $this->determineCirrusDocId( $title );
if ( $docId === null ) {
return [];
}
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function __construct( $repoType, $repoName, SearchConfig $config, callable $arrayLoader ) {
$this->wrapped = ArrayProfileRepository::lazyLoaded( $repoType, $repoName, static function () use ( $arrayLoader, $config ) {
$profiles = [];
$allowedFields = [ 'suggest' => true, 'suggest-stop' => true ];
Method bulkResponseExceptionIsJustDocumentMissing
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function bulkResponseExceptionIsJustDocumentMissing(
ResponseException $exception, $logCallback = null
) {
$justDocumentMissing = true;
foreach ( $exception->getResponseSet()->getBulkResponses() as $bulkResponse ) {
Method upgradeIndexVersion
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function upgradeIndexVersion() {
$pluginsStatus = $this->configUtils->scanAvailableModules();
if ( !$pluginsStatus->isGood() ) {
throw new \RuntimeException( (string)$pluginsStatus );
}
Method buildDocument
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function buildDocument( Connection $connection, $baseName, $typeName ) {
global $IP;
if ( $typeName == Connection::TITLE_SUGGEST_INDEX_SUFFIX ) {
[ $aMaj, $aMin ] = explode( '.', SuggesterAnalysisConfigBuilder::VERSION, 3 );
[ $mMaj, $mMin ] = explode( '.', SuggesterMappingConfigBuilder::VERSION, 3 );