risk

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFindingRisk

func CalculateFindingRisk(finding types.Finding) float64

CalculateFindingRisk calculates the risk score for a single finding

func CalculateOverallRisk

func CalculateOverallRisk(findings []types.Finding) float64

CalculateOverallRisk calculates the overall risk score for a set of findings

func CalculateRiskByCategory

func CalculateRiskByCategory(findings []types.Finding) map[string]float64

CalculateRiskByCategory calculates risk scores by category

func CalculateRiskTrend

func CalculateRiskTrend(historicalFindings [][]types.Finding) []float64

CalculateRiskTrend calculates risk trend over time

func GetRiskRecommendations

func GetRiskRecommendations(findings []types.Finding) []string

GetRiskRecommendations provides recommendations based on risk analysis

Types

type Calculator

type Calculator struct {
	// contains filtered or unexported fields
}

Calculator calculates risk scores for findings

func NewCalculator

func NewCalculator() *Calculator

NewCalculator creates a new risk calculator

func (*Calculator) CalculateConfidence

func (c *Calculator) CalculateConfidence(finding *types.Finding) float64

CalculateConfidence calculates the confidence score for a finding

func (*Calculator) CalculateRiskScore

func (c *Calculator) CalculateRiskScore(result *types.ScanResult) float64

CalculateRiskScore calculates the overall risk score for a scan result

type HeatMapEntry

type HeatMapEntry struct {
	File        string  `json:"file"`
	Line        int     `json:"line"`
	RiskScore   float64 `json:"risk_score"`
	CryptoType  string  `json:"crypto_type"`
	Algorithm   string  `json:"algorithm"`
	Severity    string  `json:"severity"`
	Description string  `json:"description"`
}

HeatMapEntry represents an entry in the risk heat map

func GenerateHeatMap

func GenerateHeatMap(findings []types.Finding) []HeatMapEntry

GenerateHeatMap generates a risk heat map from findings

type RiskFactor

type RiskFactor struct {
	Name        string  `json:"name"`
	Weight      float64 `json:"weight"`
	Value       float64 `json:"value"`
	Description string  `json:"description"`
}

RiskFactor represents a factor that contributes to risk

type RiskScore

type RiskScore struct {
	Overall     float64            `json:"overall"`
	Categories  map[string]float64 `json:"categories"`
	Factors     map[string]float64 `json:"factors"`
	Explanation string             `json:"explanation"`
}

RiskScore represents a calculated risk score

Jump to

Keyboard shortcuts

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