Showing 334 of 1,376 total issues
Function componentWillReceiveProps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
checkPropChange(this.props.options, nextProps.options, () => {
this.setState({
options: nextProps.options[nextProps.dataField]
Function componentDidMount
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentDidMount() {
this.props.addComponent(this.props.componentId);
this.setReact(this.props);
let startDate = null;
Function defaultQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
SingleList.defaultQuery = (value, props) => {
if (props.selectAllLabel && props.selectAllLabel === value) {
if (props.showMissing) {
return { match_all: {} };
}
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.render) {
return this.props.render(this.props);
}
Function booksReactiveList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
booksReactiveList(data) {
return (
<div className="flex book-content" key={data._id}>
<img src={data.image} alt="Book Cover" className="book-image" />
<div className="flex column justify-center" style={{ marginLeft: 20 }}>
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<ReactiveBase
app="good-books-ds"
credentials="nY6NNTZZ6:27b76b9f-18ea-456c-bc5e-3a5263ebc63d"
Function componentWillReceiveProps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
checkPropChange(this.props.react, nextProps.react, () => this.setReact(nextProps));
checkSomePropChange(this.props, nextProps, ['dataField', 'nestedField'], () => {
this.updateQuery(Object.keys(this.state.currentValue), nextProps);
Function setPage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
setPage(page) {
// pageClick will be called everytime a pagination button is clicked
if (page !== this.$currentPage) {
this.$emit('pageClick', page + 1);
const value = this.$props.size * page;
Consider simplifying this complex logical expression. Open
if (this.state.currentDate) {
markedDates = {
[this.state.currentDate.start.dateString]: {
startingDay: true,
color:
Consider simplifying this complex logical expression. Open
if (this.state.currentDate) {
markedDates = {
[this.state.currentDate.dateString]: {
startingDay: true,
endingDay: true,
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const results = parseHits(this.props.hits) || [];
const streamResults = parseHits(this.props.streamHits) || [];
let filteredResults = results;
- 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 renderValue
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
renderValue(value, isArray) {
if (isArray && value.length) {
const arrayToRender = value.map(item => this.renderValue(item));
return arrayToRender.join(', ');
}
- 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 componentDidMount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount() {
this.props.addComponent(this.internalComponent);
this.props.addComponent(this.props.componentId);
if (this.props.stream) {
- 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 componentDidMount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount() {
this.props.addComponent(this.internalComponent);
this.props.addComponent(this.props.componentId);
if (this.props.stream) {
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
selectAllLabel, renderListItem, showLoadMore, loadMoreLabel,
} = this.props;
const { isLastBucket } = 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"