wikimedia/mediawiki-extensions-UploadWizard

View on GitHub

Showing 141 of 272 total issues

Method onGetPreferences has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function onGetPreferences( $user, &$preferences ) {
        $config = Config::getConfig();

        // User preference to skip the licensing tutorial, provided it's not globally disabled
        if ( Config::getSetting( 'tutorial' ) != [] ) {
Severity: Major
Found in includes/Hooks.php - About 3 hrs to fix

    Function load has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        uw.controller.Deed.prototype.load = function ( uploads ) {
            var self = this,
                // select "provide same information for all files" by default
                defaultDeedInterface = 'common',
                localUploads = uploads.filter( ( upload ) => {
    Severity: Major
    Found in resources/controller/uw.controller.Deed.js - About 3 hrs to fix

      File uw.deed.ThirdParty.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * This file is part of the MediaWiki extension UploadWizard.
       *
       * UploadWizard 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/deed/uw.deed.ThirdParty.js - About 2 hrs to fix

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

            uw.ui.Thanks = function UWUIThanks( config ) {
                var homeButtonTarget,
                    homeButtonHref,
                    homeButtonUrl,
                    thanksMessage,
        Severity: Major
        Found in resources/ui/steps/uw.ui.Thanks.js - About 2 hrs to fix

          Method addJsVars has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function addJsVars( $subPage ) {
                  $config = Config::getConfig( $this->campaign );
          
                  if ( array_key_exists( 'trackingCategory', $config ) ) {
                      if ( array_key_exists( 'campaign', $config['trackingCategory'] ) ) {
          Severity: Major
          Found in includes/Specials/SpecialUploadWizard.php - About 2 hrs to fix

            Function getPhoto has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                getPhoto: function ( photoIdMatches ) {
                    var checker = this;
                    var photoId = photoIdMatches[ 1 ];
            
                    return this.flickrRequest( {
            Severity: Major
            Found in resources/mw.FlickrChecker.js - About 2 hrs to fix

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

                  uw.deed.ThirdParty.prototype.setFormFields = function ( $selector ) {
                      var $formFields = $( '<div>' ).addClass( 'mwe-upwiz-deed-form-internal' ), self = this;
              
                      this.$form = $( '<form>' );
              
              
              Severity: Major
              Found in resources/deed/uw.deed.ThirdParty.js - About 2 hrs to fix

                File uw.LicenseGroup.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                ( function ( uw ) {
                
                    /**
                     * @extends OO.ui.LicenseGroup
                     *
                Severity: Minor
                Found in resources/uw.LicenseGroup.js - About 2 hrs to fix

                  Method getParsedConfig has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getParsedConfig( Language $lang = null ) {
                          if ( $lang === null ) {
                              $lang = $this->context->getLanguage();
                          }
                  
                  
                  Severity: Major
                  Found in includes/Campaign.php - About 2 hrs to fix

                    Function UWMetadataContent has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        uw.MetadataContent = function UWMetadataContent( upload, config ) {
                            var $titleDiv,
                                $filenameDiv,
                                $thumbnailDiv,
                                self = this;
                    Severity: Major
                    Found in resources/metadata/uw.MetadataContent.js - About 2 hrs to fix

                      Function uploadChunk has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          mw.FormDataTransport.prototype.uploadChunk = function ( file, offset ) {
                              var params = this.createParams( this.tempname, offset ),
                                  transport = this,
                                  bytesAvailable = file.size,
                                  chunk;
                      Severity: Major
                      Found in resources/transports/mw.FormDataTransport.js - About 2 hrs to fix

                        Function prefillDate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                prefillDate: function () {
                                    var dateObj, metadata, dateTimeRegex, matches, dateStr, saneTime,
                                        dateMode = 'calendar',
                                        yyyyMmDdRegex = /^(\d\d\d\d)[:/-](\d\d)[:/-](\d\d)\D.*/,
                                        timeRegex = /\D(\d\d):(\d\d):(\d\d)/;
                        Severity: Major
                        Found in resources/mw.UploadWizardDetails.js - About 2 hrs to fix

                          Function submit has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  submit: function () {
                                      var details = this,
                                          wikitext, captions, promise, languageCodes, allLanguages, errorString;
                          
                                      this.$containerDiv.find( 'form' ).trigger( 'submit' );
                          Severity: Major
                          Found in resources/mw.UploadWizardDetails.js - About 2 hrs to fix

                            Function UploadWizardDeedChooser has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                mw.UploadWizardDeedChooser = function ( config, deeds, uploads ) {
                                    var chooser = this,
                                        $radioContainer,
                                        $formContainer;
                            
                            
                            Severity: Major
                            Found in resources/mw.UploadWizardDeedChooser.js - About 2 hrs to fix

                              Function UWCopyMetadataWidget has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  uw.CopyMetadataWidget = function UWCopyMetadataWidget( config ) {
                                      var metadataType, defaultStatus, copyMetadataMsg,
                                          checkboxes = [],
                                          $copyMetadataWrapperDiv = $( '<div>' ),
                                          $copyMetadataDiv = $( '<div>' );
                              Severity: Major
                              Found in resources/uw.CopyMetadataWidget.js - About 2 hrs to fix

                                Campaign has 22 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class Campaign {
                                
                                    /**
                                     * The campaign configuration.
                                     *
                                Severity: Minor
                                Found in includes/Campaign.php - About 2 hrs to fix

                                  Method execute has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function execute() {
                                          $params = $this->extractRequestParams();
                                  
                                          $limit = $params['limit'];
                                  
                                  
                                  Severity: Major
                                  Found in includes/ApiQueryAllCampaigns.php - About 2 hrs to fix

                                    Function getTransformedCanvasElement has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        mw.UploadWizardUpload.prototype.getTransformedCanvasElement = function ( image, constraints ) {
                                            var angle, scaling, width, height,
                                                dimensions, dx, dy, x, y, $canvas, ctx,
                                                scaleConstraints = constraints,
                                                rotation = 0;
                                    Severity: Major
                                    Found in resources/mw.UploadWizardUpload.js - About 2 hrs to fix

                                      Method execute has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function execute( $subPage ) {
                                              // side effects: if we can't upload, will print error page to wgOut
                                              // and return false
                                              if ( !( $this->isUploadAllowed() && $this->isUserUploadAllowed( $this->getUser() ) ) ) {
                                                  return;
                                      Severity: Major
                                      Found in includes/Specials/SpecialUploadWizard.php - About 2 hrs to fix

                                        Method getConfigForJSON has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function getConfigForJSON( $campaign, $oldConfig ) {
                                                $config = [
                                                    'enabled' => $campaign->campaign_enabled === '1',
                                                    'display' => [
                                                        'headerLabelPage' => $oldConfig['headerLabelPage'],
                                        Severity: Major
                                        Found in maintenance/migrateCampaigns.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language