Skip to content

Commit

Permalink
Merge pull request Ericsson#3726 from bruntib/anywhere_on_bugpath
Browse files Browse the repository at this point in the history
[fix] File filter count for files with 0 reports
  • Loading branch information
dkrupp authored Aug 22, 2022
2 parents 8a70e36 + dcf4162 commit 2d94941
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions web/server/codechecker_server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2721,11 +2721,12 @@ def getFileCounts(self, run_ids, report_filter, cmp_data, limit, offset):
unique = report_filter is not None and report_filter.isUnique
stmt = session.query(
File.filepath,
func.count(
Report.bug_id.distinct() if unique else Report.bug_id)) \
.join(Report, File.id == Report.file_id)
func.count(Report.bug_id.distinct()
if unique else Report.bug_id).label('report_num')) \
.join(Report, File.id == Report.file_id, isouter=True)
stmt = apply_report_filter(stmt, filter_expression, join_tables) \
.group_by(File.filepath)
.group_by(File.filepath) \
.order_by(desc('report_num'))

if limit:
stmt = stmt.limit(limit).offset(offset)
Expand Down

0 comments on commit 2d94941

Please sign in to comment.