Showing 436 of 912 total issues
Function setup
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWAdvancedSettingsPage.prototype.setup = function ( fragment, config ) {
this.fragment = fragment;
// Indexing items
const indexingField = this.indexing.getField();
Function getImportRules
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWGalleryDialog.static.getImportRules = function () {
const rules = ve.copy( ve.init.target.constructor.static.importRules );
return ve.extendObject(
rules,
{
Function getImageLinearData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getImageLinearData( galleryItem ) {
const size = scaleImage(
parseInt( galleryItem.height ),
parseInt( galleryItem.width ),
parseInt( mwData.attrs.heights || this.defaults.imageHeight ),
Function afterPasteInsertExternalData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ce.MWWikitextSurface.prototype.afterPasteInsertExternalData = function ( targetFragment, pastedDocumentModel, contextRange ) {
const wasSpecial = this.pasteSpecial,
// TODO: This check returns true if the paste contains meaningful structure (tables, lists etc.)
// but no annotations (bold, links etc.).
wasPlain = wasSpecial || pastedDocumentModel.data.isPlainText( contextRange, true, undefined, true );
Function getImportRules
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWMediaDialog.static.getImportRules = function () {
const rules = ve.copy( ve.init.target.constructor.static.importRules );
return ve.extendObject(
rules,
{
Function loadFail
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.DesktopArticleTarget.prototype.loadFail = function ( code, errorDetails ) {
// Parent method
ve.init.mw.DesktopArticleTarget.super.prototype.loadFail.apply( this, arguments );
if ( this.wikitextFallbackLoading ) {
Function tryWithPreparedCacheKey
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.ArticleTarget.prototype.tryWithPreparedCacheKey = function ( doc, extraData, eventName ) {
if ( this.getSurface().getMode() === 'source' ) {
const data = ve.copy( extraData );
// TODO: This should happen in #getSaveOptions, check if moving it there breaks anything
Function onSelect
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWFeedbackDialogTool.prototype.onSelect = function () {
this.setActive( false );
if ( !this.feedbackPromise ) {
this.feedbackPromise = mw.loader.using( 'mediawiki.feedback' ).then( () => {
Function getTeardownProcess
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWLinkAnnotationInspector.prototype.getTeardownProcess = function ( data ) {
let fragment;
return ve.ui.MWLinkAnnotationInspector.super.prototype.getTeardownProcess.call( this, data )
.first( () => {
// Save the original fragment for later.
Function initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionDialog.prototype.initialize = function () {
// Parent method
ve.ui.MWTransclusionDialog.super.prototype.initialize.call( this );
this.setupHotkeyTriggers();
Function VeUiMWTemplatesUsedPage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTemplatesUsedPage = function VeUiMWTemplatesUsedPage() {
const target = ve.init.target;
// Parent constructor
ve.ui.MWTemplatesUsedPage.super.apply( this, arguments );
Function parseWikitextFragment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.init.mw.Target.prototype.parseWikitextFragment = function ( wikitext, pst, doc ) {
let abortable, aborted;
const abortedPromise = ve.createDeferred().reject( 'http',
{ textStatus: 'abort', exception: 'abort' } ).promise();
Function runTests
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runTests( lang ) {
const runLang = runScreenshotTest.bind( this, lang );
test.describe( 'Screenshots: ' + lang, function () {
Function setup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWSettingsPage.prototype.setup = function ( fragment, config ) {
this.fragment = fragment;
// Table of Contents items
const tableOfContentsField = this.tableOfContents.getField();
Function getSummaries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWEditSummaryWidget.prototype.getSummaries = function () {
const splitSummary = this.constructor.static.splitSummary.bind( this.constructor.static );
if ( !this.getSummariesPromise ) {
if ( mw.user.isAnon() ) {
this.getSummariesPromise = ve.createDeferred().resolve( [] ).promise();
Function VeUiMWTransclusionOutlineTemplateWidget
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionOutlineTemplateWidget = function VeUiMWTransclusionOutlineTemplateWidget( template, replacesPlaceholder ) {
const spec = template.getSpec();
// Parent constructor
ve.ui.MWTransclusionOutlineTemplateWidget.super.call( this, template, {
Function getLookupCacheDataFromResponse
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWCategoryInputWidget.prototype.getLookupCacheDataFromResponse = function ( data ) {
const result = [],
linkCacheUpdate = {},
query = data.query || {};
Function addPartWidget
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWTransclusionOutlineWidget.prototype.addPartWidget = function ( part, newPosition, removed ) {
const keys = Object.keys( this.partWidgets ),
onlyPart = keys.length === 1 && this.partWidgets[ keys[ 0 ] ];
if ( onlyPart instanceof ve.ui.MWTransclusionOutlineTemplateWidget ) {
// To recalculate the height of the sticky header when we enter multi-part mode
Function wrapText
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.dm.MWWikitextSurfaceFragment.prototype.wrapText = function ( before, after, placeholder, forceWrap ) {
placeholder = OO.ui.resolveMsg( placeholder );
function unwrap( fragment ) {
const text = fragment.getText();
Function setupEditor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
let basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
if ( basePath.slice( 0, 2 ) === '//' ) {
// ACE uses web workers, which have importScripts, which don't like relative links.