phodal/congee

View on GitHub
ckeditor/plugins/widget/plugin.js

Summary

Maintainability
F
1 wk
Test Coverage

File plugin.js has 1672 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

Severity: Major
Found in ckeditor/plugins/widget/plugin.js - About 4 days to fix

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

        function setupDragAndDrop( widgetsRepo ) {
            var editor = widgetsRepo.editor,
                lineutils = CKEDITOR.plugins.lineutils;
    
            // These listeners handle inline and block widgets drag and drop.
    Severity: Major
    Found in ckeditor/plugins/widget/plugin.js - About 3 hrs to fix

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

              onLoad: function() {
                  CKEDITOR.addCss(
                      '.cke_widget_wrapper{' +
                          'position:relative;' +
                          'outline:none' +
      Severity: Major
      Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

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

            function copySingleWidget( widget, isCut ) {
                var editor = widget.editor,
                    doc = editor.document;
        
                // We're still handling previous copy/cut.
        Severity: Major
        Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

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

              function setupWidgetsLifecycleStart( widgetsRepo ) {
                  var editor = widgetsRepo.editor,
                      processedWidgetOnly,
                      snapshotLoaded;
          
          
          Severity: Major
          Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

            Function setupWidgetsLifecycleEnd has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function setupWidgetsLifecycleEnd( widgetsRepo ) {
                    var editor = widgetsRepo.editor,
                        downcastingSessions = {};
            
                    // Listen before htmlDP#htmlFilter is applied to cache all widgets, because we'll
            Severity: Major
            Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

              Function addWidgetCommand has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function addWidgetCommand( editor, widgetDef ) {
                      editor.addCommand( widgetDef.name, {
                          exec: function( editor, commandData ) {
                              var focused = editor.widgets.focused;
                              // If a widget of the same type is focused, start editing.
              Severity: Major
              Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

                Function setupMouseObserver has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function setupMouseObserver( widgetsRepo ) {
                        var editor = widgetsRepo.editor;
                
                        editor.on( 'contentDom', function() {
                            var editable = editor.editable(),
                Severity: Major
                Found in ckeditor/plugins/widget/plugin.js - About 2 hrs to fix

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

                          wrapElement: function( element, widgetName ) {
                              var wrapper = null,
                                  widgetDef,
                                  isInline;
                  
                  
                  Severity: Minor
                  Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                        function stateUpdater( widgetsRepo ) {
                            var currentlySelected = widgetsRepo.selected,
                                toBeSelected = [],
                                toBeDeselected = currentlySelected.slice( 0 ),
                                focused = null;
                    Severity: Minor
                    Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                  exec: function( editor, commandData ) {
                                      var focused = editor.widgets.focused;
                                      // If a widget of the same type is focused, start editing.
                                      if ( focused && focused.name == widgetDef.name )
                                          focused.edit();
                      Severity: Minor
                      Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                        Function createUpcastIterator has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function createUpcastIterator( widgetsRepo ) {
                                var toBeWrapped = [],
                                    upcasts = widgetsRepo._.upcasts,
                                    upcastCallbacks = widgetsRepo._.upcastCallbacks;
                        
                        
                        Severity: Minor
                        Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                              function setupDragHandler( widget ) {
                                  if ( !widget.draggable )
                                      return;
                          
                                  var editor = widget.editor,
                          Severity: Minor
                          Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                function onBlockWidgetDrag( evt ) {
                                    var finder = this.repository.finder,
                                        locator = this.repository.locator,
                                        liner = this.repository.liner,
                                        editor = this.editor,
                            Severity: Minor
                            Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                  function setupWidget( widget, widgetDef ) {
                                      setupWrapper( widget );
                                      setupParts( widget );
                                      setupEditables( widget );
                                      setupMask( widget );
                              Severity: Minor
                              Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                            iterator: function( element ) {
                                                var upcast, upcasted,
                                                    data,
                                                    i,
                                                    upcastsLength,
                                Severity: Minor
                                Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                                  Function edit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          edit: function() {
                                              var evtData = { dialog: this.dialog },
                                                  that = this;
                                  
                                              // Edit event was blocked or there's no dialog to be automatically opened.
                                  Severity: Minor
                                  Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                        function setupSelectionObserver( widgetsRepo ) {
                                            var editor = widgetsRepo.editor;
                                    
                                            editor.on( 'selectionCheck', function() {
                                                widgetsRepo.fire( 'checkSelection' );
                                    Severity: Minor
                                    Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                          function Widget( widgetsRepo, id, element, widgetDef, startupData ) {
                                              var editor = widgetsRepo.editor;
                                      
                                              // Extend this widget with widgetDef-specific methods and properties.
                                              CKEDITOR.tools.extend( this, widgetDef, {
                                      Severity: Minor
                                      Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

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

                                            function checkWidgets( evt ) {
                                                var options = evt.data;
                                        
                                                if ( this.editor.mode != 'wysiwyg' )
                                                    return;
                                        Severity: Minor
                                        Found in ckeditor/plugins/widget/plugin.js - About 1 hr to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                      if ( upcasted instanceof CKEDITOR.htmlParser.element )
                                                                          element = upcasted;
                                          Severity: Major
                                          Found in ckeditor/plugins/widget/plugin.js - About 45 mins to fix

                                            Function Widget has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                function Widget( widgetsRepo, id, element, widgetDef, startupData ) {
                                            Severity: Minor
                                            Found in ckeditor/plugins/widget/plugin.js - About 35 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                                          return false;
                                              Severity: Major
                                              Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                                                    return;
                                                Severity: Major
                                                Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                                  return null;
                                                  Severity: Major
                                                  Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                                                return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER;
                                                    Severity: Major
                                                    Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                      Avoid too many return statements within this function.
                                                      Open

                                                                  return wrapper;
                                                      Severity: Major
                                                      Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                        Avoid too many return statements within this function.
                                                        Open

                                                                                            return;
                                                        Severity: Major
                                                        Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                          Avoid too many return statements within this function.
                                                          Open

                                                                              return widgetDef.styleToAllowedContentRules( this );
                                                          Severity: Major
                                                          Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                        return null;
                                                            Severity: Major
                                                            Found in ckeditor/plugins/widget/plugin.js - About 30 mins to fix

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

                                                                              processedWidgetOnly = evt.data.dataValue.children.length == 1 &&
                                                                                  Widget.isParserWidgetWrapper( evt.data.dataValue.children[ 0 ] );
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 55 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 2777..2778

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

                                                              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

                                                                      setSelected: function( selected ) {
                                                                          this.wrapper[ selected ? 'addClass' : 'removeClass' ]( 'cke_widget_selected' );
                                                                          this.fire(  selected ? 'select' : 'deselect' );
                                                                          return this;
                                                                      },
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 55 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1430..1434

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

                                                              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

                                                                      setFocused: function( focused ) {
                                                                          this.wrapper[ focused ? 'addClass' : 'removeClass' ]( 'cke_widget_focused' );
                                                                          this.fire( focused ? 'focus' : 'blur' );
                                                                          return this;
                                                                      },
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 55 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1447..1451

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

                                                              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

                                                                              processedWidgetOnly = evt.data.dataValue.children.length == 3 &&
                                                                                  Widget.isParserWidgetWrapper( evt.data.dataValue.children[ 1 ] );
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 55 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 2780..2781

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

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

                                                                  Widget.isDomDragHandlerContainer = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && node.hasClass( 'cke_widget_drag_handler_container' );
                                                                  };
                                                              Severity: Major
                                                              Found in ckeditor/plugins/widget/plugin.js and 4 other locations - About 40 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1515..1517
                                                              ckeditor/plugins/widget/plugin.js on lines 1541..1543
                                                              ckeditor/plugins/widget/plugin.js on lines 1553..1555
                                                              ckeditor/plugins/widget/plugin.js on lines 1565..1567

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

                                                                  Widget.isDomWidgetElement = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-widget' );
                                                                  };
                                                              Severity: Major
                                                              Found in ckeditor/plugins/widget/plugin.js and 4 other locations - About 40 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1515..1517
                                                              ckeditor/plugins/widget/plugin.js on lines 1527..1529
                                                              ckeditor/plugins/widget/plugin.js on lines 1541..1543
                                                              ckeditor/plugins/widget/plugin.js on lines 1565..1567

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

                                                                  Widget.isDomDragHandler = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-drag-handler' );
                                                                  };
                                                              Severity: Major
                                                              Found in ckeditor/plugins/widget/plugin.js and 4 other locations - About 40 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1527..1529
                                                              ckeditor/plugins/widget/plugin.js on lines 1541..1543
                                                              ckeditor/plugins/widget/plugin.js on lines 1553..1555
                                                              ckeditor/plugins/widget/plugin.js on lines 1565..1567

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

                                                                  Widget.isDomNestedEditable = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-editable' );
                                                                  };
                                                              Severity: Major
                                                              Found in ckeditor/plugins/widget/plugin.js and 4 other locations - About 40 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1515..1517
                                                              ckeditor/plugins/widget/plugin.js on lines 1527..1529
                                                              ckeditor/plugins/widget/plugin.js on lines 1553..1555
                                                              ckeditor/plugins/widget/plugin.js on lines 1565..1567

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

                                                                  Widget.isDomWidgetWrapper = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && node.hasAttribute( 'data-cke-widget-wrapper' );
                                                                  };
                                                              Severity: Major
                                                              Found in ckeditor/plugins/widget/plugin.js and 4 other locations - About 40 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1515..1517
                                                              ckeditor/plugins/widget/plugin.js on lines 1527..1529
                                                              ckeditor/plugins/widget/plugin.js on lines 1541..1543
                                                              ckeditor/plugins/widget/plugin.js on lines 1553..1555

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

                                                                  Widget.isParserWidgetElement = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && !!node.attributes[ 'data-widget' ];
                                                                  };
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 35 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1589..1591

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

                                                                  Widget.isParserWidgetWrapper = function( node ) {
                                                                      return node.type == CKEDITOR.NODE_ELEMENT && !!node.attributes[ 'data-cke-widget-wrapper' ];
                                                                  };
                                                              Severity: Minor
                                                              Found in ckeditor/plugins/widget/plugin.js and 1 other location - About 35 mins to fix
                                                              ckeditor/plugins/widget/plugin.js on lines 1577..1579

                                                              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