ShubhamGupta/spree-on-react

View on GitHub

Showing 39 of 128 total issues

Function render has 162 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    let lineItems = [];
    if (this.props.order.state !== 'complete') {
      lineItems = this.props.order.line_items;
    }
Severity: Major
Found in src/components/cart/show.jsx - About 6 hrs to fix

    Function render has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        let renderString = null;
        let variantListNode = null;
        let { currentVariant } = this.state;
    
    
    Severity: Major
    Found in src/components/product/show.jsx - About 3 hrs to fix

      Function render has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          let statesRequired = this.state.stateList.states_required;
          let stateOptionsMarkup;
      
          if (statesRequired) {
      Severity: Major
      Found in src/components/checkout-steps/address/address-fields.jsx - About 3 hrs to fix

        Function render has 79 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const { handleSubmit } = this.props;
            return (
              <Modal modalClasses="user-form-modal" showModal={ this.props.showModal } closeModal={ this.closeModal } >
                <div className="user-signup-modal">
        Severity: Major
        Found in src/components/user-signup.jsx - About 3 hrs to fix

          Function render has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const useBilling = this.props.useBilling;
              const { handleSubmit, valid, submitting } = this.props;
          
              return (
          Severity: Major
          Found in src/components/checkout-steps/address-form.jsx - About 2 hrs to fix

            Function build has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function build(previousSizeMap) {
              console.log('Creating an optimized production build...');
              webpack(config).run((err, stats) => {
                if (err) {
                  printErrors('Failed to compile.', [err]);
            Severity: Major
            Found in scripts/build.js - About 2 hrs to fix

              Function render has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  let thisShipment = this.props.shipment;
              
                  return (
                    <div className="shipment-view">
              Severity: Major
              Found in src/components/order/shipment.jsx - About 2 hrs to fix

                Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { handleSubmit, valid, submitting } = this.props;
                
                    return (
                      <Modal modalClasses="user-form-modal" showModal={ this.props.showModal } closeModal={ this.closeModal } >
                Severity: Major
                Found in src/components/user-login.jsx - About 2 hrs to fix

                  Function render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render() {
                      const { handleSubmit, valid, submitting } = this.props;
                      return (
                        <Layout>
                          <BaseCheckoutLayout currentStep="confirm"
                  Severity: Major
                  Found in src/components/checkout-steps/confirmation-form.jsx - About 2 hrs to fix

                    Function navIcons has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      navIcons () {
                        let userSessionActionMarkup;
                        let { user } = this.props;
                    
                        if (this.props.user.id) {
                    Severity: Major
                    Found in src/components/shared/header.jsx - About 2 hrs to fix

                      Function mapDispatchToProps has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const mapDispatchToProps = (dispatch) => {
                        return {
                          setCurrentCheckoutStep: () => {
                            dispatch ({
                              type: APP_ACTIONS.SET_CURRENT_CHECKOUT_STEP,
                      Severity: Major
                      Found in src/containers/cart/cart-show-connector.js - About 2 hrs to fix

                        Function lineItemList has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              let lineItemList = lineItems.map((lineItem, idx) => {
                                let variantImage = lineItem.variant.images[0].small_url;
                                let imageUrl = URLSanitizer.makeAbsolute(variantImage);
                                let productSlug = lineItem.variant.slug;
                        
                        
                        Severity: Minor
                        Found in src/components/cart/show.jsx - About 1 hr to fix

                          Function render has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            render() {
                              let userLoggedInClass = this.props.user.id ? 'user-logged-in ' : 'guest-user ';
                              return (
                                <nav className={ "global-header " +  userLoggedInClass + styles.header}>
                                  <div className="container">
                          Severity: Minor
                          Found in src/components/shared/header.jsx - About 1 hr to fix

                            Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              render() {
                                const { handleSubmit, valid, submitting, order } = this.props;
                                let paymentMethods = order.payment_methods || [];
                                let paymentMethodMarkup = paymentMethods.map((paymentMethod, idx) => {
                                  return (
                            Severity: Minor
                            Found in src/components/checkout-steps/payment-form.jsx - About 1 hr to fix

                              Function setupCompiler has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function setupCompiler(host, port, protocol) {
                                // "Compiler" is a low-level interface to Webpack.
                                // It lets us listen to some events and provide our own custom messages.
                                compiler = webpack(config, handleCompile);
                              
                              
                              Severity: Minor
                              Found in scripts/start.js - About 1 hr to fix

                                Function _shipmentStateMarkup has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  _shipmentStateMarkup() {
                                    let thisShipment = this.props.shipment;
                                
                                    if (this._isShipped()) {
                                      return (
                                Severity: Minor
                                Found in src/components/order/shipment.jsx - About 1 hr to fix

                                  Function getOrderPropertiesMapper has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    getOrderPropertiesMapper () {
                                      let thisOrder = this.props.order;
                                      const ItemTotalRep = <FormattedMessage
                                                              id="label.itemTotal"
                                                              defaultMessage="Item Total"
                                  Severity: Minor
                                  Found in src/components/order/summary.jsx - About 1 hr to fix

                                    Function _panelHeaderMarkup has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      _panelHeaderMarkup() {
                                        let thisOrder = this.props.order;
                                        let paymentStatus = thisOrder.payment_state === 'paid' ? 'success' : 'danger';
                                    
                                        return (
                                    Severity: Minor
                                    Found in src/components/order/panel-view.jsx - About 1 hr to fix

                                      Function mapDispatchToProps has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const mapDispatchToProps = (dispatch) => {
                                        return {
                                          setCurrentCheckoutStep: () => {
                                            dispatch ({
                                              type: APP_ACTIONS.SET_CURRENT_CHECKOUT_STEP,
                                      Severity: Minor
                                      Found in src/containers/checkout-steps/address-form-connector.js - About 1 hr to fix

                                        Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          render() {
                                            let shipments = this.props.order.shipments;
                                            const { handleSubmit, valid, submitting } = this.props;
                                        
                                            let shipmentsMarkup = shipments.map((shipment, idx) => {
                                        Severity: Minor
                                        Found in src/components/checkout-steps/delivery-form.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language