models

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CoverageReport

type CoverageReport struct {
	TestName string
	Files    map[string]*FileCoverage
}

CoverageReport represents the complete coverage report

func NewCoverageReport

func NewCoverageReport() *CoverageReport

NewCoverageReport creates a new empty coverage report

func (*CoverageReport) AddFile

func (r *CoverageReport) AddFile(fc *FileCoverage)

AddFile adds a file coverage entry to the report

func (*CoverageReport) CalculateOverallCoverage

func (r *CoverageReport) CalculateOverallCoverage() (totalLines int, totalCovered int, overallPct float64)

CalculateOverallCoverage calculates the total lines, covered lines, and overall coverage percentage across all files

func (*CoverageReport) GetFile

func (r *CoverageReport) GetFile(filename string) *FileCoverage

GetFile retrieves file coverage by filename

type FileCoverage

type FileCoverage struct {
	FileName     string
	TotalLines   int
	CoveredLines int
	CoveragePct  float64
	Functions    []FunctionCoverage
	Lines        map[int]LineCoverage
}

FileCoverage represents coverage data for a single source file

func (*FileCoverage) CalculateCoverage

func (fc *FileCoverage) CalculateCoverage()

CalculateCoverage calculates the coverage percentage for a file

type FunctionCoverage

type FunctionCoverage struct {
	Name           string
	LineNumber     int
	ExecutionCount int
}

FunctionCoverage represents coverage data for a function

type LineCoverage

type LineCoverage struct {
	LineNumber     int
	ExecutionCount int
	Checksum       string
}

LineCoverage represents coverage data for a single line

Jump to

Keyboard shortcuts

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