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');
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 || ''));
- 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 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;
- 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 exports
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
browsers: ['Firefox'],
frameworks: ['jasmine'],
files: [
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)
;
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;
Function render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
var src = '';
var height;
var width;
- 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 render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var src = '';
var height;
var width;
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) {
- 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 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;
}
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 = [];
Function getBodyData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
getBodyData() {
// 1. Filter search
// 2. Sort direction
// 3. Truncate to pagination
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) {
- 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 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;
}
- 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 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;
- 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 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;
- 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 null;
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) {
- 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 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() {
- 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 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) {
- 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"