The following issues were found

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallGoodsSpecificationExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

Possible God Class (WMC=164, ATFD=48, TCC=0.124%)
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallNoticeAdminExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

Avoid really long classes.
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

The class 'GeneratedCriteria' has a total cyclomatic complexity of 160 (highest 4).
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallNoticeAdminService.java
36 issues
This class has too many methods, consider refactoring it.
Design

Line: 14

              import java.util.List;

@Service
public class LitemallNoticeAdminService {
    @Resource
    private LitemallNoticeAdminMapper noticeAdminMapper;

    public List<LitemallNoticeAdmin> querySelective(String title, String type, Integer adminId, Integer page, Integer limit, String sort, String order) {
        LitemallNoticeAdminExample example = new LitemallNoticeAdminExample();

            

Reported by PMD.

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

Line: 16

              @Service
public class LitemallNoticeAdminService {
    @Resource
    private LitemallNoticeAdminMapper noticeAdminMapper;

    public List<LitemallNoticeAdmin> querySelective(String title, String type, Integer adminId, Integer page, Integer limit, String sort, String order) {
        LitemallNoticeAdminExample example = new LitemallNoticeAdminExample();
        LitemallNoticeAdminExample.Criteria criteria = example.createCriteria();


            

Reported by PMD.

Rather than using a lot of String arguments, consider using a container object for those values.
Design

Line: 18

                  @Resource
    private LitemallNoticeAdminMapper noticeAdminMapper;

    public List<LitemallNoticeAdmin> querySelective(String title, String type, Integer adminId, Integer page, Integer limit, String sort, String order) {
        LitemallNoticeAdminExample example = new LitemallNoticeAdminExample();
        LitemallNoticeAdminExample.Criteria criteria = example.createCriteria();

        if(!StringUtils.isEmpty(title)){
            criteria.andNoticeTitleLike("%" + title + "%");

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 26

                          criteria.andNoticeTitleLike("%" + title + "%");
        }

        if(type.equals("read")){
         criteria.andReadTimeIsNotNull();
        }
        else if(type.equals("unread")){
            criteria.andReadTimeIsNull();
        }

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 26

                          criteria.andNoticeTitleLike("%" + title + "%");
        }

        if(type.equals("read")){
         criteria.andReadTimeIsNotNull();
        }
        else if(type.equals("unread")){
            criteria.andReadTimeIsNull();
        }

            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 29

                      if(type.equals("read")){
         criteria.andReadTimeIsNotNull();
        }
        else if(type.equals("unread")){
            criteria.andReadTimeIsNull();
        }
        criteria.andAdminIdEqualTo(adminId);
        criteria.andDeletedEqualTo(false);


            

Reported by PMD.

Position literals first in String comparisons
Design

Line: 29

                      if(type.equals("read")){
         criteria.andReadTimeIsNotNull();
        }
        else if(type.equals("unread")){
            criteria.andReadTimeIsNull();
        }
        criteria.andAdminIdEqualTo(adminId);
        criteria.andDeletedEqualTo(false);


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 32

                      else if(type.equals("unread")){
            criteria.andReadTimeIsNull();
        }
        criteria.andAdminIdEqualTo(adminId);
        criteria.andDeletedEqualTo(false);

        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
            example.setOrderByClause(sort + " " + order);
        }

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 33

                          criteria.andReadTimeIsNull();
        }
        criteria.andAdminIdEqualTo(adminId);
        criteria.andDeletedEqualTo(false);

        if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
            example.setOrderByClause(sort + " " + order);
        }


            

Reported by PMD.

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

Line: 45

              
    public LitemallNoticeAdmin find(Integer noticeId, Integer adminId) {
        LitemallNoticeAdminExample example = new LitemallNoticeAdminExample();
        example.or().andNoticeIdEqualTo(noticeId).andAdminIdEqualTo(adminId).andDeletedEqualTo(false);
        return noticeAdminMapper.selectOneByExample(example);
    }

    public void add(LitemallNoticeAdmin noticeAdmin) {
        noticeAdmin.setAddTime(LocalDateTime.now());

            

Reported by PMD.

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

Line: 1

              package org.linlinjava.litemall.admin.web;

import com.google.code.kaptcha.Producer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;

            

Reported by PMD.

Avoid unused private fields such as 'logger'.
Design

Line: 44

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

    @Autowired
    private LitemallAdminService adminService;
    @Autowired
    private LitemallRoleService roleService;

            

Reported by PMD.

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

Line: 44

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

    @Autowired
    private LitemallAdminService adminService;
    @Autowired
    private LitemallRoleService roleService;

            

Reported by PMD.

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

Line: 47

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

    @Autowired
    private LitemallAdminService adminService;
    @Autowired
    private LitemallRoleService roleService;
    @Autowired
    private LitemallPermissionService permissionService;
    @Autowired

            

Reported by PMD.

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

Line: 49

                  @Autowired
    private LitemallAdminService adminService;
    @Autowired
    private LitemallRoleService roleService;
    @Autowired
    private LitemallPermissionService permissionService;
    @Autowired
    private LogHelper logHelper;


            

Reported by PMD.

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

Line: 51

                  @Autowired
    private LitemallRoleService roleService;
    @Autowired
    private LitemallPermissionService permissionService;
    @Autowired
    private LogHelper logHelper;

    @Autowired
    private Producer kaptchaProducer;

            

Reported by PMD.

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

Line: 53

                  @Autowired
    private LitemallPermissionService permissionService;
    @Autowired
    private LogHelper logHelper;

    @Autowired
    private Producer kaptchaProducer;

    @GetMapping("/kaptcha")

            

Reported by PMD.

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

Line: 56

                  private LogHelper logHelper;

    @Autowired
    private Producer kaptchaProducer;

    @GetMapping("/kaptcha")
    public Object kaptcha(HttpServletRequest request) {
        String kaptcha = doKaptcha(request);
        if (kaptcha != null) {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 72

                      String text = kaptchaProducer.createText();
        BufferedImage image = kaptchaProducer.createImage(text);
        HttpSession session = request.getSession();
        session.setAttribute("kaptcha", text);

        try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            ImageIO.write(image, "jpeg", outputStream);
            String base64 = Base64.getEncoder().encodeToString(outputStream.toByteArray());

            

Reported by PMD.

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

Line: 77

                      try {
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
            ImageIO.write(image, "jpeg", outputStream);
            String base64 = Base64.getEncoder().encodeToString(outputStream.toByteArray());
            return "data:image/jpeg;base64," + base64.replaceAll("\r\n", "");
        } catch (IOException e) {
            return null;
        }
    }

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallGoodsAttributeExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

Possible God Class (WMC=144, ATFD=42, TCC=0.163%)
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallNoticeExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

Possible God Class (WMC=144, ATFD=42, TCC=0.163%)
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallSearchHistoryExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

The class 'GeneratedCriteria' has a total cyclomatic complexity of 144 (highest 4).
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallCollectExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

The class 'GeneratedCriteria' has a total cyclomatic complexity of 140 (highest 4).
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallRoleExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

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

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

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

Line: 247

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

        protected void addCriterion(String condition, Object value, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 254

              
        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));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {

            

Reported by PMD.

Avoid throwing raw exception types.
Design

Line: 261

              
        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));
        }

        public Criteria andIdIsNull() {

            

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.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

public class LitemallSystemExample {
    /**
     * This field was generated by MyBatis Generator.

            

Reported by PMD.

Avoid really long classes.
Design

Line: 7

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

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

            

Reported by PMD.

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

Line: 30

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

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

            

Reported by PMD.

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

Line: 151

                   */
    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: 176

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

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

            

Reported by PMD.

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

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.

This abstract class does not have any abstract methods
Design

Line: 225

                   *
     * @mbg.generated
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();

            

Reported by PMD.