[SonarQube] Selenium, Spark, Spring-boot 진단

2021. 11. 21. 14:30·SUA/오픈소스 보안
반응형

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이다.

함수에 매개변수가 너무 많이 들어있어서 너무 많은 작업을 수행하고 있는 것같다.

https://community.sonarsource.com/t/rule-s00107-methods-should-not-have-too-many-parameters-should-consider-lombok-annotations/3181/4

 

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
'SUA/오픈소스 보안' 카테고리의 다른 글
  • [SNYK] Django 진단
  • [LGTM] Zapproxy 분석
  • [LGTM] kubernetes 분석
  • Owasp ZAP에 GitHub Action 사용
Penguin Dev
Penguin Dev
What does the Penguin say?
    글쓰기 관리
  • Penguin Dev
    Pengha!
    Penguin Dev
  • 전체
    오늘
    어제
    • 분류 전체보기 (151) N
      • Java & Spring (3) N
      • System Hacking (4)
      • Algorithm (8)
        • Sorting algorithm (3)
      • Python (6)
      • DB (1)
      • Web (2)
        • Web Hacking & Security (2)
      • Write-Up (108)
        • pwnable.kr (17)
        • HackCTF (16)
        • 해커스쿨 FTZ (21)
        • LOB(lord of bufferoverflow) (19)
        • LOS (lord of sql injection) (28)
        • XSS-game (6)
        • Webhacking.kr (1)
      • SUA (19)
        • 오픈소스 보안 (19)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    코딩테스트
    hashmap vs concurrenthashmap
    코드트리조별과제
    DB정리
    thread-safe
    concurrenthashmap vs hashmap
    ConcurrentHashMap
    Bubble Sort
    동시성처리
    enumerate #list comprehension
    computeifpresent
    코드트리
    tabat
    LOB
    computeifpresent()
    spring
    동시성
    nop sled
    AtomicLong
    lord of bufferoverflow
    computeifabsent()
    시스템해킹
    selection sort
    putval()
    computeifabsent
    Java
    spring boot
    sqlinjection
    CountDownLatch
    MAP
  • 최근 댓글

  • 반응형
  • hELLO· Designed By정상우.v4.10.3
Penguin Dev
[SonarQube] Selenium, Spark, Spring-boot 진단
상단으로

티스토리툴바