Skip to content

Commit

Permalink
open/closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tridentinus committed Sep 23, 2024
1 parent ec440a9 commit 34fc0a4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/irmMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ export async function fetchRepoIssues(owner: string, name: string) {

const query = `
query GetRepoIssues($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
issues(first: 100, states: OPEN) {
edges {
node {
createdAt
comments(first: 1) {
nodes {
createdAt
}
}
closedAt
}
repository(owner: $owner, name: $name) {
issues(first: 100, states: [OPEN, CLOSED]) {
edges {
node {
createdAt
comments(first: 1) {
nodes {
createdAt
}
}
closedAt
}
}
}
}
}
`;

try {
Expand Down Expand Up @@ -148,7 +148,7 @@ export function calculateIRM(issues: IssueNode[]) {
}
});

const averageResponseTime = issueCount > 0 ? totalResponseTime / issueCount : 0;
const averageResponseTime = issueCount > 0 ? totalResponseTime / issueCount : 0; //

logMessage('DEBUG', `Calculated IRM (Average Issue Response Time): ${averageResponseTime} minutes`);

Expand Down Expand Up @@ -192,7 +192,7 @@ export function normalizeIRM (averageResponseTime: number, maxResponseTime: numb
* @returns A promise that resolves to the IRM value.
*/
export async function getIRM(owner: string, repo: string): Promise<number> {
const issues = await fetchRepoIssues(owner, repo);;
const issues = await fetchRepoIssues(owner, repo);
return calculateIRM(issues);

}

0 comments on commit 34fc0a4

Please sign in to comment.