IntelliJ에 SonarQube를 사용하여 3개의 오픈소스(Selenium, Spark, Spring-boot)를 진단하였다.
1. Selenium 진단
진단했을때
1381의 파일중 10100개의 issues를 발견했다.
몇개의 문제를 보면
String literals should not be duplicated이며 Critical Issue인것 같다.
문자열 리터럴이 중복되는것이 있는것 같다.
https://3layer.com.br/sonar/rules/show/squid:S1192?modal=true&layout=false
https://3layer.com.br/sonar/rules/show/squid:S1192?modal=true&layout=false
Duplicated string literals are error-prone to refactor, as one must pay attention to update all occurrences. Constants can be referenced from many places, but there value is updated in a single place. The following code: public void run() { prepare("action
3layer.com.br
Methods should not have too many parameters이며 Major Issue이다.
함수에 매개변수가 너무 많이 들어있어서 너무 많은 작업을 수행하고 있는 것같다.
Rule S00107 "Methods should not have too many parameters" should consider Lombok annotations
Hi, While still focussing on constructor having too many parameters as an issue couldnt @Builder on methods serve you better. Builder is suggested as a solution for objects having many final fields(and thus required to be parameters in constructor) even in
community.sonarsource.com
"<strong>" and "<em>" tags should be used이다.
의미 전달을 위해 <b> <i> tag말고 <strong> 이나 <em>태그를 사용하라는 것 같다.
2. Spark 진단
진단이 잘못된건지 3개파일에서 5개 문제밖에 못찾았다.
Issue를 잘 보면 Test classes should comply with a naming convention
Minor Issue로 크게 중요하지 않지만 팀과 효율적으로 협업하기 위하여
테스트 클래스 이름이 제공된 정규식과 일치하게 하라는 진단이다.
Critical Issue는 Methods should not be empty
메소드를 비워뒀기 때문에 발생한 이슈였다.
3. Spring-boot 진단
1883files 중 5360 issues를 발견했다.
"<title>" should be present in all pages
title태그가 없다는 진단이다. 코드로 들어가서 보면
503.html 파일에 title tag가 존재하지 않는다.
String literals should not be duplicated
Selenium 진단했을때와 같은 Issue이다.
문자열 리터럴이 중복되는것
https://3layer.com.br/sonar/rules/show/squid:S1192?modal=true&layout=false
https://3layer.com.br/sonar/rules/show/squid:S1192?modal=true&layout=false
Duplicated string literals are error-prone to refactor, as one must pay attention to update all occurrences. Constants can be referenced from many places, but there value is updated in a single place. The following code: public void run() { prepare("action
3layer.com.br
Assertions should not be used in production code
Assertions는 테스트코드에서 사용하고 production code에서는 사용하지 않아야하는 진단이다.
production code에서 사용된다면 ClassNotFoundException이 발생할수 있다.
'SUA > 오픈소스 보안' 카테고리의 다른 글
[SNYK] Django 진단 (0) | 2021.11.21 |
---|---|
[LGTM] Zapproxy 분석 (0) | 2021.11.21 |
[LGTM] kubernetes 분석 (0) | 2021.11.21 |
Owasp ZAP에 GitHub Action 사용 (0) | 2021.11.09 |
OWASP ZAP 사용법 정리 (0) | 2021.11.09 |