The following issues were found

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

Line: 488

                   * @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_log

            

Reported by PMD.

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

Line: 489

                   */
    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_log
         *

            

Reported by PMD.

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

Line: 7

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

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

            

Reported by PMD.

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

Line: 7

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

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

            

Reported by PMD.

Possible God Class (WMC=52, ATFD=56, TCC=12.000%)
Design

Line: 7

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

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

            

Reported by PMD.

Too many fields
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 370

                   * @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_log.deleted

            

Reported by PMD.

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

Line: 370

                   * @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_log.deleted

            

Reported by PMD.

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

Line: 405

                   */
    @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.

Potential violation of Law of Demeter (method chain calls)
Design

Line: 406

                  @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);
        sb.append(", id=").append(id);

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallGoodsExample.java
70 issues
Avoid throwing raw exception types.
Design

Line: 245

              
        protected void addGalleryCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            galleryCriteria.add(new Criterion(condition, value, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 253

              
        protected void addGalleryCriterion(String condition, String[] value1, String[] value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            galleryCriteria.add(new Criterion(condition, value1, value2, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 279

              
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 287

              
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 295

              
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
            allCriteria = null;
        }


            

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.List;

public class LitemallGoodsExample {
    /**

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.List;

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

            

Reported by PMD.

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

Line: 31

                   *
     * @mbg.generated
     */
    protected List<Criteria> oredCriteria;

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

            

Reported by PMD.

Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()
Design

Line: 152

                   */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }


            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 177

                   */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

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

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCouponExample.java
70 issues
Avoid throwing raw exception types.
Design

Line: 245

              
        protected void addGoodsValueCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            goodsValueCriteria.add(new Criterion(condition, value, "org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 253

              
        protected void addGoodsValueCriterion(String condition, Integer[] value1, Integer[] value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            goodsValueCriteria.add(new Criterion(condition, value1, value2, "org.linlinjava.litemall.db.mybatis.JsonIntegerArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 279

              
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 287

              
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 295

              
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
            allCriteria = null;
        }


            

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.List;

public class LitemallCouponExample {
    /**

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.List;

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

            

Reported by PMD.

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

Line: 31

                   *
     * @mbg.generated
     */
    protected List<Criteria> oredCriteria;

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

            

Reported by PMD.

Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()
Design

Line: 152

                   */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }


            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 177

                   */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

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

            

Reported by PMD.

litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxCouponController.java
69 issues
The class 'WxCouponController' has a Modified Cyclomatic Complexity of 6 (Highest = 12).
Design

Line: 33

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

    @Autowired
    private LitemallCouponService couponService;
    @Autowired

            

Reported by PMD.

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

Line: 33

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

    @Autowired
    private LitemallCouponService couponService;
    @Autowired

            

Reported by PMD.

Avoid unused private fields such as 'logger'.
Design

Line: 34

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

    @Autowired
    private LitemallCouponService couponService;
    @Autowired
    private LitemallCouponUserService couponUserService;

            

Reported by PMD.

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

Line: 34

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

    @Autowired
    private LitemallCouponService couponService;
    @Autowired
    private LitemallCouponUserService couponUserService;

            

Reported by PMD.

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

Line: 37

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

    @Autowired
    private LitemallCouponService couponService;
    @Autowired
    private LitemallCouponUserService couponUserService;
    @Autowired
    private LitemallGrouponRulesService grouponRulesService;
    @Autowired

            

Reported by PMD.

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

Line: 39

                  @Autowired
    private LitemallCouponService couponService;
    @Autowired
    private LitemallCouponUserService couponUserService;
    @Autowired
    private LitemallGrouponRulesService grouponRulesService;
    @Autowired
    private LitemallCartService cartService;
    @Autowired

            

Reported by PMD.

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

Line: 41

                  @Autowired
    private LitemallCouponUserService couponUserService;
    @Autowired
    private LitemallGrouponRulesService grouponRulesService;
    @Autowired
    private LitemallCartService cartService;
    @Autowired
    private CouponVerifyService couponVerifyService;


            

Reported by PMD.

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

Line: 43

                  @Autowired
    private LitemallGrouponRulesService grouponRulesService;
    @Autowired
    private LitemallCartService cartService;
    @Autowired
    private CouponVerifyService couponVerifyService;

    /**
     * 优惠券列表

            

Reported by PMD.

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

Line: 45

                  @Autowired
    private LitemallCartService cartService;
    @Autowired
    private CouponVerifyService couponVerifyService;

    /**
     * 优惠券列表
     *
     * @param page

            

Reported by PMD.

Avoid instantiating new objects inside loops
Performance

Line: 98

                      for(LitemallCouponUser couponUser : couponList){
            Integer couponId = couponUser.getCouponId();
            LitemallCoupon coupon = couponService.findById(couponId);
            CouponVo couponVo = new CouponVo();
            couponVo.setId(couponUser.getId());
            couponVo.setCid(coupon.getId());
            couponVo.setName(coupon.getName());
            couponVo.setDesc(coupon.getDesc());
            couponVo.setTag(coupon.getTag());

            

Reported by PMD.

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

Line: 489

                   * @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_groupon_rules

            

Reported by PMD.

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

Line: 490

                   */
    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_groupon_rules
         *

            

Reported by PMD.

Too many fields
Design

Line: 8

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

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

            

Reported by PMD.

Possible God Class (WMC=52, ATFD=56, TCC=11.077%)
Design

Line: 8

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

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

            

Reported by PMD.

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

Line: 8

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

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

            

Reported by PMD.

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

Line: 8

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

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

            

Reported by PMD.

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

Line: 371

                   * @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_groupon_rules.deleted

            

Reported by PMD.

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

Line: 371

                   * @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_groupon_rules.deleted

            

Reported by PMD.

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

Line: 406

                   */
    @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.

StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable.
Performance

Line: 407

                  @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);
        sb.append(", id=").append(id);

            

Reported by PMD.

litemall-db/sql/litemall_table.sql
69 issues
Syntax error at or near "`"
Syntax error

Line: 22 Column: 22

              -- Table structure for table `litemall_ad`
--

DROP TABLE IF EXISTS `litemall_ad`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_ad` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(63) NOT NULL DEFAULT '' COMMENT '广告标题',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 25 Column: 14

              DROP TABLE IF EXISTS `litemall_ad`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_ad` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(63) NOT NULL DEFAULT '' COMMENT '广告标题',
  `link` varchar(255) NOT NULL DEFAULT '' COMMENT '所广告的商品页面或者活动页面链接地址',
  `url` varchar(255) NOT NULL COMMENT '广告宣传图片',
  `position` tinyint(3) DEFAULT '1' COMMENT '广告位置:1则是首页',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 47 Column: 22

              -- Table structure for table `litemall_address`
--

DROP TABLE IF EXISTS `litemall_address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(63) NOT NULL DEFAULT '' COMMENT '收货人名称',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 50 Column: 14

              DROP TABLE IF EXISTS `litemall_address`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(63) NOT NULL DEFAULT '' COMMENT '收货人名称',
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户表的用户ID',
  `province` varchar(63) NOT NULL COMMENT '行政区域表的省ID',
  `city` varchar(63) NOT NULL COMMENT '行政区域表的市ID',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 74 Column: 22

              -- Table structure for table `litemall_admin`
--

DROP TABLE IF EXISTS `litemall_admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(63) NOT NULL DEFAULT '' COMMENT '管理员名称',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 77 Column: 14

              DROP TABLE IF EXISTS `litemall_admin`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_admin` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(63) NOT NULL DEFAULT '' COMMENT '管理员名称',
  `password` varchar(63) NOT NULL DEFAULT '' COMMENT '管理员密码',
  `last_login_ip` varchar(63) DEFAULT '' COMMENT '最近一次登录IP地址',
  `last_login_time` datetime DEFAULT NULL COMMENT '最近一次登录时间',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 96 Column: 22

              -- Table structure for table `litemall_aftersale`
--

DROP TABLE IF EXISTS `litemall_aftersale`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_aftersale` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aftersale_sn` varchar(63) DEFAULT NULL COMMENT '售后编号',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 99 Column: 14

              DROP TABLE IF EXISTS `litemall_aftersale`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_aftersale` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `aftersale_sn` varchar(63) DEFAULT NULL COMMENT '售后编号',
  `order_id` int(11) NOT NULL COMMENT '订单ID',
  `user_id` int(11) NOT NULL COMMENT '用户ID',
  `type` smallint(6) DEFAULT '0' COMMENT '售后类型,0是未收货退款,1是已收货(无需退货)退款,2用户退货退款',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 122 Column: 22

              -- Table structure for table `litemall_brand`
--

DROP TABLE IF EXISTS `litemall_brand`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_brand` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商名称',

            

Reported by SQLint.

Syntax error at or near "`"
Syntax error

Line: 125 Column: 14

              DROP TABLE IF EXISTS `litemall_brand`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `litemall_brand` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商名称',
  `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商简介',
  `pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌商页的品牌商图片',
  `sort_order` tinyint(3) DEFAULT '50',

            

Reported by SQLint.

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

Line: 452

                   * @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_admin

            

Reported by PMD.

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

Line: 453

                   */
    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_admin
         *

            

Reported by PMD.

Too many fields
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 7

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

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

            

Reported by PMD.

The class 'LitemallAdmin' is suspected to be a Data Class (WOC=16.667%, NOPA=2, NOAM=20, WMC=46)
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 7

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

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

            

Reported by PMD.

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

Line: 313

                   * @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_admin.deleted

            

Reported by PMD.

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

Line: 313

                   * @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_admin.deleted

            

Reported by PMD.

Returning 'roleIds' may expose an internal array.
Design

Line: 349

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

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

            

Reported by PMD.

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

Line: 360

                   *
     * @mbg.generated
     */
    public void setRoleIds(Integer[] roleIds) {
        this.roleIds = roleIds;
    }

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

            

Reported by PMD.

litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/AdminGoodsService.java
67 issues
Avoid throwing raw exception types.
Design

Line: 171

                      
        // 商品基本信息表litemall_goods
        if (goodsService.updateById(goods) == 0) {
            throw new RuntimeException("更新数据失败");
        }

        Integer gid = goods.getId();

        // 商品规格表litemall_goods_specification

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 266

                      if (!StringUtils.isEmpty(url)) {
            goods.setShareUrl(url);
            if (goodsService.updateById(goods) == 0) {
                throw new RuntimeException("更新数据失败");
            }
        }

        // 商品规格表litemall_goods_specification
        for (LitemallGoodsSpecification specification : specifications) {

            

Reported by PMD.

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

Line: 25

              import static org.linlinjava.litemall.admin.util.AdminResponseCode.GOODS_NAME_EXIST;

@Service
public class AdminGoodsService {
    private final Log logger = LogFactory.getLog(AdminGoodsService.class);

    @Autowired
    private LitemallGoodsService goodsService;
    @Autowired

            

Reported by PMD.

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

Line: 25

              import static org.linlinjava.litemall.admin.util.AdminResponseCode.GOODS_NAME_EXIST;

@Service
public class AdminGoodsService {
    private final Log logger = LogFactory.getLog(AdminGoodsService.class);

    @Autowired
    private LitemallGoodsService goodsService;
    @Autowired

            

Reported by PMD.

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

Line: 26

              
@Service
public class AdminGoodsService {
    private final Log logger = LogFactory.getLog(AdminGoodsService.class);

    @Autowired
    private LitemallGoodsService goodsService;
    @Autowired
    private LitemallGoodsSpecificationService specificationService;

            

Reported by PMD.

Avoid unused private fields such as 'logger'.
Design

Line: 26

              
@Service
public class AdminGoodsService {
    private final Log logger = LogFactory.getLog(AdminGoodsService.class);

    @Autowired
    private LitemallGoodsService goodsService;
    @Autowired
    private LitemallGoodsSpecificationService specificationService;

            

Reported by PMD.

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

Line: 29

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

    @Autowired
    private LitemallGoodsService goodsService;
    @Autowired
    private LitemallGoodsSpecificationService specificationService;
    @Autowired
    private LitemallGoodsAttributeService attributeService;
    @Autowired

            

Reported by PMD.

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

Line: 31

                  @Autowired
    private LitemallGoodsService goodsService;
    @Autowired
    private LitemallGoodsSpecificationService specificationService;
    @Autowired
    private LitemallGoodsAttributeService attributeService;
    @Autowired
    private LitemallGoodsProductService productService;
    @Autowired

            

Reported by PMD.

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

Line: 33

                  @Autowired
    private LitemallGoodsSpecificationService specificationService;
    @Autowired
    private LitemallGoodsAttributeService attributeService;
    @Autowired
    private LitemallGoodsProductService productService;
    @Autowired
    private LitemallCategoryService categoryService;
    @Autowired

            

Reported by PMD.

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

Line: 35

                  @Autowired
    private LitemallGoodsAttributeService attributeService;
    @Autowired
    private LitemallGoodsProductService productService;
    @Autowired
    private LitemallCategoryService categoryService;
    @Autowired
    private LitemallBrandService brandService;
    @Autowired

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallCartExample.java
64 issues
Avoid throwing raw exception types.
Design

Line: 245

              
        protected void addSpecificationsCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            specificationsCriteria.add(new Criterion(condition, value, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 253

              
        protected void addSpecificationsCriterion(String condition, String[] value1, String[] value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            specificationsCriteria.add(new Criterion(condition, value1, value2, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 279

              
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 287

              
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 295

              
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
            allCriteria = null;
        }


            

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.List;

public class LitemallCartExample {
    /**

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.List;

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

            

Reported by PMD.

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

Line: 31

                   *
     * @mbg.generated
     */
    protected List<Criteria> oredCriteria;

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

            

Reported by PMD.

Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()
Design

Line: 152

                   */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }


            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 177

                   */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

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

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/domain/LitemallAftersaleExample.java
64 issues
Avoid throwing raw exception types.
Design

Line: 245

              
        protected void addPicturesCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            picturesCriteria.add(new Criterion(condition, value, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 253

              
        protected void addPicturesCriterion(String condition, String[] value1, String[] value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            picturesCriteria.add(new Criterion(condition, value1, value2, "org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler"));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 279

              
        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 287

              
        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
            allCriteria = null;
        }


            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 295

              
        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
            allCriteria = null;
        }


            

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.List;

public class LitemallAftersaleExample {
    /**

            

Reported by PMD.

Avoid really long classes.
Design

Line: 8

              import java.util.ArrayList;
import java.util.List;

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

            

Reported by PMD.

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

Line: 31

                   *
     * @mbg.generated
     */
    protected List<Criteria> oredCriteria;

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

            

Reported by PMD.

Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty()
Design

Line: 152

                   */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }


            

Reported by PMD.

Assigning an Object to null is a code smell. Consider refactoring.
Error

Line: 177

                   */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

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

            

Reported by PMD.