AZaviruha/react-form-generator

View on GitHub

Showing 32 of 82 total issues

Function formGenerator has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function formGenerator ( conf ) { 
    conf = conf || {};

    var v        = require( '../../validation' )( conf.validators )
      , validate = v.validateField;
Severity: Major
Found in src/components/generated-form.jsx - About 5 hrs to fix

    Function formGenerator has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function formGenerator ( conf ) { 
        conf = conf || {};
    
        var v        = require( '../../validation' )( conf.validators )
          , validate = v.validateField;
    Severity: Major
    Found in src/components/compiled/generated-form.js - About 5 hrs to fix

      Function exports has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function ( conf ) {
          conf = conf || {};
          var VALIDATORS = t.merge( require( './validators' ), 
                                    conf.validators );
      
      
      Severity: Major
      Found in src/validation/index.js - About 2 hrs to fix

        Function buildRouter has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

        function buildRouter () {
            var args       = g.argsToArray( arguments )
              , simpleConf = {}
              , regexpConf = []
              , reLength
        Severity: Minor
        Found in src/tools/routing.js - About 2 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        module.exports = function ( React, tools ) {
            var getOrDefault = tools.getOrDefault
              , getOrNull    = tools.getOrNull;
        
            return React.createClass({
        Severity: Major
        Found in src/components/compiled/primitives/radiogroup.js - About 2 hrs to fix

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

          module.exports = function ( React, tools ) {
              var getOrDefault = tools.getOrDefault
                , getOrNull    = tools.getOrNull;
          
              return React.createClass({
          Severity: Major
          Found in src/components/primitives/radiogroup.jsx - About 2 hrs to fix

            Function exports has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function ( React, tools ) {
                var getOrDefault = tools.getOrDefault
                  , getOrNull    = tools.getOrNull;
            
                return React.createClass({
            Severity: Major
            Found in src/components/primitives/select.jsx - About 2 hrs to fix

              Function exports has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function ( React, tools ) {
                  var getOrDefault = tools.getOrDefault
                    , getOrNull    = tools.getOrNull;
              
                  return React.createClass({
              Severity: Major
              Found in src/components/compiled/primitives/select.js - About 2 hrs to fix

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

                module.exports = function ( React, tools ) {
                    var getOrDefault = tools.getOrDefault
                      , Addons       = React.addons;
                
                    return React.createClass({
                Severity: Major
                Found in src/components/compiled/fields/text.js - About 2 hrs to fix

                  Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function ( React, tools ) {
                      var getOrDefault = tools.getOrDefault
                        , getOrNull    = tools.getOrNull;
                  
                      return React.createClass({
                  Severity: Minor
                  Found in src/components/primitives/checkbox.jsx - About 2 hrs to fix

                    Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function ( React, tools ) {
                        var getOrDefault = tools.getOrDefault
                          , getOrNull    = tools.getOrNull;
                    
                        return React.createClass({
                    Severity: Minor
                    Found in src/components/compiled/primitives/checkbox.js - About 2 hrs to fix

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

                      module.exports = function ( React, tools ) {
                          var getOrDefault = tools.getOrDefault;
                      
                          return React.createClass({
                              displayName: 'TextareaRenderer',
                      Severity: Minor
                      Found in src/components/compiled/primitives/textarea.js - About 1 hr to fix

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

                        module.exports = function ( React, tools ) {
                            var getOrDefault = tools.getOrDefault;
                        
                            return React.createClass({
                                displayName: 'TextareaRenderer',
                        Severity: Minor
                        Found in src/components/primitives/textarea.jsx - About 1 hr to fix

                          Function exports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function ( React, tools ) {
                              var getOrDefault = tools.getOrDefault;
                          
                              return React.createClass({
                                  displayName: 'TextRenderer',
                          Severity: Minor
                          Found in src/components/primitives/text.jsx - About 1 hr to fix

                            Function exports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            module.exports = function ( React, tools ) {
                                var getOrDefault = tools.getOrDefault;
                            
                                return React.createClass({
                                    displayName: 'TextRenderer',
                            Severity: Minor
                            Found in src/components/compiled/primitives/text.js - About 1 hr to fix

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

                                      renderCellContent: function ( cell ) {
                                          var self     = this
                                            , meta     = this.props.meta || {}
                                            , contents = getOrDefault( cell, 'content', [] )
                                            , Layout;
                              Severity: Minor
                              Found in src/components/compiled/generated-form.js - About 1 hr to fix

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

                                        renderCellContent: function ( cell ) {
                                            var self     = this
                                              , meta     = this.props.meta || {}
                                              , contents = getOrDefault( cell, 'content', [] )
                                              , Layout;
                                Severity: Minor
                                Found in src/components/generated-form.jsx - About 1 hr to fix

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

                                  module.exports = function ( React, tools ) {
                                      var getOrNull      = tools.getOrNull
                                        , getOrDefault   = tools.getOrDefault;
                                  
                                      return React.createClass({
                                  Severity: Minor
                                  Found in src/components/layouts/simpleFormField.jsx - About 1 hr to fix

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

                                    module.exports = function ( React, tools ) {
                                        var getOrNull      = tools.getOrNull
                                          , getOrDefault   = tools.getOrDefault;
                                    
                                        return React.createClass({
                                    Severity: Minor
                                    Found in src/components/compiled/layouts/simpleFormField.js - About 1 hr to fix

                                      Function exports has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      module.exports = function ( conf ) {
                                          conf = conf || {};
                                          var VALIDATORS = t.merge( require( './validators' ), 
                                                                    conf.validators );
                                      
                                      
                                      Severity: Minor
                                      Found in src/validation/index.js - About 1 hr to fix

                                      Cognitive Complexity

                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                      A method's cognitive complexity is based on a few simple rules:

                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                      • Code is considered more complex for each "break in the linear flow of the code"
                                      • Code is considered more complex when "flow breaking structures are nested"

                                      Further reading

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language