| Conditions | 5 |
| Total Lines | 14 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 11 | def commit_interval(user_id: str | None = None, |
||
| 12 | repository_id: str | None = None, |
||
| 13 | commit_id: str | None = None): |
||
| 14 | github_user(user_id) |
||
| 15 | for repo in github_repositories(user_id, repository_id): |
||
| 16 | for commit in github_commits(repo, commit_id): |
||
| 17 | git_commit: GitCommit = commit.commit |
||
| 18 | parents = git_commit.parents |
||
| 19 | parent_git_commit: GitCommit = parents[0] if parents else None |
||
| 20 | author_datetime = git_commit.author.date |
||
| 21 | parent_author_datetime = parent_git_commit.author.date if parent_git_commit else author_datetime |
||
| 22 | interval: timedelta = author_datetime - parent_author_datetime |
||
| 23 | s = interval.total_seconds() |
||
| 24 | yield s |
||
| 25 | |||
| 31 |