일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- vscode 추천
- 인스턴스
- plugin
- vscode
- 개발툴
- extension
- 객체 vs 인스턴스
- static analysis
- html report
- C++
- 객체
- cppCheck
- object vs instance
- Today
- Total
킹드래곤 짹짹 개발노트
cppcheck html report 사용법 본문
이전 글에서는 cppcheck 설치, 빌드 방법을 알아보았습니다.
이번 글에서는 cppcheck-htmlreport 의 사용 방법에 대해서 정리합니다.
cppcheck html report 사용법
cppcheck-htmlreport 는 cppcheck 가 설치되면 함께 설치됩니다.
설치 위치 : /usr/bin/cppcheck-htmlreport
Github 에서 다운로드한 소스에도 포함되어 있습니다.
소스 위치 : /cppcheck dir/htmlreport/cppcheck-htmlreport
cppcheck-htmlreport 는 cppcheck의 결과를 보기좋게 HTML 문서로 만들어줍니다.
cppcheck 의 결과는 sa_result.xml 과 같이 xml 문서로 출력됩니다.
xml 문서를 텍스트 뷰어로 보기에는 무리가 있습니다.
사용 방법은 help 를 참고합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | $ ./cppcheck-htmlreport --help Usage: cppcheck-htmlreport [options] Options: -h, --help show this help message and exit --title=TITLE The title of the project. --file=FILE The cppcheck xml output file to read defects from. Default is reading from stdin. --report-dir=REPORT_DIR The directory where the HTML report content is written. --source-dir=SOURCE_DIR Base directory where source code files can be found. --source-encoding=SOURCE_ENCODING Encoding of source code. | cs |
$ cppcheck-htmlreport --file=./sa_result.xml --source-dir=./armv8_a --report-dir=./report
cppcheck-htmlreport 의 버그??
serverity="error" 가 1개도 없을 경우에는 statistics 에 아무런 항목이 표시되지 않습니다.
cppcheck-htmlreport 파일을 열어서 아래 부분을 수정합니다.
수정할 소스 코드의 위치는 파일의 거의 끝부분의 671 line 입니다.
위의 break -> continue 로 수정 후에 파일을 저장합니다.
그럼 정상적으로 cppcheck result > statistics 에 통계항목이 표시됩니다.
'C++' 카테고리의 다른 글
cppcheck 설치, 빌드 (0) | 2018.12.05 |
---|