model

package
v0.0.0-...-2853fc3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NC  float64 = 0.875
	NIA float64 = 0.625
	W   float64 = 0.375
	DM  float64 = 0.125
)
View Source
const (
	SHA1 HashAlgorithm     = "SHA-1"
	VCS  ExternalReference = "vcs"
)
View Source
const Separator string = " <---> "

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Version              string
	Description          string
	ArtifactRepositories []string
	Date                 time.Time
	Vulnerabilities      []string
	Dependents           []string
	Dependencies         []string
	DeprecationWarning   bool // TODO: Cant interpret false confidently
	Contributors         []string
	Developers           []string
	Organization         string
	Licenses             []string
	MailingLists         []string
}

type Commit

type Commit struct {
	Author       string
	Committer    string
	ChangedFiles []string
	Message      string
	Timestamp    time.Time
	Additions    int
	Deletions    int
	Total        int
}

func (Commit) GetTimestamp

func (c Commit) GetTimestamp() time.Time

type Contributor

type Contributor struct {
	Name              string
	Company           string
	Sponsors          int
	Organizations     int
	Contributions     int
	Repositories      int
	FirstContribution *time.Time
	LastContribution  *time.Time
}

type ContributorInfo

type ContributorInfo struct {
	Repositories struct {
		TotalCount int
	}
	Sponsors struct {
		TotalCount int
	}
	Organizations struct {
		TotalCount int
	}
	Company string
	Login   string
}

type Core

type Core struct {
	Name              CoreName
	NoConcerns        float64
	NoImmediateAction float64

	Watchlist      float64
	DecisionMaking float64

	UnderlyingCores map[float64][]Core
}

func NewCore

func NewCore(core CoreName) *Core

func (*Core) GetAllCores

func (cr *Core) GetAllCores() []Core

func (*Core) HighestPossibleValue

func (cr *Core) HighestPossibleValue() float64

func (*Core) Intake

func (cr *Core) Intake(value float64, weight float64)

func (*Core) IntakeLimit

func (cr *Core) IntakeLimit(value, limit, weight float64)

func (*Core) IntakeThreshold

func (cr *Core) IntakeThreshold(value, threshold, weight float64)

func (*Core) IsInconclusive

func (cr *Core) IsInconclusive() bool

func (*Core) Normalized

func (cr *Core) Normalized() Core

func (*Core) Overtake

func (cr *Core) Overtake(from Core, weight float64)

func (*Core) Recommend

func (cr *Core) Recommend() RecommendationDistribution

func (*Core) Sum

func (cr *Core) Sum() float64

func (*Core) ToString

func (cr *Core) ToString() string

func (*Core) ToStringDeep

func (cr *Core) ToStringDeep() string

type CoreName

type CoreName string
const (
	CombCon            CoreName = "Combination And Conclusion"
	Activity           CoreName = "Activity"
	CoreTeam           CoreName = "Core Team"
	Rivalry            CoreName = "Rivalry"
	DeityGiven         CoreName = "Deity-Given"
	Recentness         CoreName = "Recentness"
	Backup             CoreName = "Backup"
	Participation      CoreName = "Participation"
	Prestige           CoreName = "Prestige"
	Processing         CoreName = "Processing"
	Effort             CoreName = "Effort"
	Interconnectedness CoreName = "Interconnectedness"
	Network            CoreName = "Network"
	Popularity         CoreName = "Popularity"
	Vulnerabilities    CoreName = "Vulnerabilities"
	Community          CoreName = "Community"
	Support            CoreName = "Support"
	Circumstances      CoreName = "Circumstances"
	ProjectQuality     CoreName = "ProjectQuality"
	Engagement         CoreName = "Engagement"
	Licensing          CoreName = "Licensing"
	Marking            CoreName = "Marking"
)

type DataModel

type DataModel struct {
	Repository         *Repository
	Distribution       *Distribution
	VulnerabilityIndex *VulnerabilityIndex
}

type Dependency

type Dependency struct {
	Name               string
	Version            string
	PackageURL         string
	Hashes             map[HashAlgorithm]string
	ExternalReferences map[ExternalReference]string
}

type Distribution

type Distribution struct {
	Library  *Library
	Artifact *Artifact
}

type ExternalReference

type ExternalReference string

type HashAlgorithm

type HashAlgorithm string

type Issue

type Issue struct {
	Number            int
	Author            string
	AuthorAssociation string
	State             IssueState
	Title             string
	Content           string
	ClosedBy          string
	Contributions     []IssueContribution
	Contributors      []string
	CreationTime      time.Time
	FirstResponse     *time.Time
	LastUpdate        time.Time
	ClosingTime       time.Time
}

func (Issue) GetTimestamp

func (i Issue) GetTimestamp() time.Time

type IssueContribution

type IssueContribution struct {
	Time time.Time
}

func (IssueContribution) GetTimestamp

func (ic IssueContribution) GetTimestamp() time.Time

type IssueState

type IssueState string
const (
	IssueStateClosed IssueState = "closed"
)

type Library

type Library struct {
	Ranking       *int
	Licenses      []string
	UsedBy        *int
	Versions      []string
	LastUpdated   time.Time
	LatestVersion string
	LatestRelease string
}

type Organization

type Organization struct {
	Login             string
	PublicRepos       int
	Followers         int
	Following         int
	TotalPrivateRepos int
	OwnedPrivateRepos int
	Collaborators     int
}

type Recommendation

type Recommendation string
const (
	NoConcerns        Recommendation = "No Concerns"
	NoImmediateAction Recommendation = "No Immediate Action"
	Watchlist         Recommendation = "Watchlist"
	DecisionMaking    Recommendation = "Decision Making"
	Inconclusive      Recommendation = "Inconclusive | No Recommendation Was Possible"
)

func (Recommendation) ToAbbreviation

func (r Recommendation) ToAbbreviation() string

type RecommendationDistribution

type RecommendationDistribution map[Recommendation]float64

type Release

type Release struct {
	Author      string
	Version     string
	Description string
	Date        time.Time
}

func (Release) GetTimestamp

func (r Release) GetTimestamp() time.Time

type Repository

type Repository struct {
	Contributors []Contributor
	Issues       []Issue
	Commits      []Commit
	Releases     []Release

	*RepositoryData
}

func (*Repository) TotalCommits

func (r *Repository) TotalCommits() int

func (*Repository) TotalContributors

func (r *Repository) TotalContributors() int

func (*Repository) TotalIssues

func (r *Repository) TotalIssues() int

func (*Repository) TotalReleases

func (r *Repository) TotalReleases() int

type RepositoryData

type RepositoryData struct {
	Name      string
	Owner     string
	Org       *Organization
	CreatedAt time.Time
	Size      int

	License      string
	AllowForking bool

	ReadMe      string
	About       string
	Archivation bool
	Disabled    bool

	LOC int

	Forks    int
	Watchers int
	Stars    int

	Dependencies []string
	Dependents   []string
}

type VulnerabilityIndex

type VulnerabilityIndex struct {
	TotalVulnerabilitiesCount int
}

Jump to

Keyboard shortcuts

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