Showing 2,096 of 2,096 total issues
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'];
Method getItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getItem(): ?Item {
$params = $this->getParams();
$itemId = new ItemId( $params['entityId'] );
try {
$entity = $this->entityLookup->getEntity( $itemId );
Method onBeforePageDisplay
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
$entityNamespaceLookup = WikibaseRepo::getEntityNamespaceLookup();
$namespace = $out->getTitle()->getNamespace();
$isEntityTitle = $entityNamespaceLookup->isNamespaceWithEntities( $namespace );
$settings = WikibaseRepo::getSettings();
Method validateEntity
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validateEntity( EntityDocument $entity ) {
$entityId = $entity->getId()->getSerialization();
$entityType = $entity->getType();
if ( $entity instanceof LabelsProvider ) {
Method getFlavor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getFlavor( ?string $flavorName ): int {
switch ( $flavorName ) {
case 'simple':
return RdfProducer::PRODUCE_TRUTHY_STATEMENTS
| RdfProducer::PRODUCE_SITELINKS
Method validate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate( EntityDocument $entity ) {
if ( !( $entity instanceof DescriptionsProvider ) ) {
throw new InvalidArgumentException( '$entity must be a DescriptionsProvider' );
}
Method factory
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function factory(
Language $contentLanguage,
HttpRequestFactory $httpRequestFactory,
IBufferingStatsdDataFactory $statsdDataFactory,
UserOptionsLookup $userOptionsLookup,
Method formatArg
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function formatArg( $arg ) {
try {
if ( $arg instanceof Snak ) {
return $this->snakFormatter->formatSnak( $arg );
} elseif ( $arg instanceof EntityId ) {
Method validateBadgeSerialization
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validateBadgeSerialization( array $serialization ) {
foreach ( $serialization as $badgeSerialization ) {
if ( !is_string( $badgeSerialization ) ) {
throw new ChangeOpDeserializationException(
'Badges: a string was expected, but not found',
Method getValueBuilder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getValueBuilder( $dataTypeId, $dataValueType ) {
if ( $dataTypeId !== null ) {
if ( isset( $this->valueBuilders["PT:$dataTypeId"] ) ) {
return $this->valueBuilders["PT:$dataTypeId"];
}
Method validate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function validate( EntityDocument $entity ) {
if ( !( $entity instanceof LabelsProvider ) ) {
throw new InvalidArgumentException( '$entity must be a LabelsProvider' );
}
Method addEntityPageProps
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addEntityPageProps( EntityDocument $entity ): void {
if ( !$this->shouldProduce( RdfProducer::PRODUCE_PAGE_PROPS ) ) {
return;
}
$pagePropertyDefs = $this->getPagePropertyDefs();
Method __construct
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Rebuilds entity quantity unit values' );
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute( PatchPropertyAliasesRequest $request ): PatchPropertyAliasesResponse {
$deserializedRequest = $this->validator->validateAndDeserialize( $request );
$editMetadata = $deserializedRequest->getEditMetadata();
$this->assertPropertyExists->execute( $deserializedRequest->getPropertyId() );