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')) {
- Read upRead up
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')) {
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,
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;
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;
}
Function dispatch
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatch: function (name, payload) {
var I = 0;
var err = [];
var promises = [];
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
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]]) {
- Read upRead up
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;
- Read upRead up
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;
- Read upRead up
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);
Avoid too many return
statements within this function. Open
return '[' + V.map(function (v) {
return core(v);
}).join(',') + ']';
Avoid too many return
statements within this function. Open
return '"[CIRCULAR!]"';
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() ? '' : '');
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 = [];
- Read upRead up
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"