WordPress/WordPress

View on GitHub
wp-includes/js/media-views.js

Summary

Maintainability
F
2 mos
Test Coverage

File media-views.js has 5520 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (() => { // webpackBootstrap
/******/     var __webpack_modules__ = ({

/***/ 7145:
/***/ ((module) => {
Severity: Major
Found in wp-includes/js/media-views.js - About 2 wks to fix

    Function 4274 has 548 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    /***/ ((module) => {
    
    var Select = wp.media.view.MediaFrame.Select,
        Library = wp.media.controller.Library,
        l10n = wp.media.view.l10n,
    Severity: Major
    Found in wp-includes/js/media-views.js - About 2 days to fix

      Function 6829 has 501 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      /***/ ((module) => {
      
      var View = wp.media.View,
          mediaTrash = wp.media.view.settings.mediaTrash,
          l10n = wp.media.view.l10n,
      Severity: Major
      Found in wp-includes/js/media-views.js - About 2 days to fix

        Function 4075 has 354 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        /***/ ((module) => {
        
        var View = wp.media.View,
            $ = jQuery,
            Attachment;
        Severity: Major
        Found in wp-includes/js/media-views.js - About 1 day to fix

          Function 8142 has 202 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          /***/ ((module) => {
          
          var View = wp.media.View,
              $ = jQuery,
              Attachments,
          Severity: Major
          Found in wp-includes/js/media-views.js - About 1 day to fix

            Function 2836 has 197 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            /***/ ((module) => {
            
            var Frame = wp.media.view.Frame,
                l10n = wp.media.view.l10n,
                $ = jQuery,
            Severity: Major
            Found in wp-includes/js/media-views.js - About 7 hrs to fix

              Function createToolbar has 196 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  createToolbar: function() {
                      var LibraryViewSwitcher, Filters, toolbarOptions,
                          showFilterByType = -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] );
              
                      toolbarOptions = {
              Severity: Major
              Found in wp-includes/js/media-views.js - About 7 hrs to fix

                Function 718 has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                /***/ ((module) => {
                
                var $ = jQuery;
                
                /**
                Severity: Major
                Found in wp-includes/js/media-views.js - About 6 hrs to fix

                  Function 3674 has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  /***/ ((module) => {
                  
                  var View = wp.media.View,
                      l10n = wp.media.view.l10n,
                      $ = jQuery,
                  Severity: Major
                  Found in wp-includes/js/media-views.js - About 5 hrs to fix

                    Function 472 has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    /***/ ((module) => {
                    
                    var l10n = wp.media.view.l10n,
                        getUserSetting = window.getUserSetting,
                        setUserSetting = window.setUserSetting,
                    Severity: Major
                    Found in wp-includes/js/media-views.js - About 5 hrs to fix

                      Function 6090 has 131 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      /***/ ((module) => {
                      
                      /* global ClipboardJS */
                      var Attachment = wp.media.view.Attachment,
                          l10n = wp.media.view.l10n,
                      Severity: Major
                      Found in wp-includes/js/media-views.js - About 5 hrs to fix

                        Function 2650 has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        /***/ ((module) => {
                        
                        var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay,
                            $ = jQuery,
                            ImageDetails;
                        Severity: Major
                        Found in wp-includes/js/media-views.js - About 5 hrs to fix

                          Function 5424 has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          /***/ ((module) => {
                          
                          var Select = wp.media.view.MediaFrame.Select,
                              l10n = wp.media.view.l10n,
                              ImageDetails;
                          Severity: Major
                          Found in wp-includes/js/media-views.js - About 5 hrs to fix

                            Function 2621 has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            /***/ ((module) => {
                            
                            var $ = jQuery,
                                Modal;
                            
                            
                            Severity: Major
                            Found in wp-includes/js/media-views.js - About 4 hrs to fix

                              Function 5694 has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              /***/ ((module) => {
                              
                              /**
                               * wp.media.controller.State
                               *
                              Severity: Major
                              Found in wp-includes/js/media-views.js - About 4 hrs to fix

                                Function 5275 has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                /***/ ((module) => {
                                
                                var View = wp.media.View,
                                    Toolbar;
                                
                                
                                Severity: Major
                                Found in wp-includes/js/media-views.js - About 4 hrs to fix

                                  Function 455 has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  /***/ ((module) => {
                                  
                                  var MediaFrame = wp.media.view.MediaFrame,
                                      l10n = wp.media.view.l10n,
                                      Select;
                                  Severity: Major
                                  Found in wp-includes/js/media-views.js - About 4 hrs to fix

                                    Function 8197 has 97 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    /***/ ((module) => {
                                    
                                    var View = wp.media.View,
                                        UploaderStatus;
                                    
                                    
                                    Severity: Major
                                    Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                      Function createStates has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          createStates: function() {
                                              var options = this.options;
                                      
                                              this.states.add([
                                                  // Main states.
                                      Severity: Major
                                      Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                        Function 5422 has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        /***/ ((module) => {
                                        
                                        var l10n = wp.media.view.l10n,
                                            Cropper;
                                        
                                        
                                        Severity: Major
                                        Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                          Function 7349 has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                          /***/ ((module) => {
                                          
                                          var l10n = wp.media.view.l10n,
                                              All;
                                          
                                          
                                          Severity: Major
                                          Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                            Function 1753 has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                            /***/ ((module) => {
                                            
                                            var View = wp.media.View,
                                                UploaderInline;
                                            
                                            
                                            Severity: Major
                                            Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                              Function createFilters has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                  createFilters: function() {
                                                      var filters = {},
                                                          uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0;
                                              
                                                      _.each( wp.media.view.settings.mimeTypes || {}, function( text, key ) {
                                              Severity: Major
                                              Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                Function 1061 has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                /***/ ((module) => {
                                                
                                                /**
                                                 * wp.media.view.Frame
                                                 *
                                                Severity: Major
                                                Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                  Function 1 has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                  /***/ ((module) => {
                                                  
                                                  var MenuItem = wp.media.view.MenuItem,
                                                      PriorityList = wp.media.view.PriorityList,
                                                      Menu;
                                                  Severity: Major
                                                  Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                    Function 4910 has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                    /***/ ((module) => {
                                                    
                                                    var l10n = wp.media.view.l10n,
                                                        $ = Backbone.$,
                                                        Embed;
                                                    Severity: Major
                                                    Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                      Function 8612 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                      /***/ ((module) => {
                                                      
                                                      var Library = wp.media.controller.Library,
                                                          l10n = wp.media.view.l10n,
                                                          $ = jQuery,
                                                      Severity: Major
                                                      Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                        Function 1915 has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                        /***/ ((module) => {
                                                        
                                                        var View = wp.media.View,
                                                            $ = Backbone.$,
                                                            Settings;
                                                        Severity: Major
                                                        Found in wp-includes/js/media-views.js - About 3 hrs to fix

                                                          Function 2038 has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                          /***/ ((module) => {
                                                          
                                                          var Library = wp.media.controller.Library,
                                                              l10n = wp.media.view.l10n,
                                                              GalleryEdit;
                                                          Severity: Major
                                                          Found in wp-includes/js/media-views.js - About 2 hrs to fix

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

                                                            /***/ ((module) => {
                                                            
                                                            var $ = jQuery,
                                                                UploaderWindow;
                                                            
                                                            
                                                            Severity: Major
                                                            Found in wp-includes/js/media-views.js - About 2 hrs to fix

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

                                                              /***/ ((module) => {
                                                              
                                                              var $ = jQuery,
                                                                  EmbedLink;
                                                              
                                                              
                                                              Severity: Major
                                                              Found in wp-includes/js/media-views.js - About 2 hrs to fix

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

                                                                /***/ ((module) => {
                                                                
                                                                var View = wp.media.View,
                                                                    UploaderStatus = wp.media.view.UploaderStatus,
                                                                    l10n = wp.media.view.l10n,
                                                                Severity: Major
                                                                Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                  Function 7656 has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                  /***/ ((module) => {
                                                                  
                                                                  var Settings = wp.media.view.Settings,
                                                                      AttachmentDisplay;
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                    Function 1368 has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                    /***/ ((module) => {
                                                                    
                                                                    var l10n = wp.media.view.l10n,
                                                                        Uploaded;
                                                                    
                                                                    
                                                                    Severity: Major
                                                                    Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                      Function 9875 has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                      /***/ ((module) => {
                                                                      
                                                                      /**
                                                                       * wp.media.controller.Region
                                                                       *
                                                                      Severity: Major
                                                                      Found in wp-includes/js/media-views.js - About 2 hrs to fix

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

                                                                        /***/ ((module) => {
                                                                        
                                                                        var _n = wp.i18n._n,
                                                                            sprintf = wp.i18n.sprintf,
                                                                            Selection;
                                                                        Severity: Major
                                                                        Found in wp-includes/js/media-views.js - About 2 hrs to fix

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

                                                                          /***/ ((module) => {
                                                                          
                                                                          var Attachment = wp.media.model.Attachment,
                                                                              Library = wp.media.controller.Library,
                                                                              l10n = wp.media.view.l10n,
                                                                          Severity: Major
                                                                          Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                            Function 8815 has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                            /***/ ((module) => {
                                                                            
                                                                            /**
                                                                             * wp.media.view.PriorityList
                                                                             *
                                                                            Severity: Major
                                                                            Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                              Function 2275 has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                              Open

                                                                              /***/ ((module) => {
                                                                              
                                                                              var Library = wp.media.controller.Library,
                                                                                  l10n = wp.media.view.l10n,
                                                                                  ReplaceImage;
                                                                              Severity: Minor
                                                                              Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                                Function createFilters has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                Open

                                                                                    createFilters: function() {
                                                                                        var type = this.model.get('type'),
                                                                                            types = wp.media.view.settings.mimeTypes,
                                                                                            uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0,
                                                                                            text;
                                                                                Severity: Minor
                                                                                Found in wp-includes/js/media-views.js - About 2 hrs to fix

                                                                                  Function 846 has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                  Open

                                                                                  /***/ ((module) => {
                                                                                  
                                                                                  /**
                                                                                   * wp.media.view.Button
                                                                                   *
                                                                                  Severity: Minor
                                                                                  Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                    Function 2982 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                    Open

                                                                                    /***/ ((module) => {
                                                                                    
                                                                                    var View = wp.media.View,
                                                                                        AttachmentCompat;
                                                                                    
                                                                                    
                                                                                    Severity: Minor
                                                                                    Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                      Function bindHandlers has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                      Open

                                                                                          bindHandlers: function() {
                                                                                              var handlers, checkCounts;
                                                                                      
                                                                                              Select.prototype.bindHandlers.apply( this, arguments );
                                                                                      
                                                                                      
                                                                                      Severity: Minor
                                                                                      Found in wp-includes/js/media-views.js - About 1 hr to fix

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

                                                                                        /***/ ((module) => {
                                                                                        
                                                                                        var $ = jQuery,
                                                                                            AttachmentFilters;
                                                                                        
                                                                                        
                                                                                        Severity: Minor
                                                                                        Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                          Function 9458 has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                          /***/ ((module) => {
                                                                                          
                                                                                          var Toolbar = wp.media.view.Toolbar,
                                                                                              l10n = wp.media.view.l10n,
                                                                                              Select;
                                                                                          Severity: Minor
                                                                                          Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                            Function toggleSelection has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                                toggleSelection: function( options ) {
                                                                                                    var collection = this.collection,
                                                                                                        selection = this.options.selection,
                                                                                                        model = this.model,
                                                                                                        method = options && options.method,
                                                                                            Severity: Minor
                                                                                            Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                              Function createCropToolbar has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                              Open

                                                                                                  createCropToolbar: function() {
                                                                                                      var canSkipCrop, toolbarOptions;
                                                                                              
                                                                                                      canSkipCrop = this.get('canSkipCrop') || false;
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                Function initialize has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                Open

                                                                                                    initialize: function() {
                                                                                                        _.defaults( this.options, {
                                                                                                            filters: false,
                                                                                                            search:  true,
                                                                                                            date:    true,
                                                                                                Severity: Minor
                                                                                                Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                  Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                  Open

                                                                                                      render: function() {
                                                                                                          var options = _.defaults( this.model.toJSON(), {
                                                                                                                  orientation:   'landscape',
                                                                                                                  uploading:     false,
                                                                                                                  type:          '',
                                                                                                  Severity: Minor
                                                                                                  Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                    Function 7327 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                    Open

                                                                                                    /***/ ((module) => {
                                                                                                    
                                                                                                    var View = wp.media.View,
                                                                                                        $ = jQuery,
                                                                                                        l10n = wp.media.view.l10n,
                                                                                                    Severity: Minor
                                                                                                    Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                      Function 5663 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                      /***/ ((module) => {
                                                                                                      
                                                                                                      var l10n = wp.media.view.l10n,
                                                                                                          EditImage;
                                                                                                      
                                                                                                      
                                                                                                      Severity: Minor
                                                                                                      Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                        Function click has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                                        click: function() {
                                                                                                                            var changed = [], removed = [],
                                                                                                                                selection = this.controller.state().get( 'selection' ),
                                                                                                                                library = this.controller.state().get( 'library' );
                                                                                                        
                                                                                                        
                                                                                                        Severity: Minor
                                                                                                        Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                          Function 6150 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                          /***/ ((module) => {
                                                                                                          
                                                                                                          /**
                                                                                                           * wp.media.controller.StateMachine
                                                                                                           *
                                                                                                          Severity: Minor
                                                                                                          Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                            Function 7145 has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                            Open

                                                                                                            /***/ ((module) => {
                                                                                                            
                                                                                                            var Selection = wp.media.model.Selection,
                                                                                                                Library = wp.media.controller.Library,
                                                                                                                CollectionAdd;
                                                                                                            Severity: Minor
                                                                                                            Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                              Function initialize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                              Open

                                                                                                                  initialize: function() {
                                                                                                                      this.el.id = _.uniqueId('__attachments-view-');
                                                                                                              
                                                                                                                      /**
                                                                                                                       * @since 5.8.0 Added the `infiniteScrolling` parameter.
                                                                                                              Severity: Minor
                                                                                                              Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                Function 5741 has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                Open

                                                                                                                /***/ ((module) => {
                                                                                                                
                                                                                                                /**
                                                                                                                 * wp.media.view.Embed
                                                                                                                 *
                                                                                                                Severity: Minor
                                                                                                                Found in wp-includes/js/media-views.js - About 1 hr to fix

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

                                                                                                                  /***/ ((module) => {
                                                                                                                  
                                                                                                                  var MenuItem;
                                                                                                                  
                                                                                                                  /**
                                                                                                                  Severity: Minor
                                                                                                                  Found in wp-includes/js/media-views.js - About 1 hr to fix

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

                                                                                                                    /***/ ((module) => {
                                                                                                                    
                                                                                                                    var Selection = wp.media.model.Selection,
                                                                                                                        Library = wp.media.controller.Library,
                                                                                                                        l10n = wp.media.view.l10n,
                                                                                                                    Severity: Minor
                                                                                                                    Found in wp-includes/js/media-views.js - About 1 hr to fix

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

                                                                                                                          renderReplaceImageToolbar: function() {
                                                                                                                              var frame = this,
                                                                                                                                  lastState = frame.lastState(),
                                                                                                                                  previous = lastState && lastState.id;
                                                                                                                      
                                                                                                                      
                                                                                                                      Severity: Minor
                                                                                                                      Found in wp-includes/js/media-views.js - About 1 hr to fix

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

                                                                                                                        /***/ ((module) => {
                                                                                                                        
                                                                                                                        var View = wp.media.View,
                                                                                                                            $ = jQuery,
                                                                                                                            SiteIconPreview;
                                                                                                                        Severity: Minor
                                                                                                                        Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                          Function initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                          Open

                                                                                                                              initialize: function() {
                                                                                                                                  Frame.prototype.initialize.apply( this, arguments );
                                                                                                                          
                                                                                                                                  _.defaults( this.options, {
                                                                                                                                      title:    l10n.mediaFrameDefaultTitle,
                                                                                                                          Severity: Minor
                                                                                                                          Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                            Function createLoadMoreView has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                                createLoadMoreView: function() {
                                                                                                                                    var view = this;
                                                                                                                            
                                                                                                                                    this.loadMoreWrapper = new View( {
                                                                                                                                        controller: this.controller,
                                                                                                                            Severity: Minor
                                                                                                                            Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                              Function switchTabs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                                  switchTabs: function( event ) {
                                                                                                                                      var key   = event.which,
                                                                                                                                          index = this.tabs.index( $( event.target ) ),
                                                                                                                                          newIndex;
                                                                                                                              
                                                                                                                              
                                                                                                                              Severity: Minor
                                                                                                                              Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                Function fetch has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                Open

                                                                                                                                    fetch: function() {
                                                                                                                                        var url = this.model.get( 'url' ), re, youTubeEmbedMatch;
                                                                                                                                
                                                                                                                                        // Check if they haven't typed in 500 ms.
                                                                                                                                        if ( $('#embed-url-field').val() !== url ) {
                                                                                                                                Severity: Minor
                                                                                                                                Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                  Function initSortable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                  Open

                                                                                                                                      initSortable: function() {
                                                                                                                                          var collection = this.collection;
                                                                                                                                  
                                                                                                                                          if ( ! this.options.sortable || ! $.fn.sortable ) {
                                                                                                                                              return;
                                                                                                                                  Severity: Minor
                                                                                                                                  Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                    Function arrowEvent has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                    Open

                                                                                                                                        arrowEvent: function( event ) {
                                                                                                                                            var attachments = this.$el.children( 'li' ),
                                                                                                                                                perRow = this.columns,
                                                                                                                                                index = attachments.filter( ':focus' ).index(),
                                                                                                                                                row = ( index + 1 ) <= perRow ? 1 : Math.ceil( ( index + 1 ) / perRow );
                                                                                                                                    Severity: Minor
                                                                                                                                    Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                      Function 4181 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                      Open

                                                                                                                                      /***/ ((module) => {
                                                                                                                                      
                                                                                                                                      /**
                                                                                                                                       * wp.media.selectionSync
                                                                                                                                       *
                                                                                                                                      Severity: Minor
                                                                                                                                      Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                        Function toggleSelectionHandler has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                        Open

                                                                                                                                            toggleSelectionHandler: function( event ) {
                                                                                                                                                var method;
                                                                                                                                        
                                                                                                                                                // Don't do anything inside inputs and on the attachment check and remove buttons.
                                                                                                                                                if ( 'INPUT' === event.target.nodeName || 'BUTTON' === event.target.nodeName ) {
                                                                                                                                        Severity: Minor
                                                                                                                                        Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                          Function drop has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                              drop: function( event ) {
                                                                                                                                                  var $wrap, uploadView;
                                                                                                                                          
                                                                                                                                                  this.containerDragleave( event );
                                                                                                                                                  this.dropzoneDragleave( event );
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                            Function 6126 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                            /***/ ((module) => {
                                                                                                                                            
                                                                                                                                            var View = wp.media.View,
                                                                                                                                                EditImage;
                                                                                                                                            
                                                                                                                                            
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                              Function 6172 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                              Open

                                                                                                                                              /***/ ((module) => {
                                                                                                                                              
                                                                                                                                              var Controller = wp.media.controller,
                                                                                                                                                  SiteIconCropper;
                                                                                                                                              
                                                                                                                                              
                                                                                                                                              Severity: Minor
                                                                                                                                              Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                Function renderSettings has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                Open

                                                                                                                                                    renderSettings: function( attachmentsBrowserView ) {
                                                                                                                                                        var library = this.get('library'),
                                                                                                                                                            collectionType = this.get('collectionType'),
                                                                                                                                                            dragInfoText = this.get('dragInfoText'),
                                                                                                                                                            SettingsView = this.get('SettingsView'),
                                                                                                                                                Severity: Minor
                                                                                                                                                Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                  Function update has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                  Open

                                                                                                                                                      update: function( key ) {
                                                                                                                                                          var value = this.model.get( key ),
                                                                                                                                                              $setting = this.$('[data-setting="' + key + '"]'),
                                                                                                                                                              $buttons, $value;
                                                                                                                                                  
                                                                                                                                                  
                                                                                                                                                  Severity: Minor
                                                                                                                                                  Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                    Function updateLoadMoreView has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                    Open

                                                                                                                                                        updateLoadMoreView: _.debounce( function() {
                                                                                                                                                            // Ensure the load more view elements are initially hidden at each update.
                                                                                                                                                            this.loadMoreButton.$el.addClass( 'hidden' );
                                                                                                                                                            this.loadMoreCount.$el.addClass( 'hidden' );
                                                                                                                                                            this.loadMoreJumpToFirst.$el.addClass( 'hidden' ).prop( 'disabled', true );
                                                                                                                                                    Severity: Minor
                                                                                                                                                    Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                      Function 6472 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                      Open

                                                                                                                                                      /***/ ((module) => {
                                                                                                                                                      
                                                                                                                                                      var l10n = wp.media.view.l10n,
                                                                                                                                                          DateFilter;
                                                                                                                                                      
                                                                                                                                                      
                                                                                                                                                      Severity: Minor
                                                                                                                                                      Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                        Function set has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                                                                        Open

                                                                                                                                                            set: function( id, view, options ) {
                                                                                                                                                                var priority, views, index;
                                                                                                                                                        
                                                                                                                                                                options = options || {};
                                                                                                                                                        
                                                                                                                                                        
                                                                                                                                                        Severity: Minor
                                                                                                                                                        Found in wp-includes/js/media-views.js - About 1 hr to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                      return;
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in wp-includes/js/media-views.js - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                            return;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in wp-includes/js/media-views.js - About 30 mins to fix

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

                                                                                                                                                                  mainPlaylistToolbar: function( view ) {
                                                                                                                                                                      var controller = this;
                                                                                                                                                              
                                                                                                                                                                      this.selectionStatusToolbar( view );
                                                                                                                                                              
                                                                                                                                                              
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6967..6995

                                                                                                                                                              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 232.

                                                                                                                                                              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

                                                                                                                                                                  mainVideoPlaylistToolbar: function( view ) {
                                                                                                                                                                      var controller = this;
                                                                                                                                                              
                                                                                                                                                                      this.selectionStatusToolbar( view );
                                                                                                                                                              
                                                                                                                                                              
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6937..6965

                                                                                                                                                              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 232.

                                                                                                                                                              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

                                                                                                                                                                  playlistEditToolbar: function() {
                                                                                                                                                                      var editing = this.state().get('editing');
                                                                                                                                                                      this.toolbar.set( new wp.media.view.Toolbar({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          items: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7010..7038

                                                                                                                                                              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 219.

                                                                                                                                                              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

                                                                                                                                                                  galleryEditToolbar: function() {
                                                                                                                                                                      var editing = this.state().get('editing');
                                                                                                                                                                      this.toolbar.set( new wp.media.view.Toolbar({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          items: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7069..7097

                                                                                                                                                              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 219.

                                                                                                                                                              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

                                                                                                                                                                  galleryAddToolbar: function() {
                                                                                                                                                                      this.toolbar.set( new wp.media.view.Toolbar({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          items: {
                                                                                                                                                                              insert: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7099..7126

                                                                                                                                                              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 216.

                                                                                                                                                              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

                                                                                                                                                                  playlistAddToolbar: function() {
                                                                                                                                                                      this.toolbar.set( new wp.media.view.Toolbar({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          items: {
                                                                                                                                                                              insert: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 day to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7040..7067

                                                                                                                                                              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 216.

                                                                                                                                                              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

                                                                                                                                                                  videoPlaylistMenu: function( view ) {
                                                                                                                                                                      var lastState = this.lastState(),
                                                                                                                                                                          previous = lastState && lastState.id,
                                                                                                                                                                          frame = this;
                                                                                                                                                              
                                                                                                                                                              
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 6 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6743..6768

                                                                                                                                                              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 171.

                                                                                                                                                              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

                                                                                                                                                                  playlistMenu: function( view ) {
                                                                                                                                                                      var lastState = this.lastState(),
                                                                                                                                                                          previous = lastState && lastState.id,
                                                                                                                                                                          frame = this;
                                                                                                                                                              
                                                                                                                                                              
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 6 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6770..6795

                                                                                                                                                              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 171.

                                                                                                                                                              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

                                                                                                                                                              Identical blocks of code found in 4 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              /******/     function __webpack_require__(moduleId) {
                                                                                                                                                              /******/         // Check if module is in cache
                                                                                                                                                              /******/         var cachedModule = __webpack_module_cache__[moduleId];
                                                                                                                                                              /******/         if (cachedModule !== undefined) {
                                                                                                                                                              /******/             return cachedModule.exports;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 3 other locations - About 5 hrs to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 772..790
                                                                                                                                                              wp-includes/js/media-grid.js on lines 985..1003
                                                                                                                                                              wp-includes/js/media-models.js on lines 1370..1388

                                                                                                                                                              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 142.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                      clipboard.on( 'success', function( event ) {
                                                                                                                                                                          var triggerElement = $( event.trigger ),
                                                                                                                                                                              successElement = $( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) );
                                                                                                                                                              
                                                                                                                                                                          // Clear the selection and move focus back to the trigger.
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 5 hrs to fix
                                                                                                                                                              wp-admin/js/post.js on lines 1300..1318
                                                                                                                                                              wp-admin/js/site-health.js on lines 23..41

                                                                                                                                                              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 141.

                                                                                                                                                              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

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

                                                                                                                                                                      library.comparator = function( a, b ) {
                                                                                                                                                                          var aInQuery = !! this.mirroring.get( a.cid ),
                                                                                                                                                                              bInQuery = !! this.mirroring.get( b.cid );
                                                                                                                                                              
                                                                                                                                                                          if ( ! aInQuery && bInQuery ) {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1864..1875

                                                                                                                                                              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 127.

                                                                                                                                                              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

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

                                                                                                                                                                      library.comparator = function( a, b ) {
                                                                                                                                                                          var aInQuery = !! this.mirroring.get( a.cid ),
                                                                                                                                                                              bInQuery = !! this.mirroring.get( b.cid );
                                                                                                                                                              
                                                                                                                                                                          if ( ! aInQuery && bInQuery ) {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 834..845

                                                                                                                                                              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 127.

                                                                                                                                                              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

                                                                                                                                                                      $( '#preview-favicon' ).css({
                                                                                                                                                                          width: Math.round( preview_rx * this.imageWidth ) + 'px',
                                                                                                                                                                          height: Math.round( preview_ry * this.imageHeight ) + 'px',
                                                                                                                                                                          marginLeft: '-' + Math.round( preview_rx * coords.x1 ) + 'px',
                                                                                                                                                                          marginTop: '-' + Math.floor( preview_ry* coords.y1 ) + 'px'
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 9198..9203

                                                                                                                                                              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 124.

                                                                                                                                                              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

                                                                                                                                                                      $( '#preview-app-icon' ).css({
                                                                                                                                                                          width: Math.round(rx * this.imageWidth ) + 'px',
                                                                                                                                                                          height: Math.round(ry * this.imageHeight ) + 'px',
                                                                                                                                                                          marginLeft: '-' + Math.round(rx * coords.x1) + 'px',
                                                                                                                                                                          marginTop: '-' + Math.round(ry * coords.y1) + 'px'
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 4 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 9205..9210

                                                                                                                                                              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 124.

                                                                                                                                                              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 ( tabbables.last()[0] === event.target && ! event.shiftKey ) {
                                                                                                                                                                          tabbables.first().focus();
                                                                                                                                                                          return false;
                                                                                                                                                                      } else if ( tabbables.first()[0] === event.target && event.shiftKey ) {
                                                                                                                                                                          tabbables.last().focus();
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 3 hrs to fix
                                                                                                                                                              wp-admin/js/customize-controls.js on lines 2652..2658

                                                                                                                                                              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 113.

                                                                                                                                                              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

                                                                                                                                                                  createCropContent: function() {
                                                                                                                                                                      this.cropperView = new wp.media.view.SiteIconCropper({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          attachment: this.get('selection').first()
                                                                                                                                                                      });
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 3 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 349..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 104.

                                                                                                                                                              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

                                                                                                                                                                  createCropContent: function() {
                                                                                                                                                                      this.cropperView = new wp.media.view.Cropper({
                                                                                                                                                                          controller: this,
                                                                                                                                                                          attachment: this.get('selection').first()
                                                                                                                                                                      });
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 3 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1941..1949

                                                                                                                                                              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 104.

                                                                                                                                                              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

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

                                                                                                                                                                  editImageContent: function() {
                                                                                                                                                                      var image = this.state().get('image'),
                                                                                                                                                                          view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
                                                                                                                                                              
                                                                                                                                                                      this.content.set( view );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 3 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6843..6852

                                                                                                                                                              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 100.

                                                                                                                                                              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

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

                                                                                                                                                                  editImageContent: function() {
                                                                                                                                                                      var image = this.state().get('image'),
                                                                                                                                                                          view = new wp.media.view.EditImage( { model: image, controller: this } ).render();
                                                                                                                                                              
                                                                                                                                                                      this.content.set( view );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 3 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7253..7261

                                                                                                                                                              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 100.

                                                                                                                                                              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

                                                                                                                                                                  deactivate: function() {
                                                                                                                                                                      // Stop watching for uploaded attachments.
                                                                                                                                                                      this.get('library').unobserve( wp.Uploader.queue );
                                                                                                                                                              
                                                                                                                                                                      this.frame.off( 'content:render:browse', this.renderSettings, this );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1126..1133

                                                                                                                                                              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 82.

                                                                                                                                                              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

                                                                                                                                                                  deactivate: function() {
                                                                                                                                                                      // Stop watching for uploaded attachments.
                                                                                                                                                                      this.get('library').unobserve( wp.Uploader.queue );
                                                                                                                                                              
                                                                                                                                                                      this.frame.off( 'content:render:browse', this.gallerySettings, this );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 219..226

                                                                                                                                                              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 82.

                                                                                                                                                              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

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

                                                                                                                                                                  activate: function() {
                                                                                                                                                                      this.frame.on( 'content:create:crop', this.createCropContent, this );
                                                                                                                                                                      this.frame.on( 'close', this.removeCropper, this );
                                                                                                                                                                      this.set('selection', new Backbone.Collection(this.frame._selection.single));
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 321..325

                                                                                                                                                              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 81.

                                                                                                                                                              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

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

                                                                                                                                                                  activate: function() {
                                                                                                                                                                      this.frame.on( 'content:create:crop', this.createCropContent, this );
                                                                                                                                                                      this.frame.on( 'close', this.removeCropper, this );
                                                                                                                                                                      this.set('selection', new Backbone.Collection(this.frame._selection.single));
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1935..1939

                                                                                                                                                              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 81.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          new Library({
                                                                                                                                                                              id:         'gallery',
                                                                                                                                                                              title:      l10n.createGalleryTitle,
                                                                                                                                                                              priority:   40,
                                                                                                                                                                              toolbar:    'main-gallery',
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6541..6553
                                                                                                                                                              wp-includes/js/media-views.js on lines 6574..6586

                                                                                                                                                              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 81.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          new Library({
                                                                                                                                                                              id:         'playlist',
                                                                                                                                                                              title:      l10n.createPlaylistTitle,
                                                                                                                                                                              priority:   60,
                                                                                                                                                                              toolbar:    'main-playlist',
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6513..6525
                                                                                                                                                              wp-includes/js/media-views.js on lines 6574..6586

                                                                                                                                                              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 81.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          new Library({
                                                                                                                                                                              id:         'video-playlist',
                                                                                                                                                                              title:      l10n.createVideoPlaylistTitle,
                                                                                                                                                                              priority:   60,
                                                                                                                                                                              toolbar:    'main-video-playlist',
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6513..6525
                                                                                                                                                              wp-includes/js/media-views.js on lines 6541..6553

                                                                                                                                                              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 81.

                                                                                                                                                              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 wp.media.controller.CollectionEdit({
                                                                                                                                                                              type: 'audio',
                                                                                                                                                                              collectionType: 'playlist',
                                                                                                                                                                              title:          l10n.editPlaylistTitle,
                                                                                                                                                                              SettingsView:   wp.media.view.Settings.Playlist,
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6588..6598

                                                                                                                                                              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 80.

                                                                                                                                                              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 wp.media.controller.CollectionEdit({
                                                                                                                                                                              type: 'video',
                                                                                                                                                                              collectionType: 'playlist',
                                                                                                                                                                              title:          l10n.editVideoPlaylistTitle,
                                                                                                                                                                              SettingsView:   wp.media.view.Settings.Playlist,
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 6556..6566

                                                                                                                                                              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 80.

                                                                                                                                                              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

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

                                                                                                                                                                      library.validator = function( attachment ) {
                                                                                                                                                                          return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments );
                                                                                                                                                                      };
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 92..94

                                                                                                                                                              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 78.

                                                                                                                                                              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

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

                                                                                                                                                                      library.validator = function( attachment ) {
                                                                                                                                                                          return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments );
                                                                                                                                                                      };
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 984..986

                                                                                                                                                              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 78.

                                                                                                                                                              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

                                                                                                                                                              /***/ 2356:
                                                                                                                                                              /***/ ((module) => {
                                                                                                                                                              
                                                                                                                                                              /**
                                                                                                                                                               * wp.media.view.Settings.Playlist
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 9035..9057

                                                                                                                                                              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 78.

                                                                                                                                                              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

                                                                                                                                                              /***/ 7266:
                                                                                                                                                              /***/ ((module) => {
                                                                                                                                                              
                                                                                                                                                              /**
                                                                                                                                                               * wp.media.view.Settings.Gallery
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 9059..9081

                                                                                                                                                              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 78.

                                                                                                                                                              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

                                                                                                                                                                  createRouter: function( router ) {
                                                                                                                                                                      router.view = new wp.media.view.Router({
                                                                                                                                                                          controller: this,
                                                                                                                                                              
                                                                                                                                                                          attributes: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7832..7843

                                                                                                                                                              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 77.

                                                                                                                                                              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

                                                                                                                                                                  createMenu: function( menu ) {
                                                                                                                                                                      menu.view = new wp.media.view.Menu({
                                                                                                                                                                          controller: this,
                                                                                                                                                              
                                                                                                                                                                          attributes: {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7865..7876

                                                                                                                                                              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 77.

                                                                                                                                                              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

                                                                                                                                                                  toggleCustomSize: function() {
                                                                                                                                                                      if ( this.model.get( 'size' ) !== 'custom' ) {
                                                                                                                                                                          this.$( '.custom-size' ).addClass('hidden');
                                                                                                                                                                      } else {
                                                                                                                                                                          this.$( '.custom-size' ).removeClass('hidden');
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7544..7550

                                                                                                                                                              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 75.

                                                                                                                                                              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

                                                                                                                                                                  toggleLinkSettings: function() {
                                                                                                                                                                      if ( this.model.get( 'link' ) === 'none' ) {
                                                                                                                                                                          this.$( '.link-settings' ).addClass('hidden');
                                                                                                                                                                      } else {
                                                                                                                                                                          this.$( '.link-settings' ).removeClass('hidden');
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 2 hrs to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 7552..7558

                                                                                                                                                              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 75.

                                                                                                                                                              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

                                                                                                                                                              /***/ 3443:
                                                                                                                                                              /***/ ((module) => {
                                                                                                                                                              
                                                                                                                                                              /**
                                                                                                                                                               * wp.media.view.Attachment.Library
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 3753..3776

                                                                                                                                                              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 71.

                                                                                                                                                              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

                                                                                                                                                              /***/ 5232:
                                                                                                                                                              /***/ ((module) => {
                                                                                                                                                              
                                                                                                                                                              /**
                                                                                                                                                               * wp.media.view.Attachment.EditLibrary
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 3804..3827

                                                                                                                                                              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 71.

                                                                                                                                                              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

                                                                                                                                                                      return {
                                                                                                                                                                          url:         this.model.get('url'),
                                                                                                                                                                          width:       this.model.get('width'),
                                                                                                                                                                          height:      this.model.get('height'),
                                                                                                                                                                          orientation: this.model.get('orientation')
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/jquery/ui/resizable.js on lines 141..146

                                                                                                                                                              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 70.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
                                                                                                                                                                              value: l10n.filterByDate,
                                                                                                                                                                              attributes: {
                                                                                                                                                                                  'for': 'media-attachment-date-filters'
                                                                                                                                                                              },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4532..4538
                                                                                                                                                              wp-includes/js/media-views.js on lines 4574..4580

                                                                                                                                                              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 69.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          this.toolbar.set( 'filtersLabel', new wp.media.view.Label({
                                                                                                                                                                              value: l10n.filterByType,
                                                                                                                                                                              attributes: {
                                                                                                                                                                                  'for':  'media-attachment-filters'
                                                                                                                                                                              },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4574..4580
                                                                                                                                                              wp-includes/js/media-views.js on lines 4696..4702

                                                                                                                                                              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 69.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                          this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({
                                                                                                                                                                              value: l10n.filterByDate,
                                                                                                                                                                              attributes: {
                                                                                                                                                                                  'for': 'media-attachment-date-filters'
                                                                                                                                                                              },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4532..4538
                                                                                                                                                              wp-includes/js/media-views.js on lines 4696..4702

                                                                                                                                                              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 69.

                                                                                                                                                              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

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

                                                                                                                                                                          this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
                                                                                                                                                                              controller: this.controller,
                                                                                                                                                                              model:      this.collection.props,
                                                                                                                                                                              priority: -75
                                                                                                                                                                          }).render() );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4581..4585

                                                                                                                                                              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 68.

                                                                                                                                                              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

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

                                                                                                                                                                          this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({
                                                                                                                                                                              controller: this.controller,
                                                                                                                                                                              model:      this.collection.props,
                                                                                                                                                                              priority: -75
                                                                                                                                                                          }).render() );
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4703..4707

                                                                                                                                                              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 68.

                                                                                                                                                              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

                                                                                                                                                                      attachmentsBrowserView.toolbar.set( 'reverse', {
                                                                                                                                                                          text:     l10n.reverseOrder,
                                                                                                                                                                          priority: 80,
                                                                                                                                                              
                                                                                                                                                                          click: function() {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1166..1173

                                                                                                                                                              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 65.

                                                                                                                                                              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

                                                                                                                                                                      browser.toolbar.set( 'reverse', {
                                                                                                                                                                          text:     l10n.reverseOrder,
                                                                                                                                                                          priority: 80,
                                                                                                                                                              
                                                                                                                                                                          click: function() {
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 267..274

                                                                                                                                                              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 65.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Select = wp.media.view.MediaFrame.Select,
                                                                                                                                                                  Library = wp.media.controller.Library,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  Post;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 181..185
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 401..404

                                                                                                                                                              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 62.

                                                                                                                                                              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

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

                                                                                                                                                                          click: function() {
                                                                                                                                                                              var state = controller.state(),
                                                                                                                                                                                  selection = state.get('selection');
                                                                                                                                                              
                                                                                                                                                                              controller.close();
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 1 hr to fix
                                                                                                                                                              wp-admin/js/widgets/media-widgets.js on lines 379..385

                                                                                                                                                              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 60.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Selection = wp.media.model.Selection,
                                                                                                                                                                  Library = wp.media.controller.Library,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  GalleryAdd;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 767..770
                                                                                                                                                              wp-includes/js/media-views.js on lines 1185..1188

                                                                                                                                                              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 58.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var State = wp.media.controller.State,
                                                                                                                                                                  Library = wp.media.controller.Library,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  ImageDetails;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 767..770
                                                                                                                                                              wp-includes/js/media-views.js on lines 895..898

                                                                                                                                                              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 58.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Attachment = wp.media.model.Attachment,
                                                                                                                                                                  Library = wp.media.controller.Library,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  FeaturedImage;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 1 hr to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 895..898
                                                                                                                                                              wp-includes/js/media-views.js on lines 1185..1188

                                                                                                                                                              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 58.

                                                                                                                                                              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 4 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  deactivate: function() {
                                                                                                                                                                      this.frame.off( 'open', this.updateSelection, this );
                                                                                                                                                              
                                                                                                                                                                      Library.prototype.deactivate.apply( this, arguments );
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 3 other locations - About 55 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 855..859
                                                                                                                                                              wp-includes/js/media-views.js on lines 1885..1889
                                                                                                                                                              wp-includes/js/media-views.js on lines 1894..1898

                                                                                                                                                              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 53.

                                                                                                                                                              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 4 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  activate: function() {
                                                                                                                                                                      this.frame.on( 'open', this.updateSelection, this );
                                                                                                                                                              
                                                                                                                                                                      Library.prototype.activate.apply( this, arguments );
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 3 other locations - About 55 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 864..868
                                                                                                                                                              wp-includes/js/media-views.js on lines 1885..1889
                                                                                                                                                              wp-includes/js/media-views.js on lines 1894..1898

                                                                                                                                                              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 53.

                                                                                                                                                              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 4 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  activate: function() {
                                                                                                                                                                      this.frame.on( 'content:render:browse', this.updateSelection, this );
                                                                                                                                                              
                                                                                                                                                                      Library.prototype.activate.apply( this, arguments );
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 3 other locations - About 55 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 855..859
                                                                                                                                                              wp-includes/js/media-views.js on lines 864..868
                                                                                                                                                              wp-includes/js/media-views.js on lines 1894..1898

                                                                                                                                                              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 53.

                                                                                                                                                              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 4 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  deactivate: function() {
                                                                                                                                                                      this.frame.off( 'content:render:browse', this.updateSelection, this );
                                                                                                                                                              
                                                                                                                                                                      Library.prototype.deactivate.apply( this, arguments );
                                                                                                                                                                  },
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 3 other locations - About 55 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 855..859
                                                                                                                                                              wp-includes/js/media-views.js on lines 864..868
                                                                                                                                                              wp-includes/js/media-views.js on lines 1885..1889

                                                                                                                                                              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 53.

                                                                                                                                                              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 ( wp.Uploader.limitExceeded || ! wp.Uploader.browser.supported ) {
                                                                                                                                                                          this.options.uploader = false;
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 55 mins to fix
                                                                                                                                                              wp-includes/js/media-grid.js on lines 742..744

                                                                                                                                                              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 53.

                                                                                                                                                              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

                                                                                                                                                                              Filters = new wp.media.view.AttachmentFilters.All({
                                                                                                                                                                                  controller: this.controller,
                                                                                                                                                                                  model:      this.collection.props,
                                                                                                                                                                                  priority:   -80
                                                                                                                                                                              });
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 50 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4541..4545

                                                                                                                                                              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 51.

                                                                                                                                                              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

                                                                                                                                                                  hide: function( id ) {
                                                                                                                                                                      var view = this.get( id );
                                                                                                                                                              
                                                                                                                                                                      if ( ! view ) {
                                                                                                                                                                          return;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 50 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 8230..8238

                                                                                                                                                              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 51.

                                                                                                                                                              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

                                                                                                                                                                  show: function( id ) {
                                                                                                                                                                      var view = this.get( id );
                                                                                                                                                              
                                                                                                                                                                      if ( ! view ) {
                                                                                                                                                                          return;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 50 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 8220..8228

                                                                                                                                                              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 51.

                                                                                                                                                              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

                                                                                                                                                                              this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({
                                                                                                                                                                                  controller: this.controller,
                                                                                                                                                                                  model:      this.collection.props,
                                                                                                                                                                                  priority:   -80
                                                                                                                                                                              }).render() );
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 50 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4547..4551

                                                                                                                                                              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 51.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  defaults: {
                                                                                                                                                                      id:      'image',
                                                                                                                                                                      url:     '',
                                                                                                                                                                      menu:    'image-details',
                                                                                                                                                                      content: 'image-details',
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 45 mins to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 203..212
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 422..431

                                                                                                                                                              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 50.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('library') ) {
                                                                                                                                                                          this.set( 'library', wp.media.query({ type: 'image' }) );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 40 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 823..825

                                                                                                                                                              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 49.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('library') ) {
                                                                                                                                                                          this.set( 'library', wp.media.query({ type: 'image' }) );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 40 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1853..1855

                                                                                                                                                              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 49.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('library') ) {
                                                                                                                                                                          this.set( 'library', new wp.media.model.Selection() );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 40 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 189..191

                                                                                                                                                              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 48.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('library') ) {
                                                                                                                                                                          this.set( 'library', new wp.media.model.Selection() );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 40 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1081..1083

                                                                                                                                                              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 48.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  events: {
                                                                                                                                                                      'change [data-setting]':          'updateSetting',
                                                                                                                                                                      'change [data-setting] input':    'updateSetting',
                                                                                                                                                                      'change [data-setting] select':   'updateSetting',
                                                                                                                                                                      'change [data-setting] textarea': 'updateSetting',
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 40 mins to fix
                                                                                                                                                              wp-admin/js/theme.js on lines 1621..1631
                                                                                                                                                              wp-includes/js/media-models.js on lines 1147..1157

                                                                                                                                                              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 48.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('AttachmentView') ) {
                                                                                                                                                                          this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 35 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 193..195

                                                                                                                                                              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 47.

                                                                                                                                                              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

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

                                                                                                                                                                      if ( ! this.get('AttachmentView') ) {
                                                                                                                                                                          this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 35 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 1086..1088

                                                                                                                                                              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 47.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Library = wp.media.controller.Library,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  $ = jQuery,
                                                                                                                                                                  CollectionEdit;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 35 mins to fix
                                                                                                                                                              wp-includes/js/media-grid.js on lines 406..410
                                                                                                                                                              wp-includes/js/media-views.js on lines 7661..7664

                                                                                                                                                              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 46.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                      if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) {
                                                                                                                                                                          this.controller.trigger( 'attachment:keydown:arrow', event );
                                                                                                                                                                          return;
                                                                                                                                                                      }
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 35 mins to fix
                                                                                                                                                              wp-admin/js/image-edit.js on lines 53..61
                                                                                                                                                              wp-admin/js/nav-menu.js on lines 555..556

                                                                                                                                                              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 46.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Frame = wp.media.view.Frame,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  $ = jQuery,
                                                                                                                                                                  MediaFrame;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 35 mins to fix
                                                                                                                                                              wp-includes/js/media-grid.js on lines 406..410
                                                                                                                                                              wp-includes/js/media-views.js on lines 117..120

                                                                                                                                                              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 46.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                                  events: {
                                                                                                                                                                      'click':                          'toggleSelectionHandler',
                                                                                                                                                                      'change [data-setting]':          'updateSetting',
                                                                                                                                                                      'change [data-setting] input':    'updateSetting',
                                                                                                                                                                      'change [data-setting] select':   'updateSetting',
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 35 mins to fix
                                                                                                                                                              wp-admin/js/customize-nav-menus.js on lines 157..166
                                                                                                                                                              wp-includes/js/plupload/moxie.js on lines 662..671

                                                                                                                                                              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 46.

                                                                                                                                                              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

                                                                                                                                                                      this.options.selection = new wp.media.model.Selection( this.image.attachment, { multiple: false } );
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 35 mins to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 299..299

                                                                                                                                                              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 46.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Select = wp.media.view.Toolbar.Select,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  Embed;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 264..266
                                                                                                                                                              wp-includes/js/media-views.js on lines 6252..6254

                                                                                                                                                              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 45.

                                                                                                                                                              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 3 locations. Consider refactoring.
                                                                                                                                                              Open

                                                                                                                                                              var Select = wp.media.view.MediaFrame.Select,
                                                                                                                                                                  l10n = wp.media.view.l10n,
                                                                                                                                                                  ImageDetails;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 2 other locations - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-audiovideo.js on lines 264..266
                                                                                                                                                              wp-includes/js/media-views.js on lines 9454..9456

                                                                                                                                                              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 45.

                                                                                                                                                              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 ( mediaTrash && 'trash' === model.get( 'status' ) ) {
                                                                                                                                                                                          model.set( 'status', 'inherit' );
                                                                                                                                                                                          changed.push( model.save() );
                                                                                                                                                                                          removed.push( model );
                                                                                                                                                                                      } else if ( mediaTrash ) {
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4631..4637

                                                                                                                                                              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 45.

                                                                                                                                                              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

                                                                                                                                                                          cropDetails.dst_width  = control.params.flex_width  ? control.params.height * ratio : control.params.width;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 502..502

                                                                                                                                                              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 45.

                                                                                                                                                              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

                                                                                                                                                                          cropDetails.dst_height = control.params.flex_height ? control.params.width  / ratio : control.params.height;
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 501..501

                                                                                                                                                              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 45.

                                                                                                                                                              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

                                                                                                                                                                                      } else if ( mediaTrash ) {
                                                                                                                                                                                          model.set( 'status', 'trash' );
                                                                                                                                                                                          changed.push( model.save() );
                                                                                                                                                                                          removed.push( model );
                                                                                                                                                                                      } else {
                                                                                                                                                              Severity: Minor
                                                                                                                                                              Found in wp-includes/js/media-views.js and 1 other location - About 30 mins to fix
                                                                                                                                                              wp-includes/js/media-views.js on lines 4627..4637

                                                                                                                                                              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 45.

                                                                                                                                                              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

                                                                                                                                                              There are no issues that match your filters.

                                                                                                                                                              Category
                                                                                                                                                              Status