ikuseiGmbH/smart-village-app-cms

View on GitHub
lib/jsonform.js

Summary

Maintainability
F
3 wks
Test Coverage

File jsonform.js has 2407 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* Copyright (c) 2012 Joshfire - MIT license */
/**
 * @fileoverview Core of the JSON Form client-side library.
 *
 * Generates an HTML form from a structured data model and a layout description.
Severity: Major
Found in lib/jsonform.js - About 6 days to fix

    Function buildFromLayout has 167 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    formTree.prototype.buildFromLayout = function (formElement, context) {
      var schemaElement = null;
      var node = new formNode();
      var view = null;
      var key = null;
    Severity: Major
    Found in lib/jsonform.js - About 6 hrs to fix

      Function computeInitialValues has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      formNode.prototype.computeInitialValues = function (values, ignoreDefaultValues) {
        var self = this;
        var node = null;
        var nbChildren = 1;
        var i = 0;
      Severity: Major
      Found in lib/jsonform.js - About 6 hrs to fix

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

            'onInsert': function (evt, node) {
              var $nodeid = $(node.el).find('#' + escapeSelector(node.id));
              var boundaries = node.getArrayBoundaries();
        
              var moveNodeTo = function (fromIdx, toIdx) {
        Severity: Major
        Found in lib/jsonform.js - About 4 hrs to fix

          Function onInsert has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              'onInsert': function (evt, node) {
                var $nodeid = $(node.el).find('#' + escapeSelector(node.id));
                var boundaries = node.getArrayBoundaries();
          
                // Switch two nodes in an array
          Severity: Major
          Found in lib/jsonform.js - About 3 hrs to fix

            Function getFormValues has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            formNode.prototype.getFormValues = function (updateArrayPath) {
              // The values object that will be returned
              var values = {};
            
              if (!this.el) {
            Severity: Major
            Found in lib/jsonform.js - About 2 hrs to fix

              Function onBeforeRender has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  'onBeforeRender': function (data, node) {
                    // Before rendering, this function ensures that:
                    // 1. direct children have IDs (used to show/hide the tabs contents)
                    // 2. the tab to active is flagged accordingly. The active tab is
                    // the first one, except if form values are available, in which case
              Severity: Major
              Found in lib/jsonform.js - About 2 hrs to fix

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

                var getInitialValue = function (formObject, key, arrayPath, tpldata, usePreviousValues) {
                  var value = null;
                
                  // Complete template data for template function
                  tpldata = tpldata || {};
                Severity: Major
                Found in lib/jsonform.js - About 2 hrs to fix

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

                  formNode.prototype.enhance = function () {
                    var node = this;
                    var handlers = null;
                    var handler = null;
                    var formData = _.clone(this.ownerTree.formDesc.tpldata) || {};
                  Severity: Major
                  Found in lib/jsonform.js - About 2 hrs to fix

                    Function getArrayBoundaries has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    formNode.prototype.getArrayBoundaries = function () {
                      var boundaries = {
                        minItems: -1,
                        maxItems: -1
                      };
                    Severity: Major
                    Found in lib/jsonform.js - About 2 hrs to fix

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

                      jsonform.util.setObjKey = function(obj,key,value) {
                        var innerobj = obj;
                        var keyparts = key.split(".");
                        var subkey = null;
                        var arrayMatch = null;
                      Severity: Major
                      Found in lib/jsonform.js - About 2 hrs to fix

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

                          var getNodeBoundaries = function (node, initialNode) {
                            var schemaKey = null;
                            var arrayKey = null;
                            var boundaries = {
                              minItems: -1,
                        Severity: Major
                        Found in lib/jsonform.js - About 2 hrs to fix

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

                          var initializeTabs = function (tabs) {
                            var activate = function (element, container) {
                              container
                                .find('> .active')
                                .removeClass('active');
                          Severity: Major
                          Found in lib/jsonform.js - About 2 hrs to fix

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

                            formNode.prototype.generate = function () {
                              var data = {
                                id: this.id,
                                keydash: this.keydash,
                                elt: this.formElement,
                            Severity: Major
                            Found in lib/jsonform.js - About 2 hrs to fix

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

                                  'onInsert': function (evt, node) {
                                    var activeClass = 'active';
                                    var elt = node.formElement || {};
                                    if (elt.activeClass) {
                                      activeClass += ' ' + elt.activeClass;
                              Severity: Minor
                              Found in lib/jsonform.js - About 1 hr to fix

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

                                    'onInsert': function (evt, node) {
                                      var setup = function () {
                                        var formElement = node.formElement || {};
                                        var ace = window.ace;
                                        var editor = ace.edit($(node.el).find('#' + escapeSelector(node.id) + '__ace').get(0));
                                Severity: Minor
                                Found in lib/jsonform.js - About 1 hr to fix

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

                                  jsonform.fieldTemplate = function(inner) {
                                    return '<div ' +
                                      '<% for(var key in elt.htmlMetaData) {%>' +
                                        '<%= key %>="<%= elt.htmlMetaData[key] %>" ' +
                                      '<% }%>' +
                                  Severity: Minor
                                  Found in lib/jsonform.js - About 1 hr to fix

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

                                    jsonform.util.getObjKey = function (obj, key, ignoreArrays) {
                                      var innerobj = obj;
                                      var keyparts = key.split(".");
                                      var subkey = null;
                                      var arrayMatch = null;
                                    Severity: Minor
                                    Found in lib/jsonform.js - About 1 hr to fix

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

                                          'onChange': function (evt, elt) {
                                            // The "transloadit" function should be called only once to enable
                                            // the service when the form is submitted. Has it already been done?
                                            if (elt.ownerTree._transloadit_bound) {
                                              return false;
                                      Severity: Minor
                                      Found in lib/jsonform.js - About 1 hr to fix

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

                                            'onChange': function(evt,elt) {
                                              // The "transloadit" function should be called only once to enable
                                              // the service when the form is submitted. Has it already been done?
                                              if (elt.ownerTree._transloadit_bound) {
                                                return false;
                                        Severity: Minor
                                        Found in lib/jsonform.js - About 1 hr to fix

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

                                              'onInsert': function (evt, node) {
                                                $(node.el).on('click', '.dropdown-menu a', function (evt) {
                                                  evt.preventDefault();
                                                  evt.stopPropagation();
                                                  var img = (evt.target.nodeName.toLowerCase() === 'img') ?
                                          Severity: Minor
                                          Found in lib/jsonform.js - About 1 hr to fix

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

                                            formTree.prototype.initialize = function (formDesc) {
                                              formDesc = formDesc || {};
                                            
                                              // Keep a pointer to the initial JSONForm
                                              // (note clone returns a shallow copy, only first-level is cloned)
                                            Severity: Minor
                                            Found in lib/jsonform.js - About 1 hr to fix

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

                                              formTree.prototype.validate = function(noErrorDisplay) {
                                              
                                                var values = jsonform.getFormValue(this.domRoot);
                                                var errors = false;
                                              
                                              
                                              Severity: Minor
                                              Found in lib/jsonform.js - About 1 hr to fix

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

                                                      var updateTabs = function (selIdx) {
                                                        var tabs = '';
                                                        var activateFirstTab = false;
                                                        if (selIdx === undefined) {
                                                          selIdx = $('> .tabbable > .nav-tabs .active', $nodeid).data('idx');
                                                Severity: Minor
                                                Found in lib/jsonform.js - About 1 hr to fix

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

                                                  formNode.prototype.getPreviousNumberOfItems = function (values, arrayPath) {
                                                    var key = null;
                                                    var arrayValue = null;
                                                    var childNumbers = null;
                                                    var idx = 0;
                                                  Severity: Minor
                                                  Found in lib/jsonform.js - About 1 hr to fix

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

                                                    formTree.prototype.submit = function(evt) {
                                                    
                                                      var stopEvent = function() {
                                                        if (evt) {
                                                          evt.preventDefault();
                                                    Severity: Minor
                                                    Found in lib/jsonform.js - About 1 hr to fix

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

                                                      formNode.prototype.resetValues = function () {
                                                        var params = null;
                                                        var idx = 0;
                                                      
                                                        // Reset value
                                                      Severity: Minor
                                                      Found in lib/jsonform.js - About 1 hr to fix

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

                                                        formTree.prototype.hasRequiredField = function () {
                                                          var parseElement = function (element) {
                                                            if (!element) return null;
                                                            if (element.required && (element.type !== 'boolean')) {
                                                              return element;
                                                        Severity: Minor
                                                        Found in lib/jsonform.js - About 1 hr to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                            if (formElement.key) {
                                                              // The form element is directly linked to an element in the JSON
                                                              // schema. The properties of the form element override those of the
                                                              // element in the JSON schema. Properties from the JSON schema complete
                                                              // those of the form element otherwise.
                                                          Severity: Major
                                                          Found in lib/jsonform.js - About 1 hr to fix

                                                            Avoid deeply nested control flow statements.
                                                            Open

                                                                    if (_.isString(this.value)) {
                                                                      if (this.value.indexOf('{{values.') !== -1) {
                                                                        // This label wants to use the value of another input field.
                                                                        // Convert that construct into {{jsonform.getValue(key)}} for
                                                                        // Underscore to call the appropriate function of formData
                                                            Severity: Major
                                                            Found in lib/jsonform.js - About 45 mins to fix

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

                                                              var getInitialValue = function (formObject, key, arrayPath, tpldata, usePreviousValues) {
                                                              Severity: Minor
                                                              Found in lib/jsonform.js - About 35 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                  return false;
                                                                Severity: Major
                                                                Found in lib/jsonform.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                      return _.max(childNumbers) || 0;
                                                                  Severity: Major
                                                                  Found in lib/jsonform.js - About 30 mins to fix

                                                                    TODO found
                                                                    Open

                                                                     * TODO: update getFormValues to work even if node is not rendered, using
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                        // TODO: find some way to register event handlers even when this.el is not set.
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                              // TODO: report the error to the user
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                              // TODO: report the error to the user
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                      // TODO: handle on the formElement.options, because user can setup it too.
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                            // TODO: synchronize field values and data structure completely and
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                        // TODO: use default values at the array level when form has not been
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                        // TODO: it's rather unclean to pass it through the schema.
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                            //TODO this is clearly sub-optimal
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                            // TODO: synchronize field values and data structure completely and
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                     * TODO: when current node is not in the DOM, extract values from formNode.value
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                          // TODO: the child template may introduce more than one level,
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                          // TODO: check this, there may exist corner cases with this approach
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                        //TODO is this due to a serialization bug?
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                      // TODO: move that to formTree.render
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

                                                                    TODO found
                                                                    Open

                                                                          // TODO: Add support for other event handlers
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by fixme

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

                                                                        'onInsert': function (evt, node) {
                                                                          $(node.el).find('a._jsonform-delete').on('click', function (evt) {
                                                                            $(node.el).find('._jsonform-preview').remove();
                                                                            $(node.el).find('a._jsonform-delete').remove();
                                                                            $(node.el).find('#' + escapeSelector(node.id)).val('');
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 5 hrs to fix
                                                                    lib/jsonform.js on lines 542..550

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                        'onInsert': function (evt, node) {
                                                                          $(node.el).find('a._jsonform-delete').on('click', function (evt) {
                                                                            $(node.el).find('._jsonform-preview').remove();
                                                                            $(node.el).find('a._jsonform-delete').remove();
                                                                            $(node.el).find('#' + escapeSelector(node.id)).val('');
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 5 hrs to fix
                                                                    lib/jsonform.js on lines 616..624

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (typeof node.schemaElement.maximum !== 'undefined') {
                                                                            if (node.schemaElement.exclusiveMaximum) {
                                                                              data.range.max = node.schemaElement.maximum - data.range.step;
                                                                            }
                                                                            else {
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 3 hrs to fix
                                                                    lib/jsonform.js on lines 302..309

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (typeof node.schemaElement.minimum !== 'undefined') {
                                                                            if (node.schemaElement.exclusiveMinimum) {
                                                                              data.range.min = node.schemaElement.minimum + data.range.step;
                                                                            }
                                                                            else {
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 3 hrs to fix
                                                                    lib/jsonform.js on lines 310..317

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (node.options.length > maxColumns) {
                                                                            nbRows = Math.ceil(node.options.length / maxColumns);
                                                                            data.columns = Math.ceil(node.options.length / nbRows);
                                                                          }
                                                                          else {
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 738..744

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 92.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (node.options.length > maxColumns) {
                                                                            nbRows = Math.ceil(node.options.length / maxColumns);
                                                                            data.columns = Math.ceil(node.options.length / nbRows);
                                                                          }
                                                                          else {
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 670..676

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 92.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          while (true) {
                                                                            if (!_.isArray(innerobj[prop])) {
                                                                              innerobj[prop] = [];
                                                                            }
                                                                            innerobj = innerobj[prop];
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 1533..1541

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                        while (true) {
                                                                          if (!_.isArray(innerobj[prop])) {
                                                                            innerobj[prop] = [];
                                                                          }
                                                                          innerobj = innerobj[prop];
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 1502..1510

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            if (fromIdx < toIdx) {
                                                                              if (fromIdx === 0) parentEl.prepend(fromEl);
                                                                              else $(node.children[fromIdx-1].el).after(fromEl);
                                                                              $(node.children[toIdx-1].el).after(toEl);
                                                                            }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 894..898

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 85.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            else {
                                                                              if (toIdx === 0) parentEl.prepend(toEl);
                                                                              else $(node.children[toIdx-1].el).after(toEl);
                                                                              $(node.children[fromIdx-1].el).after(fromEl);
                                                                            }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 889..893

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                      if (this.parentNode) {
                                                                        this.arrayPath = _.clone(this.parentNode.arrayPath);
                                                                        if (this.parentNode.view && this.parentNode.view.array) {
                                                                          this.arrayPath.push(this.childPos);
                                                                        }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 2110..2118

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 81.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                      if (this.parentNode) {
                                                                        this.arrayPath = _.clone(this.parentNode.arrayPath);
                                                                        if (this.parentNode.view && this.parentNode.view.array) {
                                                                          this.arrayPath.push(this.childPos);
                                                                        }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 2029..2037

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 81.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            if (subBoundaries.minItems !== -1) {
                                                                              if (boundaries.minItems !== -1) {
                                                                                boundaries.minItems = Math.max(
                                                                                  boundaries.minItems,
                                                                                  subBoundaries.minItems
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 2947..2957

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 81.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            if (subBoundaries.maxItems !== -1) {
                                                                              if (boundaries.maxItems !== -1) {
                                                                                boundaries.maxItems = Math.min(
                                                                                  boundaries.maxItems,
                                                                                  subBoundaries.maxItems
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 2 hrs to fix
                                                                    lib/jsonform.js on lines 2936..2946

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 81.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                      'authfieldset': {
                                                                        'template': '<fieldset' +
                                                                          '<% if (id) { %> id="<%= id %>"<% } %>' +
                                                                          ' class="expandable <%= elt.htmlClass?elt.htmlClass:"" %>">' +
                                                                          '<legend>Authentication settings</legend>' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 1150..1162
                                                                    lib/jsonform.js on lines 1163..1175

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 70.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                      'advancedfieldset': {
                                                                        'template': '<fieldset' +
                                                                          '<% if (id) { %> id="<%= id %>"<% } %>' +
                                                                          ' class="expandable <%= elt.htmlClass?elt.htmlClass:"" %>">' +
                                                                          '<legend>Advanced options</legend>' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 1150..1162
                                                                    lib/jsonform.js on lines 1176..1188

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 70.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                      'fieldset': {
                                                                        'template': '<fieldset class="form-group jsonform-error-<%= keydash %> <% if (elt.expandable) { %>expandable<% } %> <%= elt.htmlClass?elt.htmlClass:"" %>" ' +
                                                                          '<% if (id) { %> id="<%= id %>"<% } %>' +
                                                                          '>' +
                                                                          '<% if (node.title || node.legend) { %><legend><%= node.title || node.legend %></legend><% } %>' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 1163..1175
                                                                    lib/jsonform.js on lines 1176..1188

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 70.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                              formData.idx = (node.arrayPath.length > 0) ?
                                                                                node.arrayPath[node.arrayPath.length-1] + 1 :
                                                                                node.childPos + 1;
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 1 hr to fix
                                                                    lib/jsonform.js on lines 2782..2784

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

                                                                    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

                                                                              formData.idx = (node.arrayPath.length > 0) ?
                                                                                node.arrayPath[node.arrayPath.length-1] + 1 :
                                                                                node.childPos + 1;
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 1 hr to fix
                                                                    lib/jsonform.js on lines 2329..2331

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                        'template': '<div>' +
                                                                          '<input type="hidden" name="<%= node.name %>" id="<%= node.id %>" value="<%= value %>" />' +
                                                                          '<div class="dropdown">' +
                                                                          '<a class="btn<% if (buttonClass && node.value) { %> <%= buttonClass %><% } else { %> btn-default<% } %>" data-toggle="dropdown" href="#"<% if (node.value) { %> style="max-width:<%= width %>px;max-height:<%= height %>px"<% } %>>' +
                                                                            '<% if (node.value) { %><img src="<% if (!node.value.match(/^https?:/)) { %><%= prefix %><% } %><%= node.value %><%= suffix %>" alt="" /><% } else { %><%= buttonTitle %><% } %>' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 716..729
                                                                    lib/jsonform.js on lines 1203..1216

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                        'template': '<fieldset class="tab-container <%= elt.htmlClass?elt.htmlClass:"" %>">' +
                                                                          '<% if (node.legend) { %><legend><%= node.legend %></legend><% } %>' +
                                                                          '<% if (node.formElement.key) { %><input type="hidden" id="<%= node.id %>" name="<%= node.name %>" value="<%= escape(value) %>" /><% } else { %>' +
                                                                            '<a id="<%= node.id %>"></a><% } %>' +
                                                                          '<div class="tabbable">' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 644..657
                                                                    lib/jsonform.js on lines 716..729

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                        'template': '<div>' +
                                                                          '<input type="hidden" name="<%= node.name %>" id="<%= node.id %>" value="<%= value %>" />' +
                                                                          '<div class="dropdown">' +
                                                                          '<a class="btn<% if (buttonClass && node.value) { %> <%= buttonClass %><% } %>" data-toggle="dropdown" href="#"<% if (node.value) { %> style="max-width:<%= width %>px;max-height:<%= height %>px"<% } %>>' +
                                                                            '<% if (node.value) { %><i class="icon-<%= node.value %>" /><% } else { %><%= buttonTitle %><% } %>' +
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 2 other locations - About 1 hr to fix
                                                                    lib/jsonform.js on lines 644..657
                                                                    lib/jsonform.js on lines 1203..1216

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

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            var img = (evt.target.nodeName.toLowerCase() === 'img') ?
                                                                              $(evt.target) :
                                                                              $(evt.target).find('img');
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 1 hr to fix
                                                                    lib/jsonform.js on lines 753..755

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 56.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                            var i = (evt.target.nodeName.toLowerCase() === 'i') ?
                                                                              $(evt.target) :
                                                                              $(evt.target).find('i');
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 1 other location - About 1 hr to fix
                                                                    lib/jsonform.js on lines 685..687

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 56.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (this.view.onChange)
                                                                            $(this.el).bind('change', function(evt) { node.view.onChange(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2751..2752
                                                                    lib/jsonform.js on lines 2756..2757
                                                                    lib/jsonform.js on lines 2758..2759
                                                                    lib/jsonform.js on lines 2763..2764
                                                                    lib/jsonform.js on lines 2765..2766

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

                                                                          if (this.formElement.onKeyUp)
                                                                            $(this.el).bind('keyup', function(evt) { node.formElement.onKeyUp(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2749..2750
                                                                    lib/jsonform.js on lines 2751..2752
                                                                    lib/jsonform.js on lines 2756..2757
                                                                    lib/jsonform.js on lines 2758..2759
                                                                    lib/jsonform.js on lines 2763..2764

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

                                                                          if (this.view.onClick)
                                                                            $(this.el).bind('click', function(evt) { node.view.onClick(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2749..2750
                                                                    lib/jsonform.js on lines 2751..2752
                                                                    lib/jsonform.js on lines 2758..2759
                                                                    lib/jsonform.js on lines 2763..2764
                                                                    lib/jsonform.js on lines 2765..2766

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

                                                                          if ((boundaries.minItems >= 0) &&
                                                                              (node.children.length <= boundaries.minItems)) {
                                                                            $nodeid.find('> a._jsonform-array-deleteitem').addClass('disabled');
                                                                          }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 3 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 933..937
                                                                    lib/jsonform.js on lines 1078..1081
                                                                    lib/jsonform.js on lines 1133..1136

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

                                                                          if (this.formElement.onClick)
                                                                            $(this.el).bind('click', function(evt) { node.formElement.onClick(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2749..2750
                                                                    lib/jsonform.js on lines 2751..2752
                                                                    lib/jsonform.js on lines 2756..2757
                                                                    lib/jsonform.js on lines 2763..2764
                                                                    lib/jsonform.js on lines 2765..2766

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

                                                                          if ((boundaries.maxItems >= 0) &&
                                                                              (node.children.length >= boundaries.maxItems)) {
                                                                            $nodeid.find('> a._jsonform-array-addmore').addClass('disabled');
                                                                          }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 3 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 933..937
                                                                    lib/jsonform.js on lines 1078..1081
                                                                    lib/jsonform.js on lines 1137..1140

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

                                                                          if (this.formElement.onChange)
                                                                            $(this.el).bind('change', function(evt) { node.formElement.onChange(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2749..2750
                                                                    lib/jsonform.js on lines 2756..2757
                                                                    lib/jsonform.js on lines 2758..2759
                                                                    lib/jsonform.js on lines 2763..2764
                                                                    lib/jsonform.js on lines 2765..2766

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

                                                                            if ((boundaries.maxItems >= 0) &&
                                                                                (node.children.length <= boundaries.maxItems)) {
                                                                              $nodeid.find('> a._jsonform-array-addmore').removeClass('disabled');
                                                                            }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 3 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 933..937
                                                                    lib/jsonform.js on lines 1133..1136
                                                                    lib/jsonform.js on lines 1137..1140

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

                                                                          if (this.view.onKeyUp)
                                                                            $(this.el).bind('keyup', function(evt) { node.view.onKeyUp(evt, node); });
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 5 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 2749..2750
                                                                    lib/jsonform.js on lines 2751..2752
                                                                    lib/jsonform.js on lines 2756..2757
                                                                    lib/jsonform.js on lines 2758..2759
                                                                    lib/jsonform.js on lines 2765..2766

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

                                                                          if ((boundaries.minItems > 0) &&
                                                                              (node.children.length <= boundaries.minItems)) {
                                                                            $nodeid.find('> span > a._jsonform-array-deletelast')
                                                                              .addClass('disabled');
                                                                          }
                                                                    Severity: Major
                                                                    Found in lib/jsonform.js and 3 other locations - About 55 mins to fix
                                                                    lib/jsonform.js on lines 1078..1081
                                                                    lib/jsonform.js on lines 1133..1136
                                                                    lib/jsonform.js on lines 1137..1140

                                                                    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

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

                                                                                var nonEmptyKeys = _.filter(_.keys(result.meta), function (key) {
                                                                                  return !!isSet(result.meta[key]);
                                                                                });
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 55 mins to fix
                                                                    lib/jsonform.js on lines 593..595

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 53.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                                var nonEmptyKeys = _.filter(_.keys(result.meta), function (key) {
                                                                                  return !!isSet(result.meta[key]);
                                                                                });
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 55 mins to fix
                                                                    lib/jsonform.js on lines 519..521

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 53.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          var itv = window.setInterval(function() {
                                                                            if (window.wysihtml5) {
                                                                              window.clearInterval(itv);
                                                                              setup();
                                                                            }
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 50 mins to fix
                                                                    lib/jsonform.js on lines 446..451

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 51.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          var itv = window.setInterval(function() {
                                                                            if (window.ace) {
                                                                              window.clearInterval(itv);
                                                                              setup();
                                                                            }
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 50 mins to fix
                                                                    lib/jsonform.js on lines 389..394

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 51.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (this.onKeyUp)
                                                                            $(this.el).bind('keyup', function(evt) { node.onKeyUp(evt, node); });
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 35 mins to fix
                                                                    lib/jsonform.js on lines 2754..2755

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 46.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                          if (this.onClick)
                                                                            $(this.el).bind('click', function(evt) { node.onClick(evt, node); });
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 1 other location - About 35 mins to fix
                                                                    lib/jsonform.js on lines 2761..2762

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 46.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                              if (node.children.length < boundaries.minItems + 2) {
                                                                                $nodeid.find('> span > a._jsonform-array-deletelast')
                                                                                  .addClass('disabled');
                                                                              }
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 2 other locations - About 35 mins to fix
                                                                    lib/jsonform.js on lines 906..909
                                                                    lib/jsonform.js on lines 1066..1069

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 46.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                              if (node.children.length > boundaries.maxItems - 2) {
                                                                                $nodeid.find('> span > a._jsonform-array-addmore')
                                                                                  .addClass('disabled');
                                                                              }
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 2 other locations - About 35 mins to fix
                                                                    lib/jsonform.js on lines 944..947
                                                                    lib/jsonform.js on lines 1066..1069

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 46.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

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

                                                                              if (node.children.length < boundaries.minItems + 1) {
                                                                                $nodeid.find('> a._jsonform-array-deleteitem')
                                                                                  .addClass('disabled');
                                                                              }
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js and 2 other locations - About 35 mins to fix
                                                                    lib/jsonform.js on lines 906..909
                                                                    lib/jsonform.js on lines 944..947

                                                                    Duplicated Code

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

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

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

                                                                    Tuning

                                                                    This issue has a mass of 46.

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

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

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

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

                                                                    Refactorings

                                                                    Further Reading

                                                                    Parsing error: parser.parse is not a function
                                                                    Open

                                                                    /* Copyright (c) 2012 Joshfire - MIT license */
                                                                    Severity: Minor
                                                                    Found in lib/jsonform.js by eslint

                                                                    For more information visit Source: http://eslint.org/docs/rules/

                                                                    There are no issues that match your filters.

                                                                    Category
                                                                    Status