Function constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
super();
this.state = {
inputType: 'password',
- Read upRead up
- Create a ticketCreate a ticket
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
Using this.refs is deprecated. Open
focus(this.refs.input);
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Visible, non-interactive elements should not have mouse or keyboard event listeners Open
<div className="form-side" onClick={this.toggleType}>
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Absolute imports should come before relative imports. Open
import intl from 'react-intl-universal';
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Empty components are self-closing Open
<i className={`iconfont icon-eye ${this.state.inputType === 'text' ? 'active' : ''}`}></i>
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Using this.refs is deprecated. Open
this.clearTip = () => this.refs.tip.clear();
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "className" is not required, but has no corresponding defaultProp declaration. Open
className: PropTypes.string,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
propType "autofocus" is not required, but has no corresponding defaultProp declaration. Open
autofocus: PropTypes.bool,
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Using string literals in ref attributes is deprecated. Open
ref="input" onChange={this.clearTip} minLength="6" autoFocus={this.props.autofocus}
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Using this.refs is deprecated. Open
const v = this.refs.input.value;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Using string literals in ref attributes is deprecated. Open
<Tooltip ref="tip">
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Using this.refs is deprecated. Open
const { tip, input } = this.refs;
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/