Showing 76 of 358 total issues
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { alert, buttons, empty, footer, header, items, sections } = this.props
return (
<div className={ this._getClasses() }>
{ header &&
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { filters, onDone } = this.props
return (
<div className="reframe-filters-panel">
<div className="reframe-filters-header">
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { chosen, endpoint, filters, multiple, options, text } = this.props
return (
<div className={ this._getClass() }>
<div className="reframe-toggle-list-overlay" onClick={ this._handleToggleFilter.bind(this) } />
Function records
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
(records, sort) => {
if(!records) return null
return records.sort((a, b) => {
const aValue = a[sort.key]
const bValue = b[sort.key]
- 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 componentDidUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
const { data, sections, status } = this.props
if(!_.isEqual(prevProps.sections, sections)) {
this._handleUpdateSections()
}
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { format, label, multiple, name, options, results } = this.props
const value = results[name]
return (
<div className="reframe-filters-panel">
Function _scrollListener
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_scrollListener() {
const { signpost } = this.state
const { notificationPercent, onReachBottom } = this.props
const bottomPosition = this.scrollpane.scrollHeight - (this.scrollpane.scrollTop + this.scrollpane.offsetHeight)
const percentRemaining = (bottomPosition / this.scrollpane.scrollHeight) * 100
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { columns } = this.props
return (
<div className="reframe-tablefield">
<div className="reframe-tablefield-header">
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const dpis = [1,2]
const { file } = this.props
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { items } = this.props
return (
<div className="reframe-collection-tasks-panel">
<div className="reframe-collection-tasks-panel-header">
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { cancel, children, message, title, open, options } = this.props
return ([
children,
<CSSTransition key="reframe-prompt-overlay" in={ open } classNames="expanded" timeout={ 250 } mountOnEnter={ true } unmountOnExit={ true }>
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { header, items } = this.props
return (
<div className="reframe-tabs">
<div className="reframe-tabs-header">
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { panels } = this.state
const { children } = this.props
return ([
children,
Function reducer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const reducer = (state = INITIAL_STATE, action)=> {
switch (action.type) {
case 'SET_PARAMS':
Function fetchSuccess
has 27 lines of code (exceeds 25 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) {
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { all, delayed, empty, failure, footer, header, layout, loading, notFound, records, status, timeout, total } = this.props
return (
<div className="reframe-infinite">
{ header &&
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { status } = this.props
return (
<ModalPanel { ...this._getPanel() }>
<div className="reframe-videofield-picker">
Function componentDidUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
const { files, multiple, status, value, onChange, onReady } = this.props
if(status !== prevProps.status) {
if(prevProps.status === 'pending') {
onReady()
- 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 componentDidUpdate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(prevProps) {
const { active, value, onChange } = this.props
const { form } = this.context
if(prevProps.value !== value) {
if(value) {
- 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 _getSlideClass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_getSlideClass(index) {
const curr = this.state.active
const next = this.props.active
const { direction } = this.props
const { transitioning } = this.state
- 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"