Function render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
render() {
let toggle = this.props.open ? this.props.hideFilters : this.props.showFilters;
let activeClass = this.props.open ? ' is-active' : '';
if (this.props.open && this.props.metadataPanelIsOpen) {
- 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
Export statements should appear at the end of the file Open
export class SearchButton extends Component {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "metadataPanelIsOpen" is not required, but has no corresponding defaultProps declaration. Open
metadataPanelIsOpen: PropTypes.bool,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Definition for rule 'node/no-restricted-import' was not found. Open
import PropTypes from 'prop-types';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Export statements should appear at the end of the file Open
export function mapStateToProps(state, props) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "showFilters" is not required, but has no corresponding defaultProps declaration. Open
showFilters: PropTypes.func,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "unselectAllDocuments" is not required, but has no corresponding defaultProps declaration. Open
unselectAllDocuments: PropTypes.func,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "open" is not required, but has no corresponding defaultProps declaration. Open
open: PropTypes.bool,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "hideFilters" is not required, but has no corresponding defaultProps declaration. Open
hideFilters: PropTypes.func,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Prefer named exports. Open
export default connect(mapStateToProps, mapDispatchToProps)(SearchButton);
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Anchor used as a button. Anchors are primarily expected to navigate. Use the button element instead. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md Open
<a href="#" className={`search-button btn ${activeClass}`} onClick={toggle}>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/