scores

package
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 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageList = map[string]int{
	"debian_packages":   0,
	"arch_packages":     0,
	"nix_packages":      0,
	"homebrew_packages": 0,
	"gentoo_packages":   0,
}
View Source
var PackageManagerData = map[string]int{
	"npm":   3400000,
	"go":    1230000,
	"maven": 636000,
	"pypi":  538000,
	"nuget": 406000,
	"cargo": 155000,
}

Functions

func CalculateDependencyRatio

func CalculateDependencyRatio(link, packageType string, linkCount map[string]map[string]int) (float64, error)

func CalculateDepsdistro

func CalculateDepsdistro(link string, linkCount map[string]map[string]int) float64

func CalculateScore

func CalculateScore(data ProjectData, distro_scores float64) float64

func CalculaterepoCount

func CalculaterepoCount(db *sql.DB)
func FetchAllLinks(db *sql.DB) ([]string, error)

func FetchdLinkCount

func FetchdLinkCount(repo string, db *sql.DB) map[string]int

func GetProjectTypeFromDB

func GetProjectTypeFromDB(link string) string

func UpdateScore

func UpdateScore(db *sql.DB, packageScore map[string]LinkScore, batchSize int) error

Types

type LinkScore

type LinkScore struct {
	Distro_scores float64
	Score         float64
}

type ProjectData

type ProjectData struct {
	StarCount        *int
	ForkCount        *int
	CreatedSince     *time.Time
	UpdatedSince     *time.Time
	ContributorCount *int
	CommitFrequency  *float64
	DepsdevCount     *int

	Pkg_Manager *string
	Org_Count   *int
	// contains filtered or unexported fields
}

func FetchProjectData

func FetchProjectData(db *sql.DB, gitLink string) (*ProjectData, error)

type UpdateData

type UpdateData struct {
	Link         string
	DistroScores float64
	Score        float64
}

Jump to

Keyboard shortcuts

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