Showing 1,432 of 2,096 total issues
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute(): void {
$params = $this->extractRequestParams();
$user = $this->getUser();
$this->validateParameters( $params );
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Rebuilds item terms from primary persistence' );
Method doSearch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function doSearch( $query ) {
$limit = (int)$this->getOption( 'limit', 5 );
$results = $this->searchHelper->getRankedSearchResults(
$query,
Method handleDescriptionValidationErrors
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function handleDescriptionValidationErrors( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case DescriptionsSyntaxValidator::CODE_DESCRIPTIONS_NOT_ASSOCIATIVE:
throw UseCaseError::newInvalidValue( '/item/descriptions' );
Method handleLabelsValidationError
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function handleLabelsValidationError( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case LabelsSyntaxValidator::CODE_LABELS_NOT_ASSOCIATIVE:
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute( PatchItemDescriptionsRequest $request ): PatchItemDescriptionsResponse {
$deserializedRequest = $this->requestValidator->validateAndDeserialize( $request );
$itemId = $deserializedRequest->getItemId();
$this->assertItemExists->execute( $itemId );
Method handleSitelinksValidationErrors
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function handleSitelinksValidationErrors( ValidationError $validationError, array $serialization ): void {
$context = $validationError->getContext();
$siteId = fn() => $context[SitelinkValidator::CONTEXT_SITE_ID];
switch ( $validationError->getCode() ) {
Method makeNormalizer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function makeNormalizer( PropertyId $propertyId, string $valueType ): DataValueNormalizer {
$dataTypeNormalizers = [];
$valueTypeNormalizers = [];
try {
Method factory
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function factory( $language, $sourceLanguage = null ) {
if ( is_string( $language ) ) {
$languageCode = self::validateLanguageCode( $language );
} else {
$languageCode = $language->getCode();
Function _createEntitytermsforlanguagelistviewToggler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_createEntitytermsforlanguagelistviewToggler: function () {
this._registerTogglerForLanguagelistviewDiv( TOGGLER_OPTION_KEY );
this.$entitytermsforlanguagelistviewContainer.before(
this.$entitytermsforlanguagelistviewToggler
Function e260
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toIndexedObject = __webpack_require__("fc6a");
Method getChangeParamsForDiffOp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getChangeParamsForDiffOp( DiffOp $diffOp, $siteId, $messagePrefix ) {
$params = [];
if ( $diffOp instanceof DiffOpAdd ) {
$params['message'] = $messagePrefix . 'add';
Method showForm
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function showForm() {
$dataTypeSelect = new DataTypeSelector(
$this->dataTypeFactory->getTypes(),
$this->getLanguage()->getCode()
);
Method getChangeOp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getChangeOp( array $preparedParameters, EntityDocument $entity ): ChangeOp {
if ( $this->shouldRemove( $preparedParameters ) ) {
$linksite = $this->stringNormalizer->trimToNFC( $preparedParameters['linksite'] );
return $this->siteLinkChangeOpFactory->newRemoveSiteLinkOp( $linksite );
} else {
Method modifyEntity
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function modifyEntity( EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters ): Summary {
if ( !( $entity instanceof Item ) ) {
$this->errorReporter->dieError( "The given entity is not an item", "not-item" );
}
Method getSecondaryDataUpdates
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSecondaryDataUpdates(
Title $title,
Content $content,
$role,
SlotRenderingProvider $slotOutput
Method getRegexpsFromMessageText
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getRegexpsFromMessageText( string $msgText ): array {
static $pluralRegex = null;
if ( $pluralRegex === null ) {
// We need to match on a preg_quoted string here, so double quote
$pluralRegex = '@' . preg_quote( preg_quote( '{{PLURAL:$1|' ) ) .
Method getTimeParsers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getTimeParsers() {
global $wgDefaultUserOptions;
$eraParser = new MwEraParser( $this->options );
$isoTimestampParser = new IsoTimestampParser(
Method handleLabelsValidationError
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function handleLabelsValidationError( ValidationError $validationError ): void {
$context = $validationError->getContext();
switch ( $validationError->getCode() ) {
case LabelsSyntaxValidator::CODE_LABELS_NOT_ASSOCIATIVE:
Method formatSnak
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function formatSnak( Snak $snak ) {
$warningText = '';
try {
return $this->snakFormatter->formatSnak( $snak );
} catch ( MismatchingDataValueTypeException $ex ) {