instacart/Snacks

View on GitHub

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
Severity: Minor
Found in src/components/ScrollTrack/ScrollTrack.js - About 2 hrs to fix

    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 = {
    Severity: Major
    Found in src/components/Buttons/Button.js - About 2 hrs to fix

      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)
      Severity: Minor
      Found in src/styles/themer/withTheme.js - About 2 hrs to fix

      Function render has 101 lines of code (exceeds 75 allowed). Consider refactoring.
      Open

      render() {
      const {
      floatingLabelText,
      defaultValue,
      disabled,
      Severity: Major
      Found in src/components/Forms/TextField.js - About 2 hrs to fix

        Function render has 93 lines of code (exceeds 75 allowed). Consider refactoring.
        Open

        render() {
        const {
        mask,
        pipe,
        maskHint,
        Severity: Major
        Found in src/components/Forms/MaskedTextField.js - About 1 hr to fix

          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,
          Severity: Major
          Found in src/components/Forms/FormComponent.js - About 1 hr to fix

            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'
             
             
            Severity: Minor
            Found in src/components/Buttons/Button.js - About 1 hr to fix

            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)
            Severity: Minor
            Found in src/components/Tooltip/TooltipPosition.js - About 1 hr to fix

            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,
            Severity: Minor
            Found in src/components/Forms/FormComponent.js - About 1 hr to fix

            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')
            }
             
             
            Severity: Minor
            Found in src/components/ScrollTrack/equalWidthTrack.js - About 55 mins to fix

            Avoid too many return statements within this function.
            Open

            return {}
            Severity: Major
            Found in src/components/Grid/Row.js - About 30 mins to fix
              Severity
              Category
              Status
              Source
              Language