The following issues were found
litemall-admin-api/src/test/java/org/linlinjava/litemall/admin/BcryptTest.java
3 issues
Line: 21
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
encodedPassword = bCryptPasswordEncoder.encode(rawPassword);
System.out.println("rawPassword=" + rawPassword + " encodedPassword=" + encodedPassword);
Assert.assertTrue(bCryptPasswordEncoder.matches(rawPassword, encodedPassword));
}
}
Reported by PMD.
Line: 17
@Test
public void test() {
String rawPassword = "aaaaaa";
String encodedPassword = "";
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
encodedPassword = bCryptPasswordEncoder.encode(rawPassword);
System.out.println("rawPassword=" + rawPassword + " encodedPassword=" + encodedPassword);
Reported by PMD.
Line: 17
@Test
public void test() {
String rawPassword = "aaaaaa";
String encodedPassword = "";
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
encodedPassword = bCryptPasswordEncoder.encode(rawPassword);
System.out.println("rawPassword=" + rawPassword + " encodedPassword=" + encodedPassword);
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallLogService.java
3 issues
Line: 18
@Service
public class LitemallLogService {
@Resource
private LitemallLogMapper logMapper;
public void deleteById(Integer id) {
logMapper.logicalDeleteByPrimaryKey(id);
}
Reported by PMD.
Line: 37
if (!StringUtils.isEmpty(name)) {
criteria.andAdminLike("%" + name + "%");
}
criteria.andDeletedEqualTo(false);
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
example.setOrderByClause(sort + " " + order);
}
Reported by PMD.
Line: 5
import com.github.pagehelper.PageHelper;
import org.linlinjava.litemall.db.dao.LitemallLogMapper;
import org.linlinjava.litemall.db.domain.LitemallAd;
import org.linlinjava.litemall.db.domain.LitemallLog;
import org.linlinjava.litemall.db.domain.LitemallLogExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
Reported by PMD.
litemall-core/src/main/java/org/linlinjava/litemall/core/notify/TencentSmsSender.java
3 issues
Line: 15
* 腾讯云短信服务
*/
public class TencentSmsSender implements SmsSender {
private final Log logger = LogFactory.getLog(TencentSmsSender.class);
private SmsSingleSender sender;
private String sign;
public SmsSingleSender getSender() {
Reported by PMD.
Line: 15
* 腾讯云短信服务
*/
public class TencentSmsSender implements SmsSender {
private final Log logger = LogFactory.getLog(TencentSmsSender.class);
private SmsSingleSender sender;
private String sign;
public SmsSingleSender getSender() {
Reported by PMD.
Line: 18
private final Log logger = LogFactory.getLog(TencentSmsSender.class);
private SmsSingleSender sender;
private String sign;
public SmsSingleSender getSender() {
return sender;
}
Reported by PMD.
litemall-core/src/test/java/org/linlinjava/litemall/core/AsyncTest.java
3 issues
Line: 20
public class AsyncTest {
@Autowired
AsyncTask task;
@Test
public void test() {
task.asyncMethod();
task.nonasyncMethod();
Reported by PMD.
Line: 23
AsyncTask task;
@Test
public void test() {
task.asyncMethod();
task.nonasyncMethod();
}
}
Reported by PMD.
Line: 7
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
/**
* 异步测试
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/vo/StatVo.java
3 issues
Line: 8
import java.util.List;
import java.util.Map;
public class StatVo {
private String[] columns = new String[0];
private List<Map> rows = new ArrayList<>();
public String[] getColumns() {
return columns;
Reported by PMD.
Line: 16
return columns;
}
public void setColumns(String[] columns) {
this.columns = columns;
}
public List<Map> getRows() {
return rows;
Reported by PMD.
Line: 16
return columns;
}
public void setColumns(String[] columns) {
this.columns = columns;
}
public List<Map> getRows() {
return rows;
Reported by PMD.
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxUserController.java
3 issues
Line: 24
@RequestMapping("/wx/user")
@Validated
public class WxUserController {
private final Log logger = LogFactory.getLog(WxUserController.class);
@Autowired
private LitemallOrderService orderService;
/**
Reported by PMD.
Line: 24
@RequestMapping("/wx/user")
@Validated
public class WxUserController {
private final Log logger = LogFactory.getLog(WxUserController.class);
@Autowired
private LitemallOrderService orderService;
/**
Reported by PMD.
Line: 27
private final Log logger = LogFactory.getLog(WxUserController.class);
@Autowired
private LitemallOrderService orderService;
/**
* 用户个人页面数据
* <p>
* 目前是用户订单统计信息
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/service/LogHelper.java
3 issues
Line: 26
* 当然可能很多操作是不需要记录到数据库的,例如编辑商品、编辑广告品之类。
*/
@Component
public class LogHelper {
public static final Integer LOG_TYPE_GENERAL = 0;
public static final Integer LOG_TYPE_AUTH = 1;
public static final Integer LOG_TYPE_ORDER = 2;
public static final Integer LOG_TYPE_OTHER = 3;
Reported by PMD.
Line: 33
public static final Integer LOG_TYPE_OTHER = 3;
@Autowired
private LitemallLogService logService;
public void logGeneralSucceed(String action) {
logAdmin(LOG_TYPE_GENERAL, action, true, "", "");
}
Reported by PMD.
Line: 91
if (currentUser != null) {
LitemallAdmin admin = (LitemallAdmin) currentUser.getPrincipal();
if (admin != null) {
log.setAdmin(admin.getUsername());
} else {
log.setAdmin("匿名用户");
}
} else {
log.setAdmin("匿名用户");
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallSearchHistoryMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallSearchHistory;
import org.linlinjava.litemall.db.domain.LitemallSearchHistoryExample;
public interface LitemallSearchHistoryMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_search_history
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallSearchHistory selectOneByExampleSelective(@Param("example") LitemallSearchHistoryExample example, @Param("selective") LitemallSearchHistory.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_search_history
*
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallRegionMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallRegion;
import org.linlinjava.litemall.db.domain.LitemallRegionExample;
public interface LitemallRegionMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_region
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallRegion selectOneByExampleSelective(@Param("example") LitemallRegionExample example, @Param("selective") LitemallRegion.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_region
*
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallPermissionMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallPermission;
import org.linlinjava.litemall.db.domain.LitemallPermissionExample;
public interface LitemallPermissionMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_permission
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallPermission selectOneByExampleSelective(@Param("example") LitemallPermissionExample example, @Param("selective") LitemallPermission.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_permission
*
Reported by PMD.