zordius/fluxex

View on GitHub

Showing 15 of 54 total issues

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

var stringify = function (V) {
    var circ = [];

    var core = function (V, nocirc) {
        if ((typeof V === 'number') || (typeof V === 'boolean')) {
Severity: Minor
Found in lib/fluxobj.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 stringify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var stringify = function (V) {
    var circ = [];

    var core = function (V, nocirc) {
        if ((typeof V === 'number') || (typeof V === 'boolean')) {
Severity: Minor
Found in lib/fluxobj.js - About 1 hr to fix

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

        componentDidMount: function () {
            /*global window,document*/
            var blockDoublePop = (document.readyState !== 'complete'),
                initState = JSON.stringify(this._getContext()._context),
                location = window.history.location || window.location,
    Severity: Minor
    Found in extra/pjax.js - About 1 hr to fix

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

          componentDidMount: function () {
              /*global window,document*/
              var blockDoublePop = (document.readyState != 'complete'),
                  initState = this._getContext().toString(),
                  initUrl = window.location.href;
      Severity: Minor
      Found in examples/01-history-api/components/Html.jsx - About 1 hr to fix

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

            var core = function (V, nocirc) {
                if ((typeof V === 'number') || (typeof V === 'boolean')) {
                    return V;
                }
        
        
        Severity: Minor
        Found in lib/fluxobj.js - About 1 hr to fix

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

              dispatch: function (name, payload) {
                  var I = 0;
                  var err = [];
                  var promises = [];
          
          
          Severity: Minor
          Found in lib/fluxex.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if (!typeListeners.length) {
                        self.attachEvent('on' + type, typeListeners.event = function (event) {
                            var documentElement = self.document && self.document.documentElement || self.documentElement || { scrollLeft: 0, scrollTop: 0 };
            
                            // polyfill w3c properties and methods
            Severity: Major
            Found in extra/polyfill-ie8-client.js - About 1 hr to fix

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

                  _scanDispatch: function (store, name) {
                      Object.keys(store).concat(['handle_**UPDATEALL**']).forEach(function (N) {
                          var M = N.match(/^handle_(.+)$/);
                          if (M) {
                              if (!this._actions[M[1]]) {
              Severity: Minor
              Found in lib/fluxex.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 handle_UPDATE_URL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      handle_UPDATE_URL: function (payload) {
                          var isPayloadString = ('string' === typeof payload);
                          var url = isPayloadString ? payload : payload.url;
                          var host = isPayloadString ? undefined : payload.host;
                          var ohost = this._get('url').host;
              Severity: Minor
              Found in extra/commonStores.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 handleScroll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  handleScroll: function () {
                      var ie8;
              
                      if (this.state.appending) {
                          return;
              Severity: Minor
              Found in examples/04-infinite-scroll/components/Results.jsx - About 35 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 JSON.stringify(V);
              Severity: Major
              Found in lib/fluxobj.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return '[' + V.map(function (v) {
                                return core(v);
                            }).join(',') + ']';
                Severity: Major
                Found in lib/fluxobj.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return '"[CIRCULAR!]"';
                  Severity: Major
                  Found in lib/fluxobj.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return '{' + Object.keys(V).map(function (k) {
                                    return core(k, true) + ':' + core(V[k]);
                                }).join(',') + '}' + (circ.pop() ? '' : '');
                    Severity: Major
                    Found in lib/fluxobj.js - About 30 mins to fix

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

                          dispatch: function (name, payload) {
                              var I = 0;
                              var err = [];
                              var promises = [];
                      
                      
                      Severity: Minor
                      Found in lib/fluxex.js - 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