Showing 1,432 of 2,096 total issues
Method splitNamespaceAndSlot
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function splitNamespaceAndSlot( $namespaceAndSlot ) {
if ( is_int( $namespaceAndSlot ) ) {
return [ $namespaceAndSlot, SlotRecord::MAIN ];
}
Method assertConstructFieldsAreCorrect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function assertConstructFieldsAreCorrect( array $fields ) {
Assert::parameter(
count( $fields ) === count( self::FIELD_NAMES ) &&
!array_diff( self::FIELD_NAMES, array_keys( $fields ) ),
'$fields',
Function mwApiRejectionToError
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private mwApiRejectionToError( code: string, arg2: unknown, _arg3: unknown, _arg4: unknown ): never {
switch ( code ) {
case 'http': { // jQuery AJAX failure
const detail = arg2 as {
xhr: jqXHR;
Function dispatch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public dispatch( selectedElement: SelectedElement ): void {
const dialog = prepareContainer( this.mwWindow.OO, this.mwWindow.$, Dispatcher.APP_DOM_CONTAINER_ID );
const emitter = this.app.launch(
( this.vue as MwVueConstructor ).createMwApp,
Function _onSuccess
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_onSuccess: function () {
var mwApi = new mw.Api(),
itemUri = this._linkRepoTitle(
'Special:ItemByTitle/' + this.options.globalSiteId + '/' + this.options.pageTitle
);
Function _createReferencesListview
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createReferencesListview: function ( references ) {
var self = this;
var $listview = this.$references.children( '.wikibase-listview' );
if ( !$listview.length ) {
Function _initMenu
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initMenu: function ( ooMenu ) {
var self = this;
$.ui.suggester.prototype._initMenu.apply( this, arguments );
Function _initMenu
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_initMenu: function ( ooMenu ) {
var self = this;
$.ui.suggester.prototype._initMenu.apply( this, arguments );
Function _createStatementlistview
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createStatementlistview: function () {
var self = this,
prefix;
var $statementlistview = this.element.find( '.wikibase-statementlistview' );
Method getBadges
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getBadges( string $prefixedItemId, ?string $globalSiteId ): array {
$globalSiteId = $globalSiteId ?: $this->siteId;
try {
$itemId = new ItemId( $prefixedItemId );
Method getCentralDescriptions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getCentralDescriptions( array $titlesByPageId ) {
if ( !$titlesByPageId ) {
return [];
}
Method newEntityRevisionLookup
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function newEntityRevisionLookup() {
// Maintain a list of watchers to be notified of changes to any entities,
// in order to update caches.
/** @var WikiPageEntityStore $dispatcher */
$dispatcher = $this->getEntityStoreWatcher();
Method getUsagesForPage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getUsagesForPage( int $pageId ): array {
$usages = $this->usageLookup->getUsagesForPage( $pageId );
$title = $this->titleFactory->newFromID( $pageId );
if ( !$title ) {
return $usages;
Method displayUndoDiff
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function displayUndoDiff( EntityContentDiff $diff ): void {
$tableClass = 'diff diff-contentalign-' . $this->getTitle()->getPageLanguage()->alignStart();
// add Wikibase styles, the diff may include entity links with labels, including fallback indicators
$this->getOutput()->addModuleStyles( [ 'wikibase.alltargets' ] );
Method getApiFormatReferenceSpec
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getApiFormatReferenceSpec( array $clientSettings ): ?array {
// This API module is (for now) only enabled conditionally
if ( !( $clientSettings['dataBridgeEnabled'] ?? false ) ) {
return null;
}
Method outputForm
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function outputForm( array $sites, $itemString ) {
$formDescriptor = [
'site' => [
'name' => 'site',
'default' => implode( ',', $sites ),
Method parseStringValue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function parseStringValue( ValueParser $parser, string $value, ?ValueValidator $validator ): array {
$result = [
'raw' => $value,
];
Method getAllowedParams
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAllowedParams(): array {
return array_merge(
[
'claim' => [
ParamValidator::PARAM_TYPE => 'text',
Method buildTermSearchMatchDisplayEntry
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function buildTermSearchMatchDisplayEntry( TermSearchResult $match, array $entry ): array {
$entry['display'] = [];
ApiResult::setArrayType( $entry['display'], 'assoc' );
$displayLabel = $match->getDisplayLabel();
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute(): void {
$params = $this->extractRequestParams();
$this->validateParameters( $params );
$guid = $params['statement'];