Showing 76 of 358 total issues
Function Select
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Select = (multiple) => {
class Control extends React.Component {
static propTypes = {
Function Select
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const Select = (multiple) => {
class Control extends React.Component {
static propTypes = {
- 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 a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { format } = this.props
if(_.isString(format)) {
const [,style,details] = format.match(/([^|]*)\|?(.*)/)
if(style === 'status') {
- 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 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(){
const { columns, link, records, recordTasks, selectable, selected, selectAll, sort } = this.props
return (
<div className="reframe-table">
<table className="reframe-table-pinned">
Function _getOptions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_getOptions(include) {
const options = []
if(_.includes(include, 'this')) options.push({ value: 'this_week', description: this.description(0, 'week'), text: 'This Week' })
if(_.includes(include, 'last')) options.push({ value: 'last_week', description: this.description(-1, 'week'), text: 'Last Week' })
if(_.includes(include, 'next')) options.push({ value: 'next_week', description: this.description(1, 'week'), text: 'Next Week' })
- 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { leftItems, position, rightItems, title } = this.props
return (
<div className={ this._getClass() }>
{ position === 'top' &&
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { editorState, linking } = this.state
return (
<div className="reframe-wysiwyg">
<div className="reframe-wysiwyg-header">
Form
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Form extends React.Component {
static childContextTypes = {
form: PropTypes.object
}
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { month, value, year } = this.props
const current = { month, year, day: '01'}
const start = moment(current).startOf('month')
const end = moment(current).endOf('month')
Function reducer
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case 'FETCH_REQUEST':
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { format } = this.props
if(_.isString(format)) {
const [,style,details] = format.match(/([^|]*)\|?(.*)/)
if(style === 'status') {
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { filters, open, panel, table, tasks } = this.props
return (
<div className="reframe-collection-tasks">
<div className="reframe-collection-tasks-inner">
Function fetchSuccess
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const fetchSuccess = (state: State, action: FetchSuccess): State => {
if(action.request_id !== state.request_id) return state
if(!_.includes(['loading','refreshing','delayed'], state.status)) return state
const loaded = state.records ? state.records.length : 0
if(action.result.pagination.all !== undefined) {
- 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 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { alt, component, content, empty, extra, format, handler, icon, label, link, tasks, units } = this.props
if(this.props.if === false) return null
return (
<div className={ this._getClass() } onClick={ this._handleClick.bind(this) }>
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const saved = [
{ name: 'Saved Filter 1', results: { } }
]
return (
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { component, content, empty, items, title } = this.props
return (
<div className="reframe-list-section">
{ title &&
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { after, before, config, instructions, panels, status } = this.props
const configuring = _.includes(['pending', 'loading_sections','sections_loaded', 'loading_data'], status)
return (
<div className="reframe-form">
Function reducer
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case 'SET':
Function _handleClick
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_handleClick() {
const { confirm, disabled, drawer, handler, location, modal, request, route, onDone } = this.props
if(disabled) return
const yesHandler = () => {
if(route) this._handleRoute(route)
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { active, infinite, slides, total } = this.props
return (
<div className="reframe-carousel">
{ total > 0 &&