bigdatr/bd-stampy

View on GitHub

Showing 25 of 61 total issues

File DatePicker.jsx has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Open


/*global document */

var React = require('react'),
    moment = require('moment');
Severity: Minor
Found in components/DatePicker.jsx - About 2 hrs to fix

    Function navigate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

        navigate: function(fragment, options) {
          if (!History.started) return false;
          if (!options || options === true) options = {trigger: !!options};
    
          var url = this.root + (fragment = this.getFragment(fragment || ''));
    Severity: Minor
    Found in utils/History.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 start has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        start: function(options) {
          if (History.started) {
            // throw new Error("Backbone.history has already been started")
            console.warn('Backbone.history has already been started');
            return false;
    Severity: Minor
    Found in utils/History.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

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

    module.exports = function(config) {
        config.set({
            browsers: ['Firefox'],
            frameworks: ['jasmine'],
            files: [
    Severity: Minor
    Found in karma.conf.js - About 1 hr to fix

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

          render: function() {
              var classes = this.createClassName('Input')
                  .add((this.props.isValid === false || this.props.error), 'is-error')
                  .modifier(this.props.type)
              ;
      Severity: Minor
      Found in components/Input.jsx - About 1 hr to fix

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

            start: function(options) {
              if (History.started) {
                // throw new Error("Backbone.history has already been started")
                console.warn('Backbone.history has already been started');
                return false;
        Severity: Minor
        Found in utils/History.js - About 1 hr to fix

          Function render has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              render: function() {
                  var src = '';
                  var height;
                  var width;
          
          
          Severity: Minor
          Found in components/Img.jsx - 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

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

              render: function() {
                  var src = '';
                  var height;
                  var width;
          
          
          Severity: Minor
          Found in components/Img.jsx - About 1 hr to fix

            Function FormMixin_getData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                FormMixin_getData: function() {
                    var data = this.state.formData ? Immutable.fromJS(this.state.formData).toJS() : {};
            
                    if (this.transformData) {
                        for (var key in this.transformData) {
            Severity: Minor
            Found in mixins/FormMixin.jsx - 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

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

                setQueryParams: function(params, config) {
                    if (!params || typeof params !== 'object') {
                        console.warn('::UrlStore.setQueryParams', 'Missing or invalid argument `params`.', params || '');
                        return false;
                    }
            Severity: Minor
            Found in utils/UrlStore.js - About 1 hr to fix

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

                  updateChildProps: function(tabindex) {
                      tabindex = tabindex || this.state.tabindex;
              
                      var _this = this;
                      var tabGroup = [];
              Severity: Minor
              Found in components/TabView.jsx - About 1 hr to fix

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

                    getBodyData() {
                        // 1. Filter search
                        // 2. Sort direction
                        // 3. Truncate to pagination
                
                
                Severity: Minor
                Found in components/DataTable.jsx - About 1 hr to fix

                  Function _updateUrl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      _updateUrl: function(forcedUrl) {
                          var urlChanged = false;
                  
                          // Skip this if we are running server side
                          if (forcedUrl) {
                  Severity: Minor
                  Found in utils/BrowserHistory.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

                  Function setQueryParams has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      setQueryParams: function(params, config) {
                          if (!params || typeof params !== 'object') {
                              console.warn('::UrlStore.setQueryParams', 'Missing or invalid argument `params`.', params || '');
                              return false;
                          }
                  Severity: Minor
                  Found in utils/UrlStore.js - About 55 mins 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 add has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  ClassBuilder.prototype.add = function (condition, passClass, failClass) {
                      if(condition !== undefined) {
                          if (passClass) {
                              if (condition) {
                                  this.className += ' ' + passClass;
                  Severity: Minor
                  Found in utils/ClassBuilder.js - About 45 mins 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 componentClassNames has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  const componentClassNames = (props, name, additionalModifiers, ...additionalClassnamesArguments) => {
                  
                      function createModifiers(modifiers) {
                          if(!modifiers) {
                              return null;
                  Severity: Minor
                  Found in utils/ComponentClassNames.js - About 45 mins 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

                  Avoid too many return statements within this function.
                  Open

                          return null;
                  Severity: Major
                  Found in utils/ComponentClassNames.js - About 30 mins to fix

                    Function renderChildProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        renderChildProps: function(num) {
                    
                            // Fixed widths
                            if (this.props.width[num].toString().indexOf('px')) {
                                if(num === 0) {
                    Severity: Minor
                    Found in components/Config.jsx - About 25 mins 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 fetchImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        fetchImage: function() {
                            var img = new Image();
                            var _this = this;
                    
                            img.onload = function() {
                    Severity: Minor
                    Found in components/Img.jsx - About 25 mins 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 FormMixin_isValid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        FormMixin_isValid: function() {
                            if (this.validators) {
                                var formErrors = this.FormMixin_validateAll();
                    
                                for (var key in formErrors) {
                    Severity: Minor
                    Found in mixins/FormMixin.jsx - About 25 mins 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