-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: start working on home ossf scorecard
- Loading branch information
Showing
8 changed files
with
166 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Import Third-party Dependencies | ||
import { getJSON } from "@nodesecure/vis-network"; | ||
|
||
/** | ||
* @param {!string} repoName | ||
*/ | ||
export async function fetchScorecardData(repoName) { | ||
try { | ||
const { data } = (await getJSON(`/scorecard/${repoName}`)); | ||
if (!data) { | ||
return null; | ||
} | ||
|
||
return data; | ||
} | ||
catch (error) { | ||
console.error(error); | ||
|
||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* @param {!number} score | ||
* @returns {string} | ||
*/ | ||
export function getScoreColor(score) { | ||
if (score < 4) { | ||
return "red"; | ||
} | ||
if (score < 6.5) { | ||
return "orange"; | ||
} | ||
if (score < 8.5) { | ||
return "blue"; | ||
} | ||
|
||
return "green"; | ||
} | ||
|
||
export function getScorecardLink( | ||
repoName | ||
) { | ||
return `https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/` + repoName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters