Skip to content

Commit 94347a6

Browse files
Merge pull request #4880 from xb058t/file-path-and-tree-view-vue3
File-path and a tree-view migrated to vue3
2 parents 3ae7078 + 312360b commit 94347a6

19 files changed

Lines changed: 1184 additions & 24 deletions

File tree

Binary file not shown.

web/api/js/codechecker-api-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codechecker-api",
3-
"version": "6.71.0",
3+
"version": "6.72.0",
44
"description": "Generated node.js compatible API stubs for CodeChecker server.",
55
"main": "lib",
66
"homepage": "https://github.com/Ericsson/codechecker",
426 Bytes
Binary file not shown.

web/api/py/codechecker_api/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
with open('README.md', encoding='utf-8', errors="ignore") as f:
99
long_description = f.read()
1010

11-
api_version = '6.71.0'
11+
api_version = '6.72.0'
1212

1313
setup(
1414
name='codechecker_api',
Binary file not shown.

web/api/py/codechecker_api_shared/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
with open('README.md', encoding='utf-8', errors="ignore") as f:
99
long_description = f.read()
1010

11-
api_version = '6.71.0'
11+
api_version = '6.72.0'
1212

1313
setup(
1414
name='codechecker_api_shared',

web/api/report_server.thrift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,21 @@ service codeCheckerDBAccess {
954954
5: i64 offset)
955955
throws (1: codechecker_api_shared.RequestFailed requestError),
956956

957+
// Returns detailed report statistics grouped by file.
958+
// The inner map contains total report count ("reports") and
959+
// counts per severity, review status and detection status.
960+
// If the run id list is empty the metrics will be counted
961+
// for all of the runs and in compare mode all of the runs
962+
// will be used as a baseline excluding the runs in compare data.
963+
// PERMISSION: PRODUCT_VIEW
964+
map<string, map<string, i64>> getFileCountsSummary(
965+
1: list<i64> runIds,
966+
2: ReportFilter reportFilter,
967+
3: CompareData cmpData,
968+
4: i64 limit,
969+
5: i64 offset)
970+
throws (1: codechecker_api_shared.RequestFailed requestError),
971+
957972
// If the run id list is empty the metrics will be counted
958973
// for all of the runs and in compare mode all of the runs
959974
// will be used as a baseline excluding the runs in compare data.

web/client/codechecker_client/helpers/results.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ def getDetectionStatusCounts(self, runIds, reportFilter, cmpData):
140140
def getFileCounts(self, runIds, reportFilter, cmpData, limit, offset):
141141
pass
142142

143+
@thrift_client_call
144+
def getFileCountsSummary(self, runIds, reportFilter, cmpData, limit,
145+
offset):
146+
pass
147+
143148
@thrift_client_call
144149
def getCheckerCounts(self, base_run_ids, reportFilter, cmpData, limit,
145150
offset):

web/codechecker_web/shared/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# The newest supported minor version (value) for each supported major version
2121
# (key) in this particular build.
2222
SUPPORTED_VERSIONS = {
23-
6: 71
23+
6: 72
2424
}
2525

2626
# Used by the client to automatically identify the latest major and minor

web/server/codechecker_server/api/report_server.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3827,6 +3827,91 @@ def getFileCounts(self, run_ids, report_filter, cmp_data, limit, offset):
38273827
results[fp] = count
38283828
return results
38293829

3830+
@exc_to_thrift_reqfail
3831+
@timeit
3832+
def getFileCountsSummary(self, run_ids, report_filter, cmp_data,
3833+
limit, offset):
3834+
"""
3835+
Returns detailed report statistics grouped by file.
3836+
The inner map contains total report count ("reports") and
3837+
counts per severity, review status and detection status.
3838+
"""
3839+
self.__require_view()
3840+
3841+
limit = verify_limit_range(limit)
3842+
3843+
results = {}
3844+
with DBSession(self._Session) as session:
3845+
filter_expression, join_tables = process_report_filter(
3846+
session, run_ids, report_filter, cmp_data)
3847+
3848+
distinct_file_path = session.query(File.filepath.distinct()) \
3849+
.join(Report, Report.file_id == File.id)
3850+
3851+
if report_filter.annotations is not None:
3852+
distinct_file_path = distinct_file_path.outerjoin(
3853+
ReportAnnotations,
3854+
ReportAnnotations.report_id == Report.id)
3855+
distinct_file_path = distinct_file_path.group_by(
3856+
Report.id)
3857+
3858+
distinct_file_path = apply_report_filter(
3859+
distinct_file_path, filter_expression, join_tables, [File])
3860+
3861+
if limit:
3862+
distinct_file_path = distinct_file_path.limit(limit) \
3863+
.offset(offset)
3864+
3865+
count_col = Report.bug_id.distinct() if \
3866+
report_filter.isUnique else Report.bug_id
3867+
3868+
stmt = session.query(
3869+
File.filepath,
3870+
Checker.severity,
3871+
Report.review_status,
3872+
Report.detection_status,
3873+
func.count(count_col).label('cnt')) \
3874+
.join(Report, Report.file_id == File.id) \
3875+
.join(Checker, Report.checker_id == Checker.id) \
3876+
.filter(File.filepath.in_(distinct_file_path))
3877+
3878+
stmt = apply_report_filter(
3879+
stmt, filter_expression, join_tables, [File, Checker])
3880+
3881+
stmt = stmt.group_by(
3882+
File.filepath,
3883+
Checker.severity,
3884+
Report.review_status,
3885+
Report.detection_status)
3886+
3887+
severity_names = ttypes.Severity._VALUES_TO_NAMES
3888+
3889+
for fp, sev, review_st, detect_st, cnt in stmt:
3890+
if fp not in results:
3891+
results[fp] = {}
3892+
3893+
file_summary = results[fp]
3894+
3895+
file_summary["reports"] = \
3896+
file_summary.get("reports", 0) + cnt
3897+
3898+
sev_name = severity_names.get(sev, str(sev))
3899+
sev_key = f"severity:{sev_name}"
3900+
file_summary[sev_key] = \
3901+
file_summary.get(sev_key, 0) + cnt
3902+
3903+
if review_st:
3904+
rs_key = f"review_status:{review_st}"
3905+
file_summary[rs_key] = \
3906+
file_summary.get(rs_key, 0) + cnt
3907+
3908+
if detect_st:
3909+
ds_key = f"detection_status:{detect_st}"
3910+
file_summary[ds_key] = \
3911+
file_summary.get(ds_key, 0) + cnt
3912+
3913+
return results
3914+
38303915
@exc_to_thrift_reqfail
38313916
@timeit
38323917
def getRunHistoryTagCounts(self, run_ids, report_filter, cmp_data, limit,

0 commit comments

Comments
 (0)