반응형
code smell - Field names should comply with a naming convention.
Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule allows to check that field names match a provided regular expression.
Noncompliant Code Example
With the default regular expression ^[a-z][a-zA-Z0-9]*$:
sonarQube 정적분석에 code smell가 떠서 수정중에 있다.
문제
class MyClass { private int my_field; }
해결책
Compliant Solution
class MyClass { private int myField; }
필드명에 언더바를 빼라는 뜻이다.
my_field => myField
'프로그래밍 > JAVA' 카테고리의 다른 글
JSP에서 DB 쿼리 실행기 작성 초간단 샘플 (0) | 2022.12.22 |
---|---|
sonarQube - Public constants and fields initialized at declaration should be "static final" rather than merely "final" (0) | 2022.07.22 |
java8 stream의 쉬운 사용방법 (map, filter, collect) (0) | 2022.06.10 |
자바 문자열을 날짜로 변환하기 (0) | 2022.05.31 |
모든 파라미터를 받아 그대로 POST submit 하는 JSP 페이지 (0) | 2022.05.31 |
댓글