CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js

Summary

Maintainability
F
6 days
Test Coverage

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

/* global _wpMediaViewsL10n, _wpmejsSettings, MediaElementPlayer */

(function($, _, Backbone) {
    var media = wp.media,
        baseSettings = {},
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js - About 1 day to fix

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

            createStates: function() {
                this.states.add([
                    new media.controller.VideoDetails({
                        media: this.media
                    }),
    Severity: Minor
    Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js - About 1 hr to fix

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

          media.controller.VideoDetails = media.controller.State.extend({
              defaults: {
                  id: 'video-details',
                  toolbar: 'video-details',
                  title: l10n.videoDetailsTitle,
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 5 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 350..365

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

      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

          media.controller.AudioDetails = media.controller.State.extend({
              defaults: {
                  id: 'audio-details',
                  toolbar: 'audio-details',
                  title: l10n.audioDetailsTitle,
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 5 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 374..389

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

      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

              shortcode : function( model ) {
                  var self = this, content;
      
                  _.each( this.defaults, function( value, key ) {
                      model[ key ] = self.coerce( model, key );
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 5 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 282..301

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

      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

              shortcode : function( model ) {
                  var self = this, content;
      
                  _.each( this.defaults, function( value, key ) {
                      model[ key ] = self.coerce( model, key );
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 5 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 221..240

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

      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

              initialize: function( options ) {
                  options.DetailsView = media.view.AudioDetails;
                  options.cancelText = l10n.audioDetailsCancel;
                  options.addText = l10n.audioAddSourceTitle;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 2 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 606..612

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

      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

              initialize: function( options ) {
                  options.DetailsView = media.view.VideoDetails;
                  options.cancelText = l10n.videoDetailsCancel;
                  options.addText = l10n.videoAddSourceTitle;
      
      
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 2 hrs to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 539..545

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

      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.setPrimaryButton( l10n.replace, function( controller, state ) {
                      var attachment = state.get( 'selection' ).single();
                      controller.media.changeAttachment( attachment );
                      state.trigger( 'replace', controller.media.toJSON() );
                  } );
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 1 hr to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 506..510

      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

                  this.setPrimaryButton( this.addText, function( controller, state ) {
                      var attachment = state.get( 'selection' ).single();
                      controller.media.setSource( attachment );
                      state.trigger( 'add-source', controller.media.toJSON() );
                  } );
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 1 hr to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 498..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 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 4 locations. Consider refactoring.
      Open

                      new media.controller.MediaLibrary( {
                          type: 'audio',
                          id: 'replace-audio',
                          title: l10n.audioReplaceTitle,
                          toolbar: 'replace-audio',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 629..636
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 647..654
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 656..663

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

      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

                      new media.controller.MediaLibrary( {
                          type: 'video',
                          id: 'replace-video',
                          title: l10n.videoReplaceTitle,
                          toolbar: 'replace-video',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 560..567
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 647..654
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 656..663

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

      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

                      new media.controller.MediaLibrary( {
                          type: 'image',
                          id: 'select-poster-image',
                          title: l10n.videoSelectPosterImageTitle,
                          toolbar: 'select-poster-image',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 560..567
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 629..636
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 656..663

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

      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 media.controller.MediaLibrary( {
                          type: 'video',
                          id: 'add-video-source',
                          title: l10n.videoAddSourceTitle,
                          toolbar: 'add-video-source',
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 569..576

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

      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

                      new media.controller.MediaLibrary( {
                          type: 'text',
                          id: 'add-track',
                          title: l10n.videoAddTrackTitle,
                          toolbar: 'add-track',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 560..567
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 629..636
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 647..654

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

      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 media.controller.MediaLibrary( {
                          type: 'audio',
                          id: 'add-audio-source',
                          title: l10n.audioAddSourceTitle,
                          toolbar: 'add-audio-source',
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 50 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 638..645

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

      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

              defaults: {
                  id:      'audio',
                  url:     '',
                  menu:    'audio-details',
                  content: 'audio-details',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 45 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 595..604
      Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1329..1339
      Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 2743..2752

      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

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

              defaults: {
                  id:      'video',
                  url:     '',
                  menu:    'video-details',
                  content: 'video-details',
      Severity: Major
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 3 other locations - About 45 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js on lines 528..537
      Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 1329..1339
      Web.Admin/2014/wordpress/wp-includes/js/media-views.js on lines 2743..2752

      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 ( 'flash' === mejs.pluginType && autoplay ) {
                      mejs.addEventListener( 'canplay', function() {
                          mejs.play();
                      }, false );
                  }
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/media-audiovideo.js and 1 other location - About 35 mins to fix
      Web.Admin/2014/wordpress/wp-includes/js/mediaelement/wp-mediaelement.js on lines 20..24

      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

      There are no issues that match your filters.

      Category
      Status