awsmug/torro-forms

View on GitHub
assets/dist/js/admin-form-builder.js

Summary

Maintainability
F
4 mos
Test Coverage

File admin-form-builder.js has 1714 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Torro Forms Version 1.0.8 (https://torro-forms.com)
 * Licensed under GNU General Public License v2 (or later) (http://www.gnu.org/licenses/gpl-2.0.html)
 */
window.torro = window.torro || {};
Severity: Major
Found in assets/dist/js/admin-form-builder.js - About 4 days to fix

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

        function parseFields( fields, element ) {
            var parsedFields = [];
            var hasLabel = false;
    
            _.each( fields, function( field ) {
    Severity: Major
    Found in assets/dist/js/admin-form-builder.js - About 7 hrs to fix

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

              init: function() {
                  if ( ! this.$el.length ) {
                      console.error( i18n.couldNotInitCanvas );
                      return;
                  }
      Severity: Major
      Found in assets/dist/js/admin-form-builder.js - About 2 hrs to fix

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

                setupInitialData: function( form ) {
                    var container, element, elementChoice, elementSetting, elementParents, i;
        
                    if ( ! _.contains( initialized, this.instanceCount ) ) {
                        return;
        Severity: Major
        Found in assets/dist/js/admin-form-builder.js - About 2 hrs to fix

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

                                  success: function( elementTypes ) {
                                      this.elementTypes = torro.Builder.ElementTypes.fromApiCollection( elementTypes );
          
                                      if ( 'auto-draft' !== $( '#original_post_status' ).val() ) {
                                          ( new torro.api.models.Form({
          Severity: Minor
          Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

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

                    editLabel: function() {
                        var container = this.container;
                        var $original = this.$tab.find( 'span' );
                        var $replacement;
            
            
            Severity: Minor
            Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

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

                      attach: function() {
                          var updateElementChoicesSorted = _.bind( this.updateElementChoicesSorted, this );
              
                          this.element.on( 'remove', this.listenRemove, this );
                          this.element.on( 'change:label', this.listenChangeLabel, this );
              Severity: Minor
              Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

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

                        listenTypeChanged: function( element, type ) {
                            var sections, settingFields, settingNames, oldSettings = {};
                
                            element.element_type = torroBuilder.getInstance().elementTypes.get( type );
                            if ( ! element.element_type ) {
                Severity: Minor
                Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

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

                      function ContainerView( container, options ) {
                          var id       = container.get( 'id' );
                          var selected = container.get( 'id' ) === container.collection.props.get( 'selected' );
                  
                          this.container = container;
                  Severity: Minor
                  Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

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

                        torro.askConfirmation = function( message, successCallback ) {
                            var $dialog = $( '<div />' );
                    
                            $dialog.html( message );
                    
                    
                    Severity: Minor
                    Found in assets/dist/js/admin-form-builder.js - About 1 hr to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  for ( i = 0; i < form._embedded.element_choices[0].length; i++ ) {
                                                      elementChoice = form._embedded.element_choices[0][ i ];
                      
                                                      if ( elementParents[ elementChoice.element_id ] ) {
                                                          container = this.form.containers.get( elementParents[ elementChoice.element_id ] );
                      Severity: Major
                      Found in assets/dist/js/admin-form-builder.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if ( container ) {
                                                        container.elements.add( element );
                        
                                                        elementParents[ element.id ] = element.container_id;
                                                    }
                        Severity: Major
                        Found in assets/dist/js/admin-form-builder.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      for ( i = 0; i < form._embedded.element_settings[0].length; i++ ) {
                                                          elementSetting = form._embedded.element_settings[0][ i ];
                          
                                                          if ( elementParents[ elementSetting.element_id ] ) {
                                                              container = this.form.containers.get( elementParents[ elementSetting.element_id ] );
                          Severity: Major
                          Found in assets/dist/js/admin-form-builder.js - About 45 mins to fix

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

                            ( function( torro, $, _, fieldsAPI, dummyFieldManager ) {
                                'use strict';
                            
                                function deepClone( input ) {
                                    var output = _.clone( input );
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 mo to fix
                            assets/src/js/admin-form-builder/views/element-view.js on lines 1..701

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

                            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

                            ( function( torro, $, _ ) {
                                'use strict';
                            
                                /**
                                 * A container view.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 2 wks to fix
                            assets/src/js/admin-form-builder/views/container-view.js on lines 1..259

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

                            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

                            ( function( torro, $, _, i18n ) {
                                'use strict';
                            
                                var instanceCount = 0,
                                    initialized = [],
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 2 wks to fix
                            assets/src/js/admin-form-builder/app.js on lines 3..418

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

                            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

                            ( function( torro, _, Backbone, wp ) {
                                'use strict';
                            
                                var Frame = wp.media.view.Frame;
                                var AddElementFrame;
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 wk to fix
                            assets/src/js/admin-form-builder/add-element/add-element-frame-view.js on lines 1..161

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A single element.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 5 days to fix
                            assets/src/js/admin-form-builder/models/element-model.js on lines 1..179

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

                            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

                            ( function( torro, $, _ ) {
                                'use strict';
                            
                                /**
                                 * A form view.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 5 days to fix
                            assets/src/js/admin-form-builder/views/form-view.js on lines 1..94

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 840.

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A collection of containers.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 3 days to fix
                            assets/src/js/admin-form-builder/collections/container-collection.js on lines 1..99

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

                            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

                            ( function( torro, $, _, Backbone, wp ) {
                                'use strict';
                            
                                var View = wp.media.View;
                                var ElementTypesBrowser;
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 3 days to fix
                            assets/src/js/admin-form-builder/add-element/element-types-browser-view.js on lines 1..61

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

                            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

                            ( function( torroBuilder, torro, _, Backbone ) {
                                'use strict';
                            
                                /**
                                 * Base for a form builder model.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 2 days to fix
                            assets/src/js/admin-form-builder/base-model.js on lines 1..86

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * An element type.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/element-type.js on lines 1..152

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

                            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

                            ( function( torro, _, wp ) {
                                'use strict';
                            
                                var Toolbar = wp.media.view.Toolbar;
                                var InsertElementToolbar;
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/add-element/insert-element-toolbar-view.js on lines 1..35

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A list of available element types.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/element-types.js on lines 1..80

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

                            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

                            ( function( torroBuilder ) {
                                'use strict';
                            
                                /**
                                 * A collection of elements.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/collections/element-collection.js on lines 1..73

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

                            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

                            ( function( torroBuilder, torro, _, Backbone ) {
                                'use strict';
                            
                                /**
                                 * Base for a form builder collection.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/base-collection.js on lines 1..70

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

                            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

                            ( function( $ ) {
                                'use strict';
                            
                                $( '.torro-metabox-tab' ).on( 'click', function( e ) {
                                    var $this = $( this );
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/metabox-tabs.js on lines 1..25

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A single container.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/models/container-model.js on lines 1..63

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

                            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

                            ( function( torro, Backbone, wp ) {
                                'use strict';
                            
                                var State = wp.media.controller.State;
                                var ElementTypeLibrary;
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 day to fix
                            assets/src/js/admin-form-builder/add-element/element-type-library-state.js on lines 1..31

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 216.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            ( function( torroBuilder ) {
                                'use strict';
                            
                                /**
                                 * A single form.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 7 hrs to fix
                            assets/src/js/admin-form-builder/models/form-model.js on lines 1..65

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A single element choice.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 4 hrs to fix
                            assets/src/js/admin-form-builder/models/element-choice-model.js on lines 1..31

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 127.

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

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

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

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

                            Refactorings

                            Further Reading

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

                            ( function( torroBuilder ) {
                                'use strict';
                            
                                /**
                                 * A collection of element choices.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 3 other locations - About 4 hrs to fix
                            assets/dist/js/admin-form-builder.js on lines 1713..1769
                            assets/src/js/admin-form-builder/collections/element-choice-collection.js on lines 1..57
                            assets/src/js/admin-form-builder/collections/element-setting-collection.js on lines 1..57

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

                            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

                            ( function( torroBuilder ) {
                                'use strict';
                            
                                /**
                                 * A collection of element settings.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 3 other locations - About 4 hrs to fix
                            assets/dist/js/admin-form-builder.js on lines 1581..1637
                            assets/src/js/admin-form-builder/collections/element-choice-collection.js on lines 1..57
                            assets/src/js/admin-form-builder/collections/element-setting-collection.js on lines 1..57

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

                            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

                            ( function( torroBuilder, _ ) {
                                'use strict';
                            
                                /**
                                 * A single element setting.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 4 hrs to fix
                            assets/src/js/admin-form-builder/models/element-setting-model.js on lines 1..30

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

                            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

                            ( function( torroBuilder ) {
                                'use strict';
                            
                                /**
                                 * A collection of forms.
                            Severity: Major
                            Found in assets/dist/js/admin-form-builder.js and 1 other location - About 1 hr to fix
                            assets/src/js/admin-form-builder/collections/form-collection.js on lines 1..31

                            Duplicated Code

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

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

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

                            Tuning

                            This issue has a mass of 70.

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

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

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

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

                            Refactorings

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status