Tencent / CodeAnalysis

Static Code Analysis - 静态代码分析
https://tencent.github.io/CodeAnalysis/
Other
1.66k stars 286 forks source link

增强分析的【C/C++】代码质量缺陷规则包没生效 #746

Closed LucianZz closed 1 year ago

LucianZz commented 1 year ago

2023-01-11 11:05:18,105-INFO: start to run task: CodeCount, execute_processes: ['analyze', 'datahandle'] 2023-01-11 11:05:18,144-INFO: Load tool config: https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git 2023-01-11 11:05:19,507-INFO: Initing common tools ... 2023-01-11 11:05:19,508-INFO: Initing 3 tools, please wait a minute ...

[Tools init]: 0%| | 0/3 [00:00<?, ?it/s] [Tools init]: 33%|█████████████████ | 1/3 [00:01<00:02, 1.35s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 3/3 [00:01<00:00, 2.16it/s] 2023-01-11 11:05:20,899-INFO: Initialize tools done.(use time: 1.39s) 2023-01-11 11:05:20,900-INFO: run cmd: git lfs install 2023-01-11 11:05:20,925-INFO: Git LFS initialized. 2023-01-11 11:05:21,031-INFO: Initing other tools ... 2023-01-11 11:05:21,037-INFO: Initing 1 tools, please wait a minute ...

[Tools init]: 0%| | 0/1 [00:00<?, ?it/s] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.47s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.47s/it] 2023-01-11 11:05:22,510-INFO: Initialize tools done.(use time: 1.47s) 2023-01-11 11:05:22,518-INFO: task start : <class 'task.model.analyze.AnalyzeTask'> 2023-01-11 11:05:22,518-INFO: pre_analyze start. 2023-01-11 11:05:22,518-INFO: start __checkout_source_dir. 2023-01-11 11:05:22,519-INFO: 常规项目,直接拉取或复用本地缓存资源. 2023-01-11 11:05:24,130-INFO: load_source_dir done. source_dir insert env. sourcedir: /CodeAnalysis/client/data/sourcedirs/git_mrak5k5k 2023-01-11 11:05:24,132-INFO: pre_analyze done. 2023-01-11 11:05:24,132-INFO: PATH =


/CodeAnalysis/tools/cloc /CodeAnalysis/tools/linux-git-lfs-v3.1.2 /CodeAnalysis/tools/linux-git-lfs-v3.1.2 /usr/local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin


2023-01-11 11:05:24,134-INFO: Codemetric only scans main code (exclude test_source, auto_generate_source, third_party_source). 2023-01-11 11:05:24,134-INFO: Codelint only scans main code. 2023-01-11 11:05:24,165-INFO: 已经上报过代码行数,本次分析无需上报. 2023-01-11 11:05:24,333-INFO: ! include file: test.cpp 2023-01-11 11:05:24,333-INFO: ! include file: README.md 2023-01-11 11:05:24,333-INFO: Total code count finish: 0.1719660758972168 2023-01-11 11:05:24,334-INFO: Increase scan task starts running... 2023-01-11 11:05:24,335-INFO: getting scm diff filepaths 2023-01-11 11:05:24,435-INFO: finish getting scm diff filepaths 2023-01-11 11:05:24,436-INFO: find submodules at path: /CodeAnalysis/client/data/sourcedirs/git_mrak5k5k 2023-01-11 11:05:24,639-INFO: current submodule path list: [] 2023-01-11 11:05:24,640-INFO: Get file time by scm client: 0.3063352108001709 2023-01-11 11:05:24,950-INFO: Increase scan task finishs: 0.6163923740386963 2023-01-11 11:05:24,950-INFO: Business module & directory code count task starts running... 2023-01-11 11:05:24,950-INFO: use business module to count 2023-01-11 11:05:24,950-INFO: Get business time: 0.0005137920379638672 2023-01-11 11:05:24,950-INFO: add dir info, include file path: test.cpp 2023-01-11 11:05:24,950-INFO: add dir info, include file path: README.md 2023-01-11 11:05:24,950-INFO: Get directory time: 0.00025010108947753906 2023-01-11 11:05:24,951-INFO: done_analyze start. 2023-01-11 11:05:24,951-INFO: done_analyze done. 2023-01-11 11:05:24,951-INFO: task done : <class 'task.model.analyze.AnalyzeTask'> 2023-01-11 11:05:24,952-INFO: task start : <class 'task.model.datahandle.DataHandleTask'> 2023-01-11 11:05:24,977-INFO: [Start] set_format_type 2023-01-11 11:05:25,002-INFO: [End] set_format_type (use time: 0.024068117141723633) 2023-01-11 11:05:25,002-INFO: [Start] set_filter_type_list 2023-01-11 11:05:25,002-INFO: [End] set_filter_type_list (use time: 1.1920928955078125e-05) 2023-01-11 11:05:25,002-INFO: [Start] set_submodule_handle 2023-01-11 11:05:25,002-INFO: [End] set_submodule_handle (use time: 1.1205673217773438e-05) 2023-01-11 11:05:25,002-INFO: [Start] set_blame_type 2023-01-11 11:05:25,002-INFO: [End] set_blame_type (use time: 1.0251998901367188e-05) 2023-01-11 11:05:25,002-INFO: [Start] set_filter_type_list 2023-01-11 11:05:25,002-INFO: [End] set_filter_type_list (use time: 5.245208740234375e-06) 2023-01-11 11:05:25,002-INFO: [Start] set_issue_ignore_type 2023-01-11 11:05:25,002-INFO: [End] set_issue_ignore_type (use time: 1.1682510375976562e-05) 2023-01-11 11:05:25,002-INFO: [Start] set_result_pack_diff_info 2023-01-11 11:05:25,003-INFO: [End] set_result_pack_diff_info (use time: 7.62939453125e-06) 2023-01-11 11:05:25,003-INFO: [Start] set_add_file_info 2023-01-11 11:05:25,003-INFO: [End] set_add_file_info (use time: 9.298324584960938e-06) 2023-01-11 11:05:25,003-INFO: [Start] set_issue_hash 2023-01-11 11:05:25,003-INFO: [End] set_issue_hash (use time: 4.935264587402344e-05) 2023-01-11 11:05:25,003-INFO: [Start] set_add_person_info 2023-01-11 11:05:25,003-INFO: [End] set_add_person_info (use time: 1.3589859008789062e-05) 2023-01-11 11:05:25,003-INFO: [Start] set_issue_split 2023-01-11 11:05:25,003-INFO: [End] set_issue_split (use time: 5.0067901611328125e-05) 2023-01-11 11:05:25,003-INFO: datahandle done! 2023-01-11 11:05:25,003-INFO: task done : <class 'task.model.datahandle.DataHandleTask'> 2023-01-11 11:05:25,004-INFO: task result: /CodeAnalysis/client/data/taskdirs/task_82/task_response.json

cyw3 commented 1 year ago

这个是CodeCount的执行日志,不是增强分析相关的工具哦。

麻烦请提供 增强分析相关的工具的执行日志。

LucianZz commented 1 year ago

请问是tca_ql_cpp模块的日志吗

cyw3 commented 1 year ago

是的

LucianZz commented 1 year ago

2023-01-11 11:03:26,330-INFO: start to run task: TCA-Armory-Q1, execute_processes: ['compile', 'analyze', 'datahandle'] 2023-01-11 11:03:26,517-INFO: License is valid. 2023-01-11 11:03:26,700-INFO: Load tool config: https://git.code.tencent.com/TCA/tca-tools/puppy-tools-config.git 2023-01-11 11:03:53,380-INFO: Initing common tools ... 2023-01-11 11:03:53,380-INFO: Initing 3 tools, please wait a minute ...

[Tools init]: 0%| | 0/3 [00:00<?, ?it/s] [Tools init]: 33%|█████████████████ | 1/3 [00:01<00:02, 1.37s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 3/3 [00:01<00:00, 2.14it/s] 2023-01-11 11:03:54,783-INFO: Initialize tools done.(use time: 1.40s) 2023-01-11 11:03:54,784-INFO: run cmd: git lfs install 2023-01-11 11:03:54,810-INFO: Git LFS initialized. 2023-01-11 11:03:54,915-INFO: Initing other tools ... 2023-01-11 11:03:54,921-INFO: Initing 1 tools, please wait a minute ...

[Tools init]: 0%| | 0/1 [00:00<?, ?it/s] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.39s/it] [Tools init]: 100%|███████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.39s/it] 2023-01-11 11:03:56,311-INFO: Initialize tools done.(use time: 1.39s) 2023-01-11 11:03:56,318-INFO: task start : <class 'task.model.compile.CompileTask'> 2023-01-11 11:03:56,318-INFO: pre_compile start. 2023-01-11 11:03:56,318-INFO: start __checkout_source_dir. 2023-01-11 11:03:56,318-INFO: 常规项目,直接拉取或复用本地缓存资源. 2023-01-11 11:03:57,937-INFO: load_source_dir done. source_dir insert env. sourcedir: /CodeAnalysis/client/data/sourcedirs/git_mrak5k5k 2023-01-11 11:03:57,939-INFO: pre_compile done. 2023-01-11 11:03:57,939-INFO: PATH =


/CodeAnalysis/tools/TCA-Armory/bin/linux/Hades /CodeAnalysis/tools/TCA-Armory/bin/linux/Zeus /CodeAnalysis/tools/linux-git-lfs-v3.1.2 /CodeAnalysis/tools/linux-git-lfs-v3.1.2 /usr/local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin


2023-01-11 11:03:57,941-INFO: Codemetric only scans main code (exclude test_source, auto_generate_source, third_party_source). 2023-01-11 11:03:57,942-INFO: Codelint only scans main code. 2023-01-11 11:03:57,968-INFO: task params taskdir: /CodeAnalysis/client/data/taskdirs/task_79 2023-01-11 11:03:57,974-INFO: 开始编译项目 /CodeAnalysis/client/data/sourcedirs/git_mrak5k5k 2023-01-11 11:03:57,974-INFO: 是否为增量编译: False 2023-01-11 11:03:57,976-INFO: 开始下载文件tcaql/repos/5/5_494f436c54f7133f1b0ae5d6f1aae4a4e6964177_cpp.zip 2023-01-11 11:03:57,979-INFO: [文件数]过滤前:2,过滤后:2 2023-01-11 11:03:57,979-INFO: ['/CodeAnalysis/tools/linux-scc/scc', '--by-file', '-c', '--no-cocomo', '-f', 'json', '-o', '/CodeAnalysis/client/data/taskdirs/task_79/scc_result_974d4404915c11edbed80242ac110002.json', '/CodeAnalysis/client/data/sourcedirs/git_mrak5k5k'] 2023-01-11 11:03:57,993-INFO: results written to /CodeAnalysis/client/data/taskdirs/task_79/scc_result_974d4404915c11edbed80242ac110002.json 2023-01-11 11:03:58,016-ERROR: method(download_big_file) call fails on error: HTTP Error 401: Unauthorized 2023-01-11 11:03:58,017-INFO: retrying method(download_big_file) after 5 seconds 2023-01-11 11:03:58,080-INFO: 上报代码行数: {'code_line_num': 57, 'comment_line_num': 1, 'blank_line_num': 4, 'total_line_num': 62, 'filtered_code_line_num': 57, 'filtered_comment_line_num': 1, 'filtered_blank_line_num': 4, 'filtered_total_line_num': 62, 'filtered_lang_count': {'C++': {'file_num': 1, 'code_line_num': 54, 'comment_line_num': 1, 'blank_line_num': 4, 'total_line_num': 59}, 'Markdown': {'file_num': 1, 'code_line_num': 3, 'comment_line_num': 0, 'blank_line_num': 0, 'total_line_num': 3}}} 2023-01-11 11:04:03,059-ERROR: method(download_big_file) call fails on error: HTTP Error 401: Unauthorized 2023-01-11 11:04:03,060-INFO: retrying method(download_big_file) after 5 seconds 2023-01-11 11:04:08,104-ERROR: method(download_big_file) call fails on error: HTTP Error 401: Unauthorized 2023-01-11 11:04:08,104-WARNING: method(download_big_file) call still fails after 2 retries 2023-01-11 11:04:08,105-WARNING: 下载失败 HTTP Error 401: Unauthorized 2023-01-11 11:04:08,106-INFO: [文件数]过滤前:1,过滤后:1 2023-01-11 11:04:08,106-INFO: ['compile', '-p', '5_494f436c54f7133f1b0ae5d6f1aae4a4e6964177_cpp', '-cc', '/CodeAnalysis/client/data/taskdirs/task_79/workdir/db', '-l', 'cpp', '-s', '/CodeAnalysis/client/data/sourcedirs/git_mrak5k5k', '-f', '/CodeAnalysis/client/data/taskdirs/task_79/workdir/filelist.txt'] 2023-01-11 11:04:20,545-INFO: 2023-01-11 11:04:20.545187119 +0800 HKT [INFO] 2023-01-11 11:04:20,544-INFO-Zeus: Namespace(cache='/CodeAnalysis/client/data/taskdirs/task_79/workdir/db', command='compile', debug=False, filelist='/CodeAnalysis/client/data/taskdirs/task_79/workdir/filelist.txt', lang='cpp', project='5_494f436c54f7133f1b0ae5d6f1aae4a4e6964177_cpp', source='/CodeAnalysis/client/data/sourcedirs/gitmrak5k5k') 2023-01-11 11:04:20,545-INFO: 2023-01-11 11:04:20,546-INFO: 2023-01-11 11:04:20.546519046 +0800 HKT [INFO] 2023-01-11 11:04:20,545-INFO-Zeus: 2023-01-11 11:04:20,546-INFO: 2023-01-11 11:04:20,546-INFO: 2023-01-11 11:04:20.546762032 +0800 HKT [INFO] ____ ____ ____ __
2023-01-11 11:04:20,546-INFO: 2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20.547099871 +0800 HKT [INFO] | __
||_ || || |.' __ \
2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20.547426587 +0800 HKT [INFO] |/ / / | | _| | | | | | (__ _| 2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20.547762914 +0800 HKT [INFO] .'.' | | | ' ' | _.
. 2023-01-11 11:04:20,547-INFO: 2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20.548083407 +0800 HKT [INFO] _/ /__/ | _| |__/ | \ \__/ / | \____) | 2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20.548405976 +0800 HKT [INFO] |________||________|..' ______.' 2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20.548764541 +0800 HKT [INFO]
2023-01-11 11:04:20,548-INFO: 2023-01-11 11:04:20,549-INFO: 2023-01-11 11:04:20.549089249 +0800 HKT [INFO] 2023-01-11 11:04:20,545-INFO-Zeus: Namespace(cache='/CodeAnalysis/client/data/taskdirs/task_79/workdir/db', command='compile', debug=False, filelist='/CodeAnalysis/client/data/taskdirs/task_79/workdir/filelist.txt', lang='cpp', project='5_494f436c54f7133f1b0ae5d6f1aae4a4e6964177_cpp', source='/CodeAnalysis/client/data/sourcedirs/git_mrak5k5k') 2023-01-11 11:04:20,549-INFO: 2023-01-11 11:04:20,898-INFO: 2023-01-11 11:04:20.897781279 +0800 HKT [INFO] 2023-01-11 11:04:20,897-INFO-Zeus: 文件列表['/CodeAnalysis/client/data/sourcedirs/git_mrak5k5k/test.cpp'] 2023-01-11 11:04:20,898-INFO: 2023-01-11 11:04:20,898-INFO: 2023-01-11 11:04:20.898510612 +0800 HKT [INFO] 2023-01-11 11:04:20,897-INFO-Zeus: 开始解析文件/CodeAnalysis/client/data/sourcedirs/git_mrak5k5k/test.cpp 2023-01-11 11:04:20,898-INFO: 2023-01-11 11:04:20,915-INFO: 2023-01-11 11:04:20.914953358 +0800 HKT [INFO] 2023-01-11 11:04:20,914-INFO-DB_Generate: insert dataflow to db use 0.009341s 2023-01-11 11:04:20,915-INFO: 2023-01-11 11:04:20,915-INFO: 2023-01-11 11:04:20.915483793 +0800 HKT [INFO] 2023-01-11 11:04:20,914-INFO-DB_Generate: 生成DB完成 2023-01-11 11:04:20,915-INFO: 2023-01-11 11:04:20,916-INFO: 2023-01-11 11:04:20.91591808 +0800 HKT [INFO] 2023-01-11 11:04:20,915-INFO-Zeus: 数据库生成使用 use 0.009632s 2023-01-11 11:04:20,916-INFO: 2023-01-11 11:04:20,920-INFO: 2023-01-11 11:04:20.920864167 +0800 HKT [INFO] 时间差为 7 s 2023-01-11 11:04:20,921-INFO: 2023-01-11 11:04:21,119-INFO: 0 2023-01-11 11:04:21,119-INFO: 准备上传到云端存储数据库 2023-01-11 11:04:21,119-INFO: 开始上传 2023-01-11 11:04:21,120-INFO: platform: Linux-3.10.0-1160.45.1.el7.x86_64-x86_64-with-debian-11.5 2023-01-11 11:04:21,121-INFO: 检测到在ubuntu系统中调用zip,因此将调用7z_ubuntu。(7z_ubuntu可能存在兼容问题,如果异常,请自行安装:sudo apt-get install p7zip-full) 2023-01-11 11:04:21,121-INFO: zip模块执行压缩操作... 2023-01-11 11:04:21,127-INFO: /CodeAnalysis/tools/linux-7z/bin/7z_ubuntu: 2: exec: /usr/lib/p7zip/7z: not found 2023-01-11 11:04:21,222-ERROR: compress error! zip file is empty, please check! 如果是ubuntu环境,7z_ubuntu可能存在兼容问题,请自行安装:sudo apt-get install p7zip-full 2023-01-11 11:04:21,222-WARNING: 上传失败 2023-01-11 11:04:21,222-INFO: done_compile start. 2023-01-11 11:04:21,223-INFO: task done : <class 'task.model.compile.CompileTask'> 2023-01-11 11:04:21,223-INFO: task start : <class 'task.model.analyze.AnalyzeTask'> 2023-01-11 11:04:21,224-INFO: pre_analyze start. 2023-01-11 11:04:21,224-INFO: pre_analyze done. 2023-01-11 11:04:21,252-INFO: [文件数]过滤前:1,过滤后:1 2023-01-11 11:04:21,252-INFO: ['analyze', '-l', 'cpp', '-cc', '/CodeAnalysis/client/data/taskdirs/task_79/workdir/db', '-db', '5_494f436c54f7133f1b0ae5d6f1aae4a4e6964177_cpp', '-o', '/CodeAnalysis/client/data/taskdirs/task_79/workdir/result.json', '-c', '/CodeAnalysis/client/data/taskdirs/task_79/workdir/config.xml'] 2023-01-11 11:04:47,623-WARNING: 未生成结果文件 2023-01-11 11:04:47,624-INFO: done_analyze start. 2023-01-11 11:04:47,625-INFO: done_analyze done. 2023-01-11 11:04:47,625-INFO: task done : <class 'task.model.analyze.AnalyzeTask'> 2023-01-11 11:04:47,625-INFO: task start : <class 'task.model.datahandle.DataHandleTask'> 2023-01-11 11:04:47,655-INFO: [Start] set_format_type 2023-01-11 11:04:47,682-INFO: [End] set_format_type (use time: 0.027272701263427734) 2023-01-11 11:04:47,683-INFO: [Start] set_filter_type_list 2023-01-11 11:04:47,722-INFO: start: filter issues according to scm diff. 2023-01-11 11:04:47,722-INFO: start: filter issues according to path filter. 2023-01-11 11:04:47,724-INFO: finished: filter issues according to path filter. 2023-01-11 11:04:47,724-INFO: [End] set_filter_type_list (use time: 0.04117941856384277) 2023-01-11 11:04:47,724-INFO: [Start] set_submodule_handle 2023-01-11 11:04:47,724-INFO: [End] set_submodule_handle (use time: 1.52587890625e-05) 2023-01-11 11:04:47,724-INFO: [Start] set_blame_type 2023-01-11 11:04:47,750-INFO: Start: lint blame. 2023-01-11 11:04:48,157-INFO: Start to blame ... 2023-01-11 11:04:48,160-INFO: start blame thread. 2023-01-11 11:04:48,161-INFO: 结束blame,BLAME_ERROR_NUM: 0,blame_num:0 2023-01-11 11:04:48,161-INFO: End: lint blame. 2023-01-11 11:04:48,161-INFO: [End] set_blame_type (use time: 0.4367225170135498) 2023-01-11 11:04:48,161-INFO: [Start] set_filter_type_list 2023-01-11 11:04:48,187-INFO: start: filter issues according to revision. 2023-01-11 11:04:48,188-INFO:
get_revision_status_map... 2023-01-11 11:04:48,188-INFO: __get_revision_status_map done... 2023-01-11 11:04:48,188-INFO: _common_revision_filter done... 2023-01-11 11:04:48,188-INFO: finished: filter issues according to revision. 2023-01-11 11:04:48,188-INFO: [End] set_filter_type_list (use time: 0.027214765548706055) 2023-01-11 11:04:48,188-INFO: [Start] set_issue_ignore_type 2023-01-11 11:04:48,188-INFO: start: igonre issues according to code comments. 2023-01-11 11:04:48,190-INFO: finished: igonre issues according to code comments. 2023-01-11 11:04:48,190-INFO: [End] set_issue_ignore_type (use time: 0.0012950897216796875) 2023-01-11 11:04:48,190-INFO: [Start] set_result_pack_diff_info 2023-01-11 11:04:48,190-INFO: [End] set_result_pack_diff_info (use time: 1.0967254638671875e-05) 2023-01-11 11:04:48,190-INFO: [Start] set_add_file_info 2023-01-11 11:04:48,190-INFO: [End] set_add_file_info (use time: 1.4066696166992188e-05) 2023-01-11 11:04:48,190-INFO: [Start] set_issue_hash 2023-01-11 11:04:48,351-INFO: [End] set_issue_hash (use time: 0.16128325462341309) 2023-01-11 11:04:48,352-INFO: [Start] set_add_person_info 2023-01-11 11:04:48,352-INFO: [End] set_add_person_info (use time: 2.3603439331054688e-05) 2023-01-11 11:04:48,352-INFO: [Start] set_issue_split 2023-01-11 11:04:48,353-INFO: [End] set_issue_split (use time: 0.0006933212280273438) 2023-01-11 11:04:48,353-INFO: datahandle done! 2023-01-11 11:04:48,353-INFO: task done : <class 'task.model.datahandle.DataHandleTask'> 2023-01-11 11:04:53,509-INFO: task result: /CodeAnalysis/client/data/taskdirs/task_79/task_response.json

cyw3 commented 1 year ago

麻烦升级下 TCA-Armory 工具,然后重试下