The following issues were found

litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/WxOrderService.java
223 issues
Avoid throwing raw exception types.
Design

Line: 432

              
            int remainNumber = product.getNumber() - checkGoods.getNumber();
            if (remainNumber < 0) {
                throw new RuntimeException("下单的商品货品数量大于库存量");
            }
            if (productService.reduceStock(productId, checkGoods.getNumber()) == 0) {
                throw new RuntimeException("商品货品库存减少失败");
            }
        }

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 435

                              throw new RuntimeException("下单的商品货品数量大于库存量");
            }
            if (productService.reduceStock(productId, checkGoods.getNumber()) == 0) {
                throw new RuntimeException("商品货品库存减少失败");
            }
        }

        // 如果使用了优惠券,设置优惠券使用状态
        if (couponId != 0 && couponId != -1) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 529

                      order.setOrderStatus(OrderUtil.STATUS_CANCEL);
        order.setEndTime(LocalDateTime.now());
        if (orderService.updateWithOptimisticLocker(order) == 0) {
            throw new RuntimeException("更新数据已失效");
        }

        // 商品货品数量增加
        List<LitemallOrderGoods> orderGoodsList = orderGoodsService.queryByOid(orderId);
        for (LitemallOrderGoods orderGoods : orderGoodsList) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 538

                          Integer productId = orderGoods.getProductId();
            Short number = orderGoods.getNumber();
            if (productService.addStock(productId, number) == 0) {
                throw new RuntimeException("商品货品库存增加失败");
            }
        }

        // 返还优惠券
        releaseCoupon(orderId);

            

Reported by PMD.

A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 1

              package org.linlinjava.litemall.wx.service;

import com.github.binarywang.wxpay.bean.notify.WxPayNotifyResponse;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.bean.order.WxPayMwebOrderResult;
import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult;
import com.github.binarywang.wxpay.constant.WxPayConstants;

            

Reported by PMD.

The class 'WxOrderService' has a total cyclomatic complexity of 141 (highest 44).
Design

Line: 69

               * 当402系统自动确认收货以后,此时用户可以删除订单,评价商品,申请售后,或者再次购买
 */
@Service
public class WxOrderService {
    private final Log logger = LogFactory.getLog(WxOrderService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired

            

Reported by PMD.

The class 'WxOrderService' has a Standard Cyclomatic Complexity of 9 (Highest = 32).
Design

Line: 69

               * 当402系统自动确认收货以后,此时用户可以删除订单,评价商品,申请售后,或者再次购买
 */
@Service
public class WxOrderService {
    private final Log logger = LogFactory.getLog(WxOrderService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 69

               * 当402系统自动确认收货以后,此时用户可以删除订单,评价商品,申请售后,或者再次购买
 */
@Service
public class WxOrderService {
    private final Log logger = LogFactory.getLog(WxOrderService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired

            

Reported by PMD.

Too many fields
Design

Line: 69

               * 当402系统自动确认收货以后,此时用户可以删除订单,评价商品,申请售后,或者再次购买
 */
@Service
public class WxOrderService {
    private final Log logger = LogFactory.getLog(WxOrderService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired

            

Reported by PMD.

The class 'WxOrderService' has a Modified Cyclomatic Complexity of 9 (Highest = 32).
Design

Line: 69

               * 当402系统自动确认收货以后,此时用户可以删除订单,评价商品,申请售后,或者再次购买
 */
@Service
public class WxOrderService {
    private final Log logger = LogFactory.getLog(WxOrderService.class);

    @Autowired
    private LitemallUserService userService;
    @Autowired

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallOrder.java
154 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 1209

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_order

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 1210

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_order
         *

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 1

              package org.linlinjava.litemall.db.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**

            

Reported by PMD.

The class 'LitemallOrder' has a Modified Cyclomatic Complexity of 2 (Highest = 35).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallOrder' has a total cyclomatic complexity of 132 (highest 35).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallOrder' has a Standard Cyclomatic Complexity of 2 (Highest = 35).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

Possible God Class (WMC=132, ATFD=156, TCC=4.476%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrder {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order
     *
     * @mbg.generated

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 1031

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_order.deleted

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallGoods.java
115 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 849

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_goods

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 850

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_goods
         *

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 1

              package org.linlinjava.litemall.db.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**

            

Reported by PMD.

The class 'LitemallGoods' has a Standard Cyclomatic Complexity of 2 (Highest = 24).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallGoods' has a total cyclomatic complexity of 90 (highest 24).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallGoods' has a Modified Cyclomatic Complexity of 2 (Highest = 24).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

Possible God Class (WMC=90, ATFD=102, TCC=6.377%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_goods
     *
     * @mbg.generated

            

Reported by PMD.

Returning 'gallery' may expose an internal array.
Design

Line: 343

                   * @mbg.generated
     */
    public String[] getGallery() {
        return gallery;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_goods.gallery

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCoupon.java
112 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 813

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_coupon

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 814

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_coupon
         *

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 1

              package org.linlinjava.litemall.db.domain;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

Possible God Class (WMC=86, ATFD=97, TCC=6.660%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallCoupon' has a Modified Cyclomatic Complexity of 2 (Highest = 23).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallCoupon' has a Standard Cyclomatic Complexity of 2 (Highest = 23).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallCoupon' has a total cyclomatic complexity of 86 (highest 23).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCoupon {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_coupon
     *
     * @mbg.generated

            

Reported by PMD.

Returning 'goodsValue' may expose an internal array.
Design

Line: 478

                   * @mbg.generated
     */
    public Integer[] getGoodsValue() {
        return goodsValue;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_coupon.goods_value

            

Reported by PMD.

litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCartController.java
104 issues
Logger calls should be surrounded by log level guards.
Design

Line: 70

                          LitemallGoods goods = goodsService.findById(cart.getGoodsId());
            if (goods == null || !goods.getIsOnSale()) {
                cartService.deleteById(cart.getId());
                logger.debug("系统自动删除失效购物车商品 goodsId=" + cart.getGoodsId() + " productId=" + cart.getProductId());
            }
            else{
                cartList.add(cart);
            }
        }

            

Reported by PMD.

Avoid reassigning parameters such as 'userCouponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'userCouponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'userCouponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'couponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'couponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'couponId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'addressId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

Avoid reassigning parameters such as 'addressId'
Design

Line: 409

                   * @return 购物车操作结果
     */
    @GetMapping("checkout")
    public Object checkout(@LoginUser Integer userId, Integer cartId, Integer addressId, Integer couponId, Integer userCouponId, Integer grouponRulesId) {
        if (userId == null) {
            return ResponseUtil.unlogin();
        }

        // 收货地址

            

Reported by PMD.

The class 'WxCartController' has a Standard Cyclomatic Complexity of 9 (Highest = 17).
Design

Line: 29

              @RestController
@RequestMapping("/wx/cart")
@Validated
public class WxCartController {
    private final Log logger = LogFactory.getLog(WxCartController.class);

    @Autowired
    private LitemallCartService cartService;
    @Autowired

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallUser.java
95 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 705

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 706

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user
         *

            

Reported by PMD.

This class has a bunch of public methods and attributes
Design

Line: 1

              package org.linlinjava.litemall.db.domain;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

public class LitemallUser {
    /**

            

Reported by PMD.

The class 'LitemallUser' has a Standard Cyclomatic Complexity of 2 (Highest = 21).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallUser {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_user
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallUser {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_user
     *
     * @mbg.generated

            

Reported by PMD.

Possible God Class (WMC=76, ATFD=86, TCC=7.681%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallUser {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_user
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallUser' has a Modified Cyclomatic Complexity of 2 (Highest = 21).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallUser {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_user
     *
     * @mbg.generated

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 569

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_user.deleted

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 569

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_user.deleted

            

Reported by PMD.

StringBuffer constructor is initialized with size 16, but has at least 225 characters appended.
Performance

Line: 604

                   */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", IS_DELETED=").append(IS_DELETED);
        sb.append(", NOT_DELETED=").append(NOT_DELETED);

            

Reported by PMD.

litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxAuthController.java
85 issues
A high number of imports can indicate a high degree of coupling within an object.
Design

Line: 1

              package org.linlinjava.litemall.wx.web;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.linlinjava.litemall.core.notify.NotifyService;
import org.linlinjava.litemall.core.notify.NotifyType;

            

Reported by PMD.

This class has too many methods, consider refactoring it.
Design

Line: 44

              @RestController
@RequestMapping("/wx/auth")
@Validated
public class WxAuthController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;


            

Reported by PMD.

The class 'WxAuthController' has a Modified Cyclomatic Complexity of 6 (Highest = 11).
Design

Line: 44

              @RestController
@RequestMapping("/wx/auth")
@Validated
public class WxAuthController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;


            

Reported by PMD.

The class 'WxAuthController' has a Standard Cyclomatic Complexity of 6 (Highest = 11).
Design

Line: 44

              @RestController
@RequestMapping("/wx/auth")
@Validated
public class WxAuthController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;


            

Reported by PMD.

Logger should be defined private static final and have the correct class
Error

Line: 45

              @RequestMapping("/wx/auth")
@Validated
public class WxAuthController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;

    @Autowired

            

Reported by PMD.

Avoid unused private fields such as 'logger'.
Design

Line: 45

              @RequestMapping("/wx/auth")
@Validated
public class WxAuthController {
    private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;

    @Autowired

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 48

                  private final Log logger = LogFactory.getLog(WxAuthController.class);

    @Autowired
    private LitemallUserService userService;

    @Autowired
    private WxMaService wxService;

    @Autowired

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 51

                  private LitemallUserService userService;

    @Autowired
    private WxMaService wxService;

    @Autowired
    private NotifyService notifyService;

    @Autowired

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 54

                  private WxMaService wxService;

    @Autowired
    private NotifyService notifyService;

    @Autowired
    private CouponAssignService couponAssignService;

    /**

            

Reported by PMD.

Found non-transient, non-static member. Please mark as transient or provide accessors.
Error

Line: 57

                  private NotifyService notifyService;

    @Autowired
    private CouponAssignService couponAssignService;

    /**
     * 账号登录
     *
     * @param body    请求内容,{ username: xxx, password: xxx }

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCart.java
84 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 597

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_cart

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 598

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_cart
         *

            

Reported by PMD.

The class 'LitemallCart' has a Standard Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCart {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_cart
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCart {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_cart
     *
     * @mbg.generated

            

Reported by PMD.

Possible God Class (WMC=62, ATFD=67, TCC=9.073%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCart {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_cart
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallCart' has a Modified Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallCart {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_cart
     *
     * @mbg.generated

            

Reported by PMD.

Returning 'specifications' may expose an internal array.
Design

Line: 352

                   * @mbg.generated
     */
    public String[] getSpecifications() {
        return specifications;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_cart.specifications

            

Reported by PMD.

The user-supplied array 'specifications' is stored directly.
Design

Line: 363

                   *
     * @mbg.generated
     */
    public void setSpecifications(String[] specifications) {
        this.specifications = specifications;
    }

    /**
     * This method was generated by MyBatis Generator.

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_cart.deleted

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_cart.deleted

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallOrderGoods.java
84 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 597

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_order_goods

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 598

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_order_goods
         *

            

Reported by PMD.

Possible God Class (WMC=62, ATFD=67, TCC=9.073%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrderGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order_goods
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallOrderGoods' has a Modified Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrderGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order_goods
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallOrderGoods' has a Standard Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrderGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order_goods
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallOrderGoods {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_order_goods
     *
     * @mbg.generated

            

Reported by PMD.

Returning 'specifications' may expose an internal array.
Design

Line: 352

                   * @mbg.generated
     */
    public String[] getSpecifications() {
        return specifications;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_order_goods.specifications

            

Reported by PMD.

The user-supplied array 'specifications' is stored directly.
Design

Line: 363

                   *
     * @mbg.generated
     */
    public void setSpecifications(String[] specifications) {
        this.specifications = specifications;
    }

    /**
     * This method was generated by MyBatis Generator.

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_order_goods.deleted

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_order_goods.deleted

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallAftersale.java
83 issues
Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 597

                   * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_aftersale

            

Reported by PMD.

Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead.
Performance

Line: 598

                   */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_aftersale
         *

            

Reported by PMD.

Possible God Class (WMC=62, ATFD=67, TCC=9.073%)
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallAftersale {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_aftersale
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallAftersale' has a Modified Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallAftersale {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_aftersale
     *
     * @mbg.generated

            

Reported by PMD.

The class 'LitemallAftersale' has a Standard Cyclomatic Complexity of 2 (Highest = 17).
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallAftersale {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_aftersale
     *
     * @mbg.generated

            

Reported by PMD.

Too many fields
Design

Line: 8

              import java.util.ArrayList;
import java.util.Arrays;

public class LitemallAftersale {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table litemall_aftersale
     *
     * @mbg.generated

            

Reported by PMD.

Returning 'pictures' may expose an internal array.
Design

Line: 328

                   * @mbg.generated
     */
    public String[] getPictures() {
        return pictures;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column litemall_aftersale.pictures

            

Reported by PMD.

The user-supplied array 'pictures' is stored directly.
Design

Line: 339

                   *
     * @mbg.generated
     */
    public void setPictures(String[] pictures) {
        this.pictures = pictures;
    }

    /**
     * This method was generated by MyBatis Generator.

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_aftersale.deleted

            

Reported by PMD.

Potential violation of Law of Demeter (static property access)
Design

Line: 470

                   * @mbg.generated
     */
    public void andLogicalDeleted(boolean deleted) {
        setDeleted(deleted ? Deleted.IS_DELETED.value() : Deleted.NOT_DELETED.value());
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column litemall_aftersale.deleted

            

Reported by PMD.