wikimedia/mediawiki-extensions-MultimediaViewer

View on GitHub

Showing 42 of 80 total issues

File mmv.js has 549 lines of code (exceeds 250 allowed). Consider refactoring.
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
Severity: Major
Found in resources/mmv/mmv.js - About 1 day to fix

    File mmv.ui.metadataPanel.js has 517 lines of code (exceeds 250 allowed). Consider refactoring.
    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
    Severity: Major
    Found in resources/mmv/ui/mmv.ui.metadataPanel.js - About 1 day to fix

      File mmv.bootstrap.js has 417 lines of code (exceeds 250 allowed). Consider refactoring.
      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
      Severity: Minor
      Found in resources/mmv.bootstrap/mmv.bootstrap.js - About 6 hrs to fix

        Function newFromImageInfo has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                static newFromImageInfo( title, imageInfo ) {
                    let name;
                    let uploadDateTime;
                    let anonymizedUploadDateTime;
                    let creationDateTime;
        Severity: Major
        Found in resources/mmv/model/mmv.model.Image.js - About 2 hrs to fix

          Function loadImage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  loadImage( image, initialImage ) {
                      const $initialImage = $( initialImage );
                      const extraStatsDeferred = $.Deferred();
          
                      const pluginsPromise = this.loadExtensionPlugins( image.filePageTitle.getExtension().toLowerCase() );
          Severity: Major
          Found in resources/mmv/mmv.js - About 2 hrs to fix

            Function createAttributionButton has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    createAttributionButton( $container ) {
                        const attributionInput = new mw.widgets.CopyTextLayout( {
                            align: 'top',
                            button: {
                                label: '',
            Severity: Major
            Found in resources/mmv.ui.download.pane/mmv.ui.download.pane.js - About 2 hrs to fix

              File mmv.lightboxinterface.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
              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
              Severity: Minor
              Found in resources/mmv/mmv.lightboxinterface.js - About 2 hrs to fix

                Function attach has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                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
                Severity: Major
                Found in resources/mmv/mmv.lightboxinterface.js - About 2 hrs to fix

                  Function exports has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function ( grunt ) {
                      const conf = grunt.file.readJSON( 'extension.json' );
                  
                      grunt.loadNpmTasks( 'grunt-banana-checker' );
                      grunt.loadNpmTasks( 'grunt-eslint' );
                  Severity: Major
                  Found in Gruntfile.js - About 2 hrs to fix

                    Function constructor has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            constructor( $container, $closeButton, $fullscreenButton ) {
                                super( $container );
                    
                                this.$close = $closeButton;
                                this.$fullscreen = $fullscreenButton;
                    Severity: Minor
                    Found in resources/mmv/ui/mmv.ui.canvasButtons.js - About 1 hr to fix

                      Function processFilePageThumb has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      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
                      Severity: Minor
                      Found in resources/mmv.bootstrap/mmv.bootstrap.js - About 1 hr to fix

                        Function setLocationData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                setLocationData( imageData ) {
                                    if ( !imageData.hasCoords() ) {
                                        return;
                                    }
                        
                        
                        Severity: Minor
                        Found in resources/mmv/ui/mmv.ui.metadataPanel.js - About 1 hr to fix

                          Function loadViewer has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  loadViewer( setupOverlay ) {
                                      const deferred = $.Deferred();
                                      let viewer;
                                      let message;
                          
                          
                          Severity: Minor
                          Found in resources/mmv.bootstrap/mmv.bootstrap.js - About 1 hr to fix

                            Function attach has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    attach() {
                                        this.scroller.attach();
                                        this.buttons.attach();
                                        this.title.attach();
                                        this.creditField.attach();
                            Severity: Minor
                            Found in resources/mmv/ui/mmv.ui.metadataPanel.js - About 1 hr to fix

                              Function constructor has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      constructor() {
                                          const $wrapper = $( '<div>' )
                                              .addClass( 'mw-mmv-wrapper' );
                                          super( $wrapper );
                                          this.$wrapper = $wrapper;
                              Severity: Minor
                              Found in resources/mmv/mmv.lightboxinterface.js - About 1 hr to fix

                                Function initTabs has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        initTabs() {
                                            const makeTab = ( type ) => new OO.ui.MenuOptionWidget( {
                                                data: type,
                                                // The following messages are used here:
                                                // * multimediaviewer-embed-tab
                                Severity: Minor
                                Found in resources/mmv/ui/mmv.ui.reuse.dialog.js - About 1 hr to fix

                                  Function showError has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          showError( error ) {
                                              const canvasDimensions = this.getDimensions();
                                              const thumbnailDimensions = this.getCurrentImageWidths();
                                              const htmlUtils = new HtmlUtils();
                                  
                                  
                                  Severity: Minor
                                  Found in resources/mmv/ui/mmv.ui.canvas.js - About 1 hr to fix

                                    Function parseExtmeta has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            static parseExtmeta( data, type ) {
                                                let value = data && data.value;
                                                if ( value === null || value === undefined ) {
                                                    return undefined;
                                                } else if ( type === 'plaintext' ) {
                                    Severity: Minor
                                    Found in resources/mmv/model/mmv.model.Image.js - About 1 hr to fix

                                      Function getPossibleImageSizesForHtml has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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
                                      Severity: Minor
                                      Found in resources/mmv.ui.ondemandshareddependencies/mmv.ui.utils.js - About 1 hr to fix

                                        Function addText has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                addText( $container, msgs, icon ) {
                                                    const $text = $( '<div>' )
                                                        .addClass( 'mw-mmv-options-text' );
                                        
                                                    const adders = [
                                        Severity: Minor
                                        Found in resources/mmv/ui/mmv.ui.viewingOptions.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language