wikimedia/mediawiki-extensions-UploadWizard

View on GitHub

Showing 272 of 272 total issues

File mw.UploadWizardDetails.js has 912 lines of code (exceeds 250 allowed). Consider refactoring.
Open

( function ( uw ) {

    var NS_FILE = mw.config.get( 'wgNamespaceIds' ).file;

    /**
Severity: Major
Found in resources/mw.UploadWizardDetails.js - About 2 days to fix

    Function UWDeedOwnWork has 285 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        uw.deed.OwnWork = function UWDeedOwnWork( config, uploads, api ) {
            var self = this,
                prefAuthName = mw.user.options.get( 'upwiz_licensename' ),
                revealOptionContent = function ( $parent, $child ) {
                    // hide sub-content for all options
    Severity: Major
    Found in resources/deed/uw.deed.OwnWork.js - About 1 day to fix

      Function buildInterface has 238 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              buildInterface: function () {
                  var descriptionRequired, uri,
                      details = this,
                      config = mw.UploadWizard.config,
                      captionsAvailable = config.wikibase.enabled && config.wikibase.captions;
      Severity: Major
      Found in resources/mw.UploadWizardDetails.js - About 1 day to fix

        File mw.UploadWizardUpload.js has 541 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Represents the upload -- in its local and remote state. (Possibly those could be separate objects too...)
         * This is our 'model' object if we are thinking MVC. Needs to be better factored, lots of feature envy with the UploadWizard
         * states:
         *   'new' 'transporting' 'transported' 'metadata' 'stashed' 'details' 'submitting-details' 'complete' 'error'
        Severity: Major
        Found in resources/mw.UploadWizardUpload.js - About 1 day to fix

          File mw.FlickrChecker.js has 498 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable camelcase, no-underscore-dangle */
          
          /**
           * @param ui
           * @param selectButton
          Severity: Minor
          Found in resources/mw.FlickrChecker.js - About 7 hrs to fix

            File UploadWizard.config.php has 482 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Upload Wizard Configuration
             * Do not modify this file, instead use localsettings.php and set:
             * $wgUploadWizardConfig[ 'name'] =  'value';
            Severity: Minor
            Found in UploadWizard.config.php - About 7 hrs to fix

              File uw.deed.OwnWork.js has 449 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.OwnWork.js - About 6 hrs to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if ( config.defaults.caption || uri.query.captionlang ) {
                                this.captionsDetails.setSerialized( {
                                    inputs: [
                                        {
                                            text: config.defaults.caption || ''
                Severity: Major
                Found in resources/mw.UploadWizardDetails.js and 1 other location - About 6 hrs to fix
                resources/mw.UploadWizardDetails.js on lines 359..372

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 161.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            if ( config.defaults.description || uri.query.descriptionlang ) {
                                this.descriptionsDetails.setSerialized( {
                                    inputs: [
                                        {
                                            text: config.defaults.description || ''
                Severity: Major
                Found in resources/mw.UploadWizardDetails.js and 1 other location - About 6 hrs to fix
                resources/mw.UploadWizardDetails.js on lines 344..357

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 161.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                File CampaignSchema.php has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                use MediaWiki\Extension\UploadWizard\Config;
                
                return [
                Severity: Minor
                Found in includes/CampaignSchema.php - About 5 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  new OO.ui.RadioOptionWidget( {
                                      label: $( '<div>' )
                                          .msg(
                                              'mwe-upwiz-source-ownwork-origin-option-others-unknown',
                                              this.uploadCount,
                  Severity: Major
                  Found in resources/deed/uw.deed.OwnWork.js and 1 other location - About 5 hrs to fix
                  resources/deed/uw.deed.OwnWork.js on lines 178..200

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 140.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  new OO.ui.RadioOptionWidget( {
                                      label: $( '<div>' )
                                          .msg(
                                              'mwe-upwiz-source-ownwork-origin-option-others-copyrighted',
                                              this.uploadCount,
                  Severity: Major
                  Found in resources/deed/uw.deed.OwnWork.js and 1 other location - About 5 hrs to fix
                  resources/deed/uw.deed.OwnWork.js on lines 201..223

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 140.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function UWUIUpload has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      uw.ui.Upload = function UWUIUpload( config ) {
                          var upload = this;
                  
                          this.config = config;
                  
                  
                  Severity: Major
                  Found in resources/ui/steps/uw.ui.Upload.js - About 5 hrs to fix

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        $.leftofbegin = function(element, settings) {
                            var fold;
                    
                            if (settings.container === undefined || settings.container === window) {
                                fold = $window.scrollLeft();
                    Severity: Major
                    Found in resources/jquery/jquery.lazyload.js and 1 other location - About 5 hrs to fix
                    resources/jquery/jquery.lazyload.js on lines 202..212

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 139.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        $.abovethetop = function(element, settings) {
                            var fold;
                    
                            if (settings.container === undefined || settings.container === window) {
                                fold = $window.scrollTop();
                    Severity: Major
                    Found in resources/jquery/jquery.lazyload.js and 1 other location - About 5 hrs to fix
                    resources/jquery/jquery.lazyload.js on lines 214..224

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 139.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function UWDeedThirdParty has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        uw.deed.ThirdParty = function UWDeedThirdParty( config, uploads, api ) {
                            var deed = this;
                    
                            uw.deed.Abstract.call( this, 'thirdparty', config, uploads );
                    
                    
                    Severity: Major
                    Found in resources/deed/uw.deed.ThirdParty.js - About 4 hrs to fix

                      Function getPhotos has 122 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          getPhotos: function ( mode, options ) {
                              this.selectButton.setLabel( mw.message( 'mwe-upwiz-select-flickr' ).text() );
                              this.selectButton.setDisabled( true );
                      
                              var req = $.extend( {}, options, {
                      Severity: Major
                      Found in resources/mw.FlickrChecker.js - About 4 hrs to fix

                        File uw.ui.Upload.js has 368 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/ui/steps/uw.ui.Upload.js - About 4 hrs to fix

                          Function lazyload has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $.fn.lazyload = function(options) {
                                  var elements = this;
                                  var $container;
                                  var settings = {
                                      threshold       : 0,
                          Severity: Major
                          Found in resources/jquery/jquery.lazyload.js - About 4 hrs to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        layout.$element.append(
                                            $( '<strong>' ).text( mw.msg( 'mwe-upwiz-patent-dialog-title-license' ) ),
                                            $( '<p>' ).text( mw.msg( 'mwe-upwiz-patent-dialog-text-license', this.uploads.length ) ),
                                            $( '<a>' )
                                                .text( mw.msg( 'mwe-upwiz-patent-dialog-link-license' ) )
                            Severity: Major
                            Found in resources/deed/dialog/uw.deed.dialog.PatentDialog.js and 1 other location - About 4 hrs to fix
                            resources/deed/dialog/uw.deed.dialog.PatentDialog.js on lines 104..110

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 121.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language