Showing 76 of 358 total issues
Function componentDidUpdate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
const { cacheKey, exclude_ids, filter, records, selected, sort, status, onUpdateSelected } = this.props
if(this.timeout && status !== prevProps.status && prevProps.status === 'loading') {
clearTimeout(this.timeout)
}
- 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 7 (exceeds 5 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) }>
- 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 _getStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getStatus(index) {
const { slideFirst } = this.props
const mountedIndexes = this.state.mounted - 1
const cardIndexes = this.state.cards.length - 1
if(!slideFirst && mountedIndexes === -1) return 'active'
- 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 7 (exceeds 5 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">
- 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 _handleFetch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_handleFetch(skip = null, reload = false) {
const { endpoint, exclude_ids, filter, next, records, sort, total, onFetch } = this.props
const loaded = records ? records.length : 0
const query = {
$page: this._getPagination(skip),
- 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 files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(files) => files.sort((fileA, fileB) => {
const aIsImage = (fileA.contentType || fileA.asset.content_type).match(/image/) !== null
const bIsImage = (fileB.contentType || fileB.asset.content_type).match(/image/) !== null
if (aIsImage && !bIsImage) return -1
if (bIsImage && !aIsImage) return 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
Avoid too many return
statements within this function. Open
return Check(this.props, true)
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return Check(this.props, false)
Avoid too many return
statements within this function. Open
return Default(this.props)
Avoid too many return
statements within this function. Open
return { $eq: value }
Avoid too many return
statements within this function. Open
return Email(this.props)
Avoid too many return
statements within this function. Open
return Link(this.props)
Avoid too many return
statements within this function. Open
return 'file-text-o'
Avoid too many return
statements within this function. Open
return Raw(this.props)
Avoid too many return
statements within this function. Open
if(index < cardIndexes ) return 'covered'
Avoid too many return
statements within this function. Open
return Element(this.props)
Avoid too many return
statements within this function. Open
return Date(this.props, template)
Avoid too many return
statements within this function. Open
return format(this.props)
Avoid too many return
statements within this function. Open
return Default(this.props)