The following issues were found
litemall-core/src/main/java/org/linlinjava/litemall/core/config/CorsConfig.java
2 issues
Line: 12
@Configuration
public class CorsConfig {
// 当前跨域请求最大有效时长。这里默认30天
private long maxAge = 30 * 24 * 60 * 60;
private CorsConfiguration buildConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*"); // 1 设置访问源地址
corsConfiguration.addAllowedHeader("*"); // 2 设置访问源请求头
Reported by PMD.
Line: 12
@Configuration
public class CorsConfig {
// 当前跨域请求最大有效时长。这里默认30天
private long maxAge = 30 * 24 * 60 * 60;
private CorsConfiguration buildConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*"); // 1 设置访问源地址
corsConfiguration.addAllowedHeader("*"); // 2 设置访问源请求头
Reported by PMD.
litemall-all/src/main/java/org/linlinjava/litemall/Application.java
2 issues
Line: 13
@MapperScan("org.linlinjava.litemall.db.dao")
@EnableTransactionManagement
@EnableScheduling
public class Application {
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
Reported by PMD.
Line: 15
@EnableScheduling
public class Application {
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
Reported by PMD.
litemall-db/src/test/java/org/linlinjava/litemall/db/DbTest.java
2 issues
Line: 15
@SpringBootTest
public class DbTest {
@Test
public void test() {
}
}
Reported by PMD.
Line: 6
import org.junit.Test;
import org.junit.runner.RunWith;
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-db/src/test/java/org/linlinjava/litemall/db/MapperReturnTest.java
2 issues
Line: 20
public class MapperReturnTest {
@Autowired
private LitemallSystemMapper systemMapper;
@Test
public void test() {
LitemallSystem system = new LitemallSystem();
system.setKeyName("test-system-key");
Reported by PMD.
Line: 10
import org.linlinjava.litemall.db.domain.LitemallSystem;
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-wx-api/src/main/java/org/linlinjava/litemall/wx/annotation/support/LoginUserHandlerMethodArgumentResolver.java
2 issues
Line: 17
@Override
public boolean supportsParameter(MethodParameter parameter) {
return parameter.getParameterType().isAssignableFrom(Integer.class) && parameter.hasParameterAnnotation(LoginUser.class);
}
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer container,
NativeWebRequest request, WebDataBinderFactory factory) throws Exception {
Reported by PMD.
Line: 26
// return new Integer(1);
String token = request.getHeader(LOGIN_TOKEN_KEY);
if (token == null || token.isEmpty()) {
return null;
}
return UserTokenManager.getUserId(token);
}
Reported by PMD.
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/config/ShiroExceptionHandler.java
2 issues
Line: 18
@Order(value = Ordered.HIGHEST_PRECEDENCE)
public class ShiroExceptionHandler {
private final Log logger = LogFactory.getLog(ShiroExceptionHandler.class);
@ExceptionHandler(AuthenticationException.class)
@ResponseBody
public Object unauthenticatedHandler(AuthenticationException e) {
logger.warn(e.getMessage(), e);
Reported by PMD.
Line: 18
@Order(value = Ordered.HIGHEST_PRECEDENCE)
public class ShiroExceptionHandler {
private final Log logger = LogFactory.getLog(ShiroExceptionHandler.class);
@ExceptionHandler(AuthenticationException.class)
@ResponseBody
public Object unauthenticatedHandler(AuthenticationException e) {
logger.warn(e.getMessage(), e);
Reported by PMD.
litemall-wx-api/src/main/java/org/linlinjava/litemall/wx/web/WxIndexController.java
2 issues
Line: 16
@RestController
@RequestMapping("/wx/index")
public class WxIndexController {
private final Log logger = LogFactory.getLog(WxIndexController.class);
/**
* 测试数据
*
* @return 测试数据
Reported by PMD.
Line: 16
@RestController
@RequestMapping("/wx/index")
public class WxIndexController {
private final Log logger = LogFactory.getLog(WxIndexController.class);
/**
* 测试数据
*
* @return 测试数据
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallUserMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallUser;
import org.linlinjava.litemall.db.domain.LitemallUserExample;
public interface LitemallUserMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_user
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallUser selectOneByExampleSelective(@Param("example") LitemallUserExample example, @Param("selective") LitemallUser.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_user
*
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallTopicMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallTopic;
import org.linlinjava.litemall.db.domain.LitemallTopicExample;
public interface LitemallTopicMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_topic
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallTopic selectOneByExampleSelective(@Param("example") LitemallTopicExample example, @Param("selective") LitemallTopic.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_topic
*
Reported by PMD.
litemall-db/src/main/java/org/linlinjava/litemall/db/dao/LitemallSystemMapper.java
2 issues
Line: 8
import org.linlinjava.litemall.db.domain.LitemallSystem;
import org.linlinjava.litemall.db.domain.LitemallSystemExample;
public interface LitemallSystemMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
* @mbg.generated
Reported by PMD.
Line: 63
*
* @mbg.generated
*/
LitemallSystem selectOneByExampleSelective(@Param("example") LitemallSystemExample example, @Param("selective") LitemallSystem.Column ... selective);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table litemall_system
*
Reported by PMD.