Skip to content

Commit

Permalink
chore: readable and pythonic logic
Browse files Browse the repository at this point in the history
Co-authored-by: jmeridth <jmeridth@gmail.com>
  • Loading branch information
zkoppert and jmeridth committed Jun 11, 2024
1 parent 5e6d889 commit a987f81
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions issue_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ def get_per_issue_metrics(
)
if env_vars.hide_time_to_answer is False:
issue_with_metrics.time_to_answer = measure_time_to_answer(issue)
if env_vars.hide_time_to_close is False and issue["closedAt"]:
issue_with_metrics.time_to_close = measure_time_to_close(None, issue)
if issue["closedAt"]:
num_issues_closed += 1
if not env_vars.hide_time_to_close:
issue_with_metrics.time_to_close = measure_time_to_close(None, issue)
else:
num_issues_open += 1
else:
Expand Down Expand Up @@ -234,17 +234,17 @@ def get_per_issue_metrics(
)
if labels and env_vars.hide_label_metrics is False:
issue_with_metrics.label_metrics = get_label_metrics(issue, labels)
if env_vars.hide_time_to_close is False and issue.state == "closed": # type: ignore
if pull_request:
issue_with_metrics.time_to_close = measure_time_to_merge(
pull_request, ready_for_review_at
)
else:
issue_with_metrics.time_to_close = measure_time_to_close(
issue, None
)
if issue.state == "closed": # type: ignore
num_issues_closed += 1
if not env_vars.hide_time_to_close:
if pull_request:
issue_with_metrics.time_to_close = measure_time_to_merge(
pull_request, ready_for_review_at
)
else:
issue_with_metrics.time_to_close = measure_time_to_close(
issue, None
)
elif issue.state == "open": # type: ignore
num_issues_open += 1
issues_with_metrics.append(issue_with_metrics)
Expand Down

0 comments on commit a987f81

Please sign in to comment.