Showing 436 of 912 total issues
Function create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWWikitextDataTransferHandlerFactory.prototype.create = function () {
// Parent method
const handler = ve.ui.MWWikitextDataTransferHandlerFactory.super.prototype.create.apply( this, arguments ),
resolve = handler.resolve.bind( handler );
Function runDiffTest
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
runDiffTest: function ( oldHtml, newHtml, done ) {
const target = ve.init.target,
surface = target.surface;
if ( target.saveDialog ) {
Function resetCaption
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWMediaDialog.prototype.resetCaption = function () {
const doc = this.getFragment().getDocument();
// Get existing caption. We only do this in setup, because the caption
// should not reset to original if the image is replaced or edited.
Function setupHotkeyTriggers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionDialog.prototype.setupHotkeyTriggers = function () {
// Lower-case modifier and key names as specified in {@see ve.ui.Trigger}
const isMac = ve.getSystemPlatform() === 'mac',
meta = isMac ? 'meta+' : 'ctrl+';
const hotkeys = {
Function surfaceReady
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.DesktopArticleTarget.prototype.surfaceReady = function () {
if ( !this.activating ) {
// Activation was aborted before we got here. Do nothing
// TODO are there things we need to clean up?
return;
Function attachImageModel
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWMediaDialog.prototype.attachImageModel = function () {
if ( this.imageModel ) {
this.imageModel.disconnect( this );
this.sizeWidget.disconnect( this );
}
Function removePages
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTwoPaneTransclusionDialogLayout.prototype.removePages = function ( pagesNamesToRemove ) {
const pagesToRemove = [],
isCurrentParameter = this.pages[ this.currentPageName ] instanceof ve.ui.MWParameterPage;
let isCurrentPageRemoved = false,
prevSelectionCandidate, nextSelectionCandidate;
Function selectRange
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWAceEditorWidget.prototype.selectRange = function ( from, to ) {
this.focus();
this.loadingPromise.done( () => {
const doc = this.editor.getSession().getDocument(),
lines = doc.getAllLines();
Function describeChanges
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWExtensionNode.static.describeChanges = function ( attributeChanges, attributes, element ) {
const descriptions = [],
fromBody = attributeChanges.mw.from.body,
toBody = attributeChanges.mw.to.body;
Function initializeFilters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.initializeFilters = function () {
this.searchWidget = new OO.ui.SearchInputWidget( {
title: ve.msg( 'visualeditor-dialog-transclusion-filter-title', this.templateModel.getSpec().getLabel() ),
placeholder: ve.msg( 'visualeditor-dialog-transclusion-filter-placeholder' ),
classes: [ 've-ui-mwTransclusionOutlineTemplateWidget-searchWidget' ]
Function hasMatchingAncestor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWWikitextSurfaceFragment.prototype.hasMatchingAncestor = function ( type, attributes ) {
const nodes = this.getSelectedLeafNodes();
let all = !!nodes.length;
for ( let i = 0, len = nodes.length; i < len; i++ ) {
Function getCategoryWidgetFromName
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWCategoryInputWidget.prototype.getCategoryWidgetFromName = function ( name ) {
const cachedData = ve.init.platform.linkCache.getCached( mw.Title.newFromText(
name,
mw.config.get( 'wgNamespaceIds' ).category
).getPrefixedText() );
Function setTemplateData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWTemplateSpecModel.prototype.setTemplateData = function ( data ) {
if ( !data || !ve.isPlainObject( data ) ) {
return;
}
Function generateContents
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ce.MWImageNode.prototype.generateContents = function () {
const model = this.getModel(),
height = model.getAttribute( 'height' ),
mwData = model.getAttribute( 'mw' ) || {},
deferred = ve.createDeferred();
Function setupToolbar
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.DesktopArticleTarget.prototype.setupToolbar = function ( surface ) {
const mode = surface.getMode(),
wasSetup = !!this.toolbar;
ve.track( 'trace.setupToolbar.enter', { mode: mode } );
Function initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTableDialog.prototype.initialize = function () {
// Parent method
ve.ui.MWTableDialog.super.prototype.initialize.call( this );
this.wikitableToggle = new OO.ui.ToggleSwitchWidget();
Function processResult
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const processResult = ( data ) => {
const pages = ( data.query && data.query.pages ) || data.pages,
processed = {};
const mappedTitles = [];
Function maybeShowWelcomeDialog
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.DesktopArticleTarget.prototype.maybeShowWelcomeDialog = function () {
const editorMode = this.getDefaultMode(),
windowManager = this.getSurface().dialogs;
this.welcomeDialogPromise = ve.createDeferred();
Function setupToolbar
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.MobileArticleTarget.prototype.setupToolbar = function ( surface ) {
const originalToolbarGroups = this.toolbarGroups;
// We don't want any of these tools to show up in subordinate widgets, so we
// temporarily add them here. We need to do it _here_ rather than in their
Function submit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.ArticleTarget.prototype.submit = function ( wikitext, fields ) {
// Prevent duplicate requests
if ( this.submitting ) {
return false;
}