Showing 436 of 912 total issues
Function checkRequiredParameters
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTemplateDialog.prototype.checkRequiredParameters = function () {
const blankRequired = [],
deferred = ve.createDeferred();
this.bookletLayout.stackLayout.getItems().forEach( ( page ) => {
Function createItem
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWLanguageVariantTwoWayInspector.prototype.createItem = function ( lang, content ) {
const languageInput = new ve.ui.LanguageInputWidget( {
dialogManager: this.manager.getSurface().getDialogs(),
dirInput: 'none'
} );
Function onSaveDialogPreview
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.ArticleTarget.prototype.onSaveDialogPreview = function () {
const api = this.getContentApi();
if ( !this.saveDialog.$previewViewer.children().length ) {
this.emit( 'savePreview' );
Function teardown
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWCategoriesPage.prototype.teardown = function ( data ) {
const currentDefaultSortKeyItem = this.getDefaultSortKeyItem(),
newDefaultSortKey = this.defaultSortInput.getValue();
if ( data && data.action === 'done' ) {
Method getAllowedParams
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAllowedParams() {
return [
'page' => [
ParamValidator::PARAM_REQUIRED => true,
],
Function surfaceReady
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.ArticleTarget.prototype.surfaceReady = function () {
const accessKeyPrefix = $.fn.updateTooltipAccessKeys.getAccessKeyPrefix().replace( /-/g, '+' ),
accessKeyModifiers = new ve.ui.Trigger( accessKeyPrefix + '-' ).modifiers,
surfaceModel = this.getSurface().getModel();
Function toggleSidebar
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionDialog.prototype.toggleSidebar = function ( expandSidebar ) {
if ( this.isSidebarExpanded === expandSidebar ) {
return;
}
Function process
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWWikitextStringTransferHandler.prototype.process = function () {
const wikitext = this.item.getAsString();
// We already know how to handle wikitext magic links, no need for the API call
if ( ve.dm.MWMagicLinkNode.static.validateContent( wikitext.trim() ) ) {
Function scrollToSection
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scrollToSection( section ) {
if ( section === '0' || section === 'new' ) {
return;
}
Consider simplifying this complex logical expression. Open
Open
if (
pageCanLoadEditor &&
showWikitextWelcome &&
// At least one editor is available (T201928)
( init.isVisualAvailable || init.isWikitextAvailable || $( '#wpTextbox1' ).length ) &&
Function onWindowPopState
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.DesktopArticleTarget.prototype.onWindowPopState = function ( e ) {
if ( !this.verifyPopState( e.state ) ) {
// Ignore popstate events fired for states not created by us
// This also filters out the initial fire in Chrome (T59901).
return;
Function preparedCacheKeyPromise
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
.then( ( deflatedHtml ) => {
if ( aborted ) {
return ve.createDeferred().reject();
}
xhr = this.getContentApi().postWithToken( 'csrf',
Function parseDocument
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.Target.static.parseDocument = function ( documentString, mode, section, onlySection ) {
let doc;
if ( mode === 'source' ) {
// Parent method
doc = ve.init.mw.Target.super.static.parseDocument.call( this, documentString, mode );
Function onHighlightItem
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWGalleryDialog.prototype.onHighlightItem = function ( item ) {
// Unhighlight previous item
if ( this.highlightedItem ) {
this.highlightedItem.toggleHighlighted( false );
}
Function updateImageNode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWImageModel.prototype.updateImageNode = function ( node, surfaceModel ) {
const doc = surfaceModel.getDocument();
// Update the caption
if ( node.getType() === 'mwBlockImage' ) {
Function VeUiMWGalleryItemWidget
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWGalleryItemWidget = function VeUiMWGalleryItemWidget( imageInfo, config ) {
this.resource = imageInfo.resource;
this.altText = imageInfo.altText || '';
this.altTextSame = imageInfo.altTextSame;
this.href = imageInfo.href;
Function onCopy
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ce.MWWikitextSurface.prototype.onCopy = function ( e ) {
const clipboardData = e.originalEvent.clipboardData,
text = this.getModel().getFragment().getText( true ).replace( /\n\n/g, '\n' );
if ( !text ) {
Function VeCeMWInlineImageNode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ce.MWInlineImageNode = function VeCeMWInlineImageNode( model, config ) {
let $image;
let hasHref = false;
if ( model.getAttribute( 'isError' ) ) {
Method onCustomEditor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function onCustomEditor( $article, $user ) {
$req = $article->getContext()->getRequest();
$services = MediaWikiServices::getInstance();
$urlUtils = $services->getUrlUtils();
$veConfig = $services->getConfigFactory()->makeConfig( 'visualeditor' );
Function getSetupProcess
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWMediaDialog.prototype.getSetupProcess = function ( data ) {
return ve.ui.MWMediaDialog.super.prototype.getSetupProcess.call( this, data )
.next( () => {
const isReadOnly = this.isReadOnly();