Showing 42 of 80 total issues
File mmv.js
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This file is part of the MediaWiki extension MultimediaViewer.
*
* MultimediaViewer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
File mmv.ui.metadataPanel.js
has 517 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This file is part of the MediaWiki extension MultimediaViewer.
*
* MultimediaViewer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
File mmv.bootstrap.js
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This file is part of the MediaWiki extension MultimediaViewer.
*
* MultimediaViewer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Function newFromImageInfo
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static newFromImageInfo( title, imageInfo ) {
let name;
let uploadDateTime;
let anonymizedUploadDateTime;
let creationDateTime;
Function loadImage
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadImage( image, initialImage ) {
const $initialImage = $( initialImage );
const extraStatsDeferred = $.Deferred();
const pluginsPromise = this.loadExtensionPlugins( image.filePageTitle.getExtension().toLowerCase() );
Function createAttributionButton
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createAttributionButton( $container ) {
const attributionInput = new mw.widgets.CopyTextLayout( {
align: 'top',
button: {
label: '',
File mmv.lightboxinterface.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* This file is part of the MediaWiki extension MultimediaViewer.
*
* MultimediaViewer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Function attach
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attach( parentId ) {
// Advanced description needs to be below the fold when the lightbox opens
// regardless of what the scroll value was prior to opening the lightbox
// If the lightbox is already attached, it means we're doing prev/next, and
// we should avoid scrolling the panel
Function exports
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function ( grunt ) {
const conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
Function constructor
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor( $container, $closeButton, $fullscreenButton ) {
super( $container );
this.$close = $closeButton;
this.$fullscreen = $fullscreenButton;
Function processFilePageThumb
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processFilePageThumb( $thumb, title ) {
const link = $thumb.closest( 'a' ).prop( 'href' );
// remove the buttons (and the clearing element) if they are already there
// this should not happen (at least until we support paged media) but just in case
Function setLocationData
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setLocationData( imageData ) {
if ( !imageData.hasCoords() ) {
return;
}
Function loadViewer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
loadViewer( setupOverlay ) {
const deferred = $.Deferred();
let viewer;
let message;
Function attach
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attach() {
this.scroller.attach();
this.buttons.attach();
this.title.attach();
this.creditField.attach();
Function constructor
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
const $wrapper = $( '<div>' )
.addClass( 'mw-mmv-wrapper' );
super( $wrapper );
this.$wrapper = $wrapper;
Function initTabs
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initTabs() {
const makeTab = ( type ) => new OO.ui.MenuOptionWidget( {
data: type,
// The following messages are used here:
// * multimediaviewer-embed-tab
Function showError
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
showError( error ) {
const canvasDimensions = this.getDimensions();
const thumbnailDimensions = this.getCurrentImageWidths();
const htmlUtils = new HtmlUtils();
Function parseExtmeta
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static parseExtmeta( data, type ) {
let value = data && data.value;
if ( value === null || value === undefined ) {
return undefined;
} else if ( type === 'plaintext' ) {
Function getPossibleImageSizesForHtml
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPossibleImageSizesForHtml( width, height ) {
const buckets = {
small: { width: 640, height: 480 },
medium: { width: 1280, height: 720 }, // HD ready = 720p
large: { width: 1920, height: 1080 }, // Full HD = 1080p
Function addText
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addText( $container, msgs, icon ) {
const $text = $( '<div>' )
.addClass( 'mw-mmv-options-text' );
const adders = [