ScrollTrack
has 24 functions (exceeds 20 allowed). Consider refactoring.
@Radium
class ScrollTrack extends Component {
static equalWidthTrack = equalWidthTrack
static ScrollTrackPropTypes = ScrollTrackPropTypes
Function getSnacksStyles
has 116 lines of code (exceeds 75 allowed). Consider refactoring.
const getSnacksStyles = props => {
const { action, actionHover, primaryBackground } = props.snacksTheme.colors
const actionActive = darken(actionHover, 3)
const disabled = {
Function withTheme
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
function withTheme(options = {}) {
if (isValidElementType(options)) {
return withTheme()(options)
Function render
has 101 lines of code (exceeds 75 allowed). Consider refactoring.
render() {
const {
floatingLabelText,
defaultValue,
disabled,
Function render
has 93 lines of code (exceeds 75 allowed). Consider refactoring.
render() {
const {
mask,
pipe,
maskHint,
Function formComponent
has 89 lines of code (exceeds 75 allowed). Consider refactoring.
const formComponent = WrappedComponent => {
return class FormComponent extends React.Component {
static propTypes = {
name: PropTypes.string.isRequired,
Function Button
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
const Button = props => {
const snacksStyles = getSnacksStyles(props)
const ElementType = props.href ? 'a' : 'button'
Function calculatePosition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
calculatePosition() {
const { placement } = this.props
const target = this.getTarget()
const { overlay } = this
const targetRect = this.getRect(target)
Function formComponent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
const formComponent = WrappedComponent => {
return class FormComponent extends React.Component {
static propTypes = {
name: PropTypes.string.isRequired,
Function equalWidthTrack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
const equalWidthTrack = childWidth => {
if (!['number', 'function'].includes(typeof childWidth)) {
throw new EqualWidthTrackError('childWidth must be a number or function bassed on props')
}
Avoid too many return
statements within this function.
return {}