criticality_score

module
v0.0.1-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0

README

Criticality Score

English | 简体中文

Description

This project aims to evaluate and rank open-source projects based on their criticality within the open source ecosystem and download volume. Unlike traditional methods that rely solely on GitHub metrics, this project incorporates data from various Linux distributions, corresponding package managers and more code hosting platforms to provide a more comprehensive analysis.

By collecting and analyzing metrics from multiple sources, this project offers a robust and comprehensive framework for assessing the criticality of open-source projects.

Difference from ossf/criticality_score

  • Distribution Dependents: Collects data from various Linux distributions (e.g. Debian, Arch, Nix, Gentoo) and corresponding package managers to evaluate the dependency of open-source software.
  • Support for All Git Repositories: Analyzes repositories from any Git platform, not just GitHub.
  • Comprehensive Metrics Collection: Gathers a wider and more precise metrics from Git repositories and package managers, for example, the number of commits, organization count is more accurate than GitHub API.
  • Friendly for Metrics Customization: Customizes any metrics used in the criticality evaluation algorithm other than metrics that can be only collected by Github API.
  • No Dependency on Google Cloud or BigQuery: ossf/criticality_score depends on Google Cloud service, making it hard to migrate to other platforms. This project runs independently of specific cloud services, ensuring ease of deployment.
  • Easy Deployment: Runs a script, and the system will be easily setup with Docker.
  • Provides Additional Information: Provides extra insights, such as relationships between projects and dependencies.

Quick Start

If you want to collect data from Gentoo, please go to setup with Gentoo prefix, and refer to How to setup Gentoo prefix.

Then make sure docker and docker-compose-v2 is installed, and run the following commands:

export GENTOO_PREFIX_DIR=<your Gentoo prefix location> # If you don't have Gentoo prefix set, ignore
export GITHUB_TOKEN=<your GitHub token> # This is essential for github enumeration
./setup.sh
  1. After finishing the setup script, try to connect to the postgresql database (the password is stored in data/DB_PASSWD).

  2. Populate git_link fields in arch_packages, debian_packages and other distribution package table manually and finally run following command. If git_link data is already there, you can use scripts/copy-gitlink.py tool to copy the data to the database.

  3. Execute the following command for the first time to collect and calculate the criticality score. This will take days to finish.

docker compose exec app bash /gitlink.sh

Documentation of general design, tools and components

See docs/ for details

Reference

[1] https://github.com/ossf/criticality_score

Directories

Path Synopsis
cmd
internal
envflag
Package envflag is a simple library for associating environment variables with flags.
Package envflag is a simple library for associating environment variables with flags.
log
pkg
collector_git/cmd/Cli
* @Date: 2024-09-06 21:09:14 * @LastEditTime: 2024-12-09 19:31:36 * @Description: The Cli for collector
* @Date: 2024-09-06 21:09:14 * @LastEditTime: 2024-12-09 19:31:36 * @Description: The Cli for collector
collector_git/cmd/Clone
* @Date: 2023-11-11 22:44:26
* @Date: 2023-11-11 22:44:26
collector_git/cmd/Collect
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-09 19:32:13 * @Description: Collect Remote / Local Repo
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-09 19:32:13 * @Description: Collect Remote / Local Repo
collector_git/cmd/CountDownloaded
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-09 19:32:35 * @Description: Just Count downloaded repos
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-09 19:32:35 * @Description: Just Count downloaded repos
collector_git/cmd/integrate
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-14 16:48:46 * @Description: Integrate into Criticality Score system
* @Date: 2023-11-11 22:44:26 * @LastEditTime: 2024-12-14 16:48:46 * @Description: Integrate into Criticality Score system
collector_git/config
* @Author: 7erry * @Date: 2024-08-31 03:44:46 * @LastEditTime: 2024-12-14 16:48:05 * @Description: Config file for the git metrics collector
* @Author: 7erry * @Date: 2024-08-31 03:44:46 * @LastEditTime: 2024-12-14 16:48:05 * @Description: Config file for the git metrics collector
collector_git/internal/io/database
* @Date: 2024-09-07 20:46:04 * @LastEditTime: 2024-12-14 16:50:00 * @Description: Interact with database
* @Date: 2024-09-07 20:46:04 * @LastEditTime: 2024-12-14 16:50:00 * @Description: Interact with database
collector_git/internal/io/database/psql
* @Date: 2024-09-07 16:30:21 * @LastEditTime: 2024-11-27 20:22:56 * @Description:
* @Date: 2024-09-07 16:30:21 * @LastEditTime: 2024-11-27 20:22:56 * @Description:
collector_git/internal/io/database/sqlite
* @Date: 2024-09-07 20:07:35 * @LastEditTime: 2024-12-14 16:37:38 * @Description:
* @Date: 2024-09-07 20:07:35 * @LastEditTime: 2024-12-14 16:37:38 * @Description:
collector_git/internal/io/file/csv
* @Author: 7erry * @Date: 2024-12-13 20:57:15 * @LastEditTime: 2024-12-14 16:42:50 * @Description:
* @Author: 7erry * @Date: 2024-12-13 20:57:15 * @LastEditTime: 2024-12-14 16:42:50 * @Description:
collector_git/internal/io/file/json
* @Date: 2024-09-07 20:06:02 * @LastEditTime: 2024-12-14 16:43:08 * @Description:
* @Date: 2024-09-07 20:06:02 * @LastEditTime: 2024-12-14 16:43:08 * @Description:
collector_git/internal/io/file/yaml
* @Date: 2024-09-07 20:06:11 * @LastEditTime: 2024-12-14 16:43:23 * @Description:
* @Date: 2024-09-07 20:06:11 * @LastEditTime: 2024-12-14 16:43:23 * @Description:
collector_git/internal/logger
* @Author: 7erry * @Date: 2024-10-10 11:55:09 * @LastEditTime: 2024-12-14 16:50:32 * @Description: Log with logrus
* @Author: 7erry * @Date: 2024-10-10 11:55:09 * @LastEditTime: 2024-12-14 16:50:32 * @Description: Log with logrus
collector_git/internal/parser/url
* @Author: 7erry * @Date: 2024-09-29 14:41:35 * @LastEditTime: 2024-12-14 16:30:24 * @Description: Parse Input to make sure the provided URL is correct
* @Author: 7erry * @Date: 2024-09-29 14:41:35 * @LastEditTime: 2024-12-14 16:30:24 * @Description: Parse Input to make sure the provided URL is correct
enumerator/internal/api/maven
* @Author: 7erry * @Date: 2024-12-02 16:34:35 * @LastEditTime: 2024-12-02 17:17:32 * @Description:
* @Author: 7erry * @Date: 2024-12-02 16:34:35 * @LastEditTime: 2024-12-02 17:17:32 * @Description:
enumerator/internal/enumerator
* @Author: 7erry * @Date: 2024-11-29 16:49:34 * @LastEditTime: 2024-12-02 14:29:47 * @Description:
* @Author: 7erry * @Date: 2024-11-29 16:49:34 * @LastEditTime: 2024-12-02 14:29:47 * @Description:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL