coverage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

@index 테스트 커버리지 분석. tested_by 엣지 기반으로 파일별, 커뮤니티별 커버리지 비율을 계산한다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommunityCoverage

type CommunityCoverage struct {
	CommunityID uint
	Label       string
	Total       int
	Tested      int
	Ratio       float64
}

CommunityCoverage holds aggregated coverage metrics for one community. @intent report test coverage across all functions assigned to a community

type FileCoverage

type FileCoverage struct {
	FilePath string
	Total    int
	Tested   int
	Ratio    float64
}

FileCoverage holds coverage metrics for one source file. @intent report how many functions in a file are exercised by tests

type Service

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

Service calculates test coverage metrics from graph relationships. @intent summarize tested_by coverage for files and communities

func New

func New(db *gorm.DB) *Service

New creates a coverage analysis service. @intent construct a reusable service for coverage queries

func (*Service) ByCommunity

func (s *Service) ByCommunity(ctx context.Context, communityID uint) (*CommunityCoverage, error)

ByCommunity calculates test coverage ratio for one community. @intent measure how thoroughly a detected module is exercised by tests @param communityID persisted community identifier to analyze @return coverage ratio of community functions with tested_by edges @domainRule coverage ratio equals tested functions divided by total functions @domainRule missing communities return a domain error instead of empty coverage @ensures successful results preserve the resolved community label

func (*Service) ByFile

func (s *Service) ByFile(ctx context.Context, filePath string) (*FileCoverage, error)

ByFile calculates test coverage ratio for a single file. Used by review_changes and pre_merge_check prompts.

@param filePath source file path to analyze @return coverage ratio of functions with tested_by edges @intent measure how well a file is covered by tests @domainRule coverage ratio equals tested functions divided by total functions @domainRule files with no functions return ratio 0.0

Jump to

Keyboard shortcuts

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