Showing 994 of 1,238 total issues
Method getCommonFormFields
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getCommonFormFields(): array {
$dropdownOptions = $this->msg( 'deletereason-dropdown' )->inContentLanguage()->text();
$options = Xml::listDropdownOptions(
$dropdownOptions,
Method getQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getQuery( string $text, string $sourceLanguage, string $targetLanguage ): TranslationQuery {
if ( !isset( $this->config['key'] ) ) {
throw new TranslationWebServiceConfigurationException( 'key is not set' );
}
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute( $par ) {
$this->setHeaders();
$this->outputHeader();
$out = $this->getOutput();
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute(): void {
$days = (int)$this->getOption( 'days' ) ?: 7;
$top = (int)$this->getOption( 'top' ) ?: 10;
$bots = $this->hasOption( 'bots' );
Method findMessage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function findMessage( $language, $key, $possibleStates = [], &$modificationType = null ) {
$allChanges = [];
$allChanges[self::ADDITION] = $this->getAdditions( $language );
$allChanges[self::DELETION] = $this->getDeletions( $language );
$allChanges[self::CHANGE] = $this->getChanges( $language );
Method changeState
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function changeState( MessageGroup $group, string $code, string $newState, User $user ): bool {
$currentState = $this->getState( $group, $code );
if ( $currentState === $newState ) {
return false;
}
Method getAllowedParams
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getAllowedParams() {
return [
'count' => [
ParamValidator::PARAM_TYPE => $this->dataProvider->getGraphTypes(),
ParamValidator::PARAM_REQUIRED => true,
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Fuzzy bot command line script.' );
$this->addArg(
'arg',
Method markPageForTranslation
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function markPageForTranslation(
Title $bundleTitle,
TranslatablePageSettings $translatablePageSettings,
UserIdentity $importUser
): void {
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
$params = $this->extractRequestParams();
$groupId = $params['groupId'];
$msgKey = $params['messageKey'];
$name = $params['changesetName'] ?? MessageChangeStorage::DEFAULT_NAME;
Method readFromVariable
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function readFromVariable( string $data ): array {
$reader = new SimpleXMLElement( $data );
$messages = [];
$mangler = $this->group->getMangler();
Method getTranslationUnitPagesByTitle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getTranslationUnitPagesByTitle( PageReference $title, ?string $code = null ): array {
$mwServices = MediaWikiServices::getInstance();
$dbw = $mwServices->getDBLoadBalancer()->getConnection( DB_PRIMARY );
$base = $mwServices->getTitleFormatter()->getPrefixedDBkey( $title );
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
LanguageFactory $languageFactory,
LinkBatchFactory $linkBatchFactory,
JobQueueGroup $jobQueueGroup,
PermissionManager $permissionManager,
TranslatablePageMarker $translatablePageMarker,
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ApiMain $mainModule,
string $moduleName,
UserFactory $userFactory,
UserNameUtils $userNameUtils,
UserOptionsManager $userOptionsManager,
Function updateElement
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateElement: function(point, index, reset) {
var me = this;
var meta = me.getMeta();
var custom = point.custom || {};
var xScale = me.getScaleForId(meta.xAxisID);
Function addInsertables
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addInsertables: function ( insertables ) {
var count = insertables.length,
$sourceMessage = this.$editor.find( '.sourcemessage' ),
$buttonArea = this.$editor.find( '.tux-editor-insert-buttons' ),
$textarea = this.$editor.find( '.tux-textarea-translation' );
Function helper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function helper( list, maxRetries ) {
var deferred = $.Deferred();
if ( list.length === 0 ) {
deferred.resolve( [] );
Function initialize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mw.translate.MessageRenameDialog.prototype.initialize = function () {
mw.translate.MessageRenameDialog.super.prototype.initialize.call( this );
this.messageSearch = new OO.ui.TextInputWidget( {
placeholder: mw.msg( 'translate-smg-rename-search' )
Function createNewUnit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createNewUnit( sourceText, targetText ) {
var $newUnit = $( '<div>' ).addClass( 'mw-tpm-sp-unit row' );
var $sourceUnit = $( '<textarea>' ).addClass( 'mw-tpm-sp-unit__source five columns' )
.prop( 'readonly', true ).attr( 'tabindex', '-1' ).val( sourceText );
var $target = $( '<div>' ).addClass( 'five columns' );
Function updateDescription
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateDescription( group ) {
var
api = new mw.Api(),
$description = $( '.tux-editor-header .description' );