CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/js/mce-view.js

Summary

Maintainability
D
3 days
Test Coverage

File mce-view.js has 432 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* global tinymce, MediaElementPlayer, WPPlaylistView */
/**
 * Note: this API is "experimental" meaning that it will probably change
 * in the next few releases based on feedback from 3.9.0.
 * If you decide to use it, please follow the development closely.
Severity: Minor
Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js - About 6 hrs to fix

    Function getHtml has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            getHtml: function() {
                var data = this.shortcode.attrs.named,
                    model = wp.media.playlist,
                    options,
                    attachments,
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js - About 2 hrs to fix

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

              setPlayer: function(e, node) {
                  // if the ready event fires on an empty node
                  if ( ! node ) {
                      return;
                  }
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js - About 1 hr to fix

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

                toViews: function( content ) {
                    var pieces = [ { content: content } ],
                        current;
        
                    _.each( views, function( view, viewType ) {
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js - About 1 hr to fix

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

              wp.mce.audio = _.extend( {}, wp.mce.media, {
                  shortcode: 'audio',
                  state: 'audio-details',
                  View: wp.mce.media.View.extend({
                      className: 'editor-audio',
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 2 hrs to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 513..520

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

          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

              wp.mce.video = _.extend( {}, wp.mce.media, {
                  shortcode: 'video',
                  state: 'video-details',
                  View: wp.mce.media.View.extend({
                      className: 'editor-video',
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 2 hrs to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 528..535

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

          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

                  toView:  function( content ) {
                      var match = wp.shortcode.next( this.shortcode, content );
          
                      if ( ! match ) {
                          return;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 2 hrs to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 363..377

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

          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

                  toView:  function( content ) {
                      var match = wp.shortcode.next( this.shortcode, content );
          
                      if ( ! match ) {
                          return;
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 2 hrs to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 257..271

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

          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

                      options = {
                          type: data.type,
                          style: data.style,
                          tracklist: data.tracklist,
                          tracknumbers: data.tracknumbers,
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 1 hr to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 655..662

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

          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

                          var size = {}, resize = {}, track = {
                              src : attachment.url,
                              type : attachment.mime,
                              title : attachment.title,
                              caption : attachment.caption,
          Severity: Major
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 1 hr to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 639..646

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

          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.dfd && 'pending' === this.dfd.state() && ! this.attachments.length ) {
                              return;
                          }
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 35 mins to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 631..633

          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.dfd && 'pending' === this.dfd.state() && ! this.attachments.length ) {
                          return;
                      }
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/mce-view.js and 1 other location - About 35 mins to fix
          Web.Admin/2014/wordpress/wp-includes/js/mce-view.js on lines 298..300

          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