Showing 11 of 70 total issues
ScrollTrack
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
@Radium
class ScrollTrack extends Component {
static equalWidthTrack = equalWidthTrack
static ScrollTrackPropTypes = ScrollTrackPropTypes
Function getSnacksStyles
has 116 lines of code (exceeds 75 allowed). Consider refactoring. Open
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. Open
function withTheme(options = {}) {
// This allows us to maintain backwards compatibility with withTheme(Component)
// while supporting withTheme(options)(Component)
if (isValidElementType(options)) {
return withTheme()(options)
- 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 101 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const {
floatingLabelText,
defaultValue,
disabled,
Function render
has 93 lines of code (exceeds 75 allowed). Consider refactoring. Open
render() {
const {
mask,
pipe,
maskHint,
Function formComponent
has 89 lines of code (exceeds 75 allowed). Consider refactoring. Open
const formComponent = WrappedComponent => {
return class FormComponent extends React.Component {
static propTypes = {
/** Model name for Form */
name: PropTypes.string.isRequired,
Function Button
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const Button = props => {
const snacksStyles = getSnacksStyles(props)
const ElementType = props.href ? 'a' : 'button'
- 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 formComponent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const formComponent = WrappedComponent => {
return class FormComponent extends React.Component {
static propTypes = {
/** Model name for Form */
name: PropTypes.string.isRequired,
- 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 calculatePosition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
calculatePosition() {
const { placement } = this.props
const target = this.getTarget()
const { overlay } = this
const targetRect = this.getRect(target)
- 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 equalWidthTrack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const equalWidthTrack = childWidth => {
if (!['number', 'function'].includes(typeof childWidth)) {
throw new EqualWidthTrackError('childWidth must be a number or function bassed on props')
}
- 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
Avoid too many return
statements within this function. Open
return {}