The following issues were found
litemall-db/src/test/java/org/linlinjava/litemall/db/StockTest.java
4 issues
Line: 17
@SpringBootTest
public class StockTest {
@Autowired
private GoodsProductMapper goodsProductMapper;
@Test
public void testReduceStock() {
Integer id = 1;
Short num = 10;
Reported by PMD.
Line: 20
private GoodsProductMapper goodsProductMapper;
@Test
public void testReduceStock() {
Integer id = 1;
Short num = 10;
goodsProductMapper.reduceStock(id, num);
}
Reported by PMD.
Line: 27
}
@Test
public void testAddStock() {
Integer id = 1;
Short num = 10;
goodsProductMapper.addStock(id, num);
}
}
Reported by PMD.
Line: 8
import org.linlinjava.litemall.db.dao.GoodsProductMapper;
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;
@WebAppConfiguration
@RunWith(SpringRunner.class)
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAddressController.java
4 issues
Line: 26
@RequestMapping("/admin/address")
@Validated
public class AdminAddressController {
private final Log logger = LogFactory.getLog(AdminAddressController.class);
@Autowired
private LitemallAddressService addressService;
@Autowired
private LitemallRegionService regionService;
Reported by PMD.
Line: 26
@RequestMapping("/admin/address")
@Validated
public class AdminAddressController {
private final Log logger = LogFactory.getLog(AdminAddressController.class);
@Autowired
private LitemallAddressService addressService;
@Autowired
private LitemallRegionService regionService;
Reported by PMD.
Line: 29
private final Log logger = LogFactory.getLog(AdminAddressController.class);
@Autowired
private LitemallAddressService addressService;
@Autowired
private LitemallRegionService regionService;
@RequiresPermissions("admin:address:list")
@RequiresPermissionsDesc(menu = {"用户管理", "收货地址"}, button = "查询")
Reported by PMD.
Line: 31
@Autowired
private LitemallAddressService addressService;
@Autowired
private LitemallRegionService regionService;
@RequiresPermissions("admin:address:list")
@RequiresPermissionsDesc(menu = {"用户管理", "收货地址"}, button = "查询")
@GetMapping("/list")
public Object list(Integer userId, String name,
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/job/CouponJob.java
4 issues
Line: 22
*/
@Component
public class CouponJob {
private final Log logger = LogFactory.getLog(CouponJob.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
Reported by PMD.
Line: 22
*/
@Component
public class CouponJob {
private final Log logger = LogFactory.getLog(CouponJob.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
Reported by PMD.
Line: 25
private final Log logger = LogFactory.getLog(CouponJob.class);
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
/**
* 每隔一个小时检查
Reported by PMD.
Line: 27
@Autowired
private LitemallCouponService couponService;
@Autowired
private LitemallCouponUserService couponUserService;
/**
* 每隔一个小时检查
* TODO
* 注意,因为是相隔一个小时检查,因此导致优惠券真正超时时间可能比设定时间延迟1个小时
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/vo/CatVo.java
4 issues
Line: 5
import java.util.List;
public class CatVo {
private Integer value = null;
private String label = null;
private List children = null;
public Integer getValue() {
Reported by PMD.
Line: 6
import java.util.List;
public class CatVo {
private Integer value = null;
private String label = null;
private List children = null;
public Integer getValue() {
return value;
Reported by PMD.
Line: 7
public class CatVo {
private Integer value = null;
private String label = null;
private List children = null;
public Integer getValue() {
return value;
}
Reported by PMD.
Line: 8
public class CatVo {
private Integer value = null;
private String label = null;
private List children = null;
public Integer getValue() {
return value;
}
Reported by PMD.
litemall-core/src/test/java/org/linlinjava/litemall/core/MailTest.java
3 issues
Line: 35
public class MailTest {
@Autowired
private NotifyService notifyService;
@Test
public void testMail() {
notifyService.notifyMail("订单信息", "订单1111111已付款,请发货");
}
Reported by PMD.
Line: 38
private NotifyService notifyService;
@Test
public void testMail() {
notifyService.notifyMail("订单信息", "订单1111111已付款,请发货");
}
@Configuration
@Import(Application.class)
Reported by PMD.
Line: 13
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Primary;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import java.util.concurrent.Executor;
Reported by PMD.
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/service/UserInfoService.java
3 issues
Line: 13
@Service
public class UserInfoService {
@Autowired
private LitemallUserService userService;
public UserInfo getInfo(Integer userId) {
LitemallUser user = userService.findById(userId);
Assert.state(user != null, "用户不存在");
Reported by PMD.
Line: 20
LitemallUser user = userService.findById(userId);
Assert.state(user != null, "用户不存在");
UserInfo userInfo = new UserInfo();
userInfo.setNickName(user.getNickname());
userInfo.setAvatarUrl(user.getAvatar());
return userInfo;
}
}
Reported by PMD.
Line: 21
Assert.state(user != null, "用户不存在");
UserInfo userInfo = new UserInfo();
userInfo.setNickName(user.getNickname());
userInfo.setAvatarUrl(user.getAvatar());
return userInfo;
}
}
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminFeedbackController.java
3 issues
Line: 29
@RequestMapping("/admin/feedback")
@Validated
public class AdminFeedbackController {
private final Log logger = LogFactory.getLog(AdminFeedbackController.class);
@Autowired
private LitemallFeedbackService feedbackService;
@RequiresPermissions("admin:feedback:list")
Reported by PMD.
Line: 29
@RequestMapping("/admin/feedback")
@Validated
public class AdminFeedbackController {
private final Log logger = LogFactory.getLog(AdminFeedbackController.class);
@Autowired
private LitemallFeedbackService feedbackService;
@RequiresPermissions("admin:feedback:list")
Reported by PMD.
Line: 32
private final Log logger = LogFactory.getLog(AdminFeedbackController.class);
@Autowired
private LitemallFeedbackService feedbackService;
@RequiresPermissions("admin:feedback:list")
@RequiresPermissionsDesc(menu = {"用户管理", "意见反馈"}, button = "查询")
@GetMapping("/list")
public Object list(Integer userId, String username,
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdService.java
3 issues
Line: 17
@Service
public class LitemallAdService {
@Resource
private LitemallAdMapper adMapper;
public List<LitemallAd> queryIndex() {
LitemallAdExample example = new LitemallAdExample();
example.or().andPositionEqualTo((byte) 1).andDeletedEqualTo(false).andEnabledEqualTo(true);
return adMapper.selectByExample(example);
Reported by PMD.
Line: 25
return adMapper.selectByExample(example);
}
public List<LitemallAd> querySelective(String name, String content, Integer page, Integer limit, String sort, String order) {
LitemallAdExample example = new LitemallAdExample();
LitemallAdExample.Criteria criteria = example.createCriteria();
if (!StringUtils.isEmpty(name)) {
criteria.andNameLike("%" + name + "%");
Reported by PMD.
Line: 35
if (!StringUtils.isEmpty(content)) {
criteria.andContentLike("%" + content + "%");
}
criteria.andDeletedEqualTo(false);
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
example.setOrderByClause(sort + " " + order);
}
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminLogController.java
3 issues
Line: 25
@RequestMapping("/admin/log")
@Validated
public class AdminLogController {
private final Log logger = LogFactory.getLog(AdminLogController.class);
@Autowired
private LitemallLogService logService;
@RequiresPermissions("admin:log:list")
Reported by PMD.
Line: 25
@RequestMapping("/admin/log")
@Validated
public class AdminLogController {
private final Log logger = LogFactory.getLog(AdminLogController.class);
@Autowired
private LitemallLogService logService;
@RequiresPermissions("admin:log:list")
Reported by PMD.
Line: 28
private final Log logger = LogFactory.getLog(AdminLogController.class);
@Autowired
private LitemallLogService logService;
@RequiresPermissions("admin:log:list")
@RequiresPermissionsDesc(menu = {"系统管理", "操作日志"}, button = "查询")
@GetMapping("/list")
public Object list(String name,
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminStatController.java
3 issues
Line: 23
@RequestMapping("/admin/stat")
@Validated
public class AdminStatController {
private final Log logger = LogFactory.getLog(AdminStatController.class);
@Autowired
private StatService statService;
@RequiresPermissions("admin:stat:user")
Reported by PMD.
Line: 23
@RequestMapping("/admin/stat")
@Validated
public class AdminStatController {
private final Log logger = LogFactory.getLog(AdminStatController.class);
@Autowired
private StatService statService;
@RequiresPermissions("admin:stat:user")
Reported by PMD.
Line: 26
private final Log logger = LogFactory.getLog(AdminStatController.class);
@Autowired
private StatService statService;
@RequiresPermissions("admin:stat:user")
@RequiresPermissionsDesc(menu = {"统计管理", "用户统计"}, button = "查询")
@GetMapping("/user")
public Object statUser() {
Reported by PMD.