entity

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package entity contains all entities that are used in every component of the application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	StartPosition token.Position
	EndPosition   token.Position
	DefPosition   token.Position
	Coverage      []cover.ProfileBlock
	Type          BlockType
	Children      []*Block
	Parent        *Block
	Ignore        bool
}

func (*Block) AddBlock

func (b *Block) AddBlock(newB *Block)

func (*Block) AddCoverageBlock

func (b *Block) AddCoverageBlock(block cover.ProfileBlock)

type BlockType

type BlockType uint8
const (
	TypeAtomic BlockType = iota
	TypeBlock
	TypeBranch
)

type Branch

type Branch struct {
	DefLine int
	Covered bool
}

type BranchCounter

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

func (*BranchCounter) AddBranch

func (b *BranchCounter) AddBranch(covered bool)

func (*BranchCounter) CoveredString

func (b *BranchCounter) CoveredString() string

func (*BranchCounter) String

func (b *BranchCounter) String() string

func (*BranchCounter) ValidString

func (b *BranchCounter) ValidString() string

type File

type File struct {
	Name           string
	FilePath       string
	Ast            *ast.File
	Methods        []*Method
	LineCoverage   LineCounter
	BranchCoverage BranchCounter
}

type Line

type Line struct {
	Number        int
	CoverageCount int
}

type LineCounter

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

func (*LineCounter) AddLine

func (c *LineCounter) AddLine(covered bool)

func (*LineCounter) CoveredString

func (c *LineCounter) CoveredString() string

func (*LineCounter) String

func (c *LineCounter) String() string

func (*LineCounter) ValidString

func (c *LineCounter) ValidString() string

type Method

type Method struct {
	Name           string
	Body           *ast.BlockStmt
	Tree           *Block
	LineCoverage   LineCounter
	BranchCoverage BranchCounter
	Complexity     int
	File           *token.File
	// contains filtered or unexported fields
}

func (*Method) GetBranches

func (m *Method) GetBranches() []*Branch

func (*Method) GetCover

func (m *Method) GetCover() []cover.ProfileBlock

func (*Method) GetLines

func (m *Method) GetLines() []*Line

type Package

type Package struct {
	Name           string
	Files          []*File
	Fset           *token.FileSet
	LineCoverage   LineCounter
	BranchCoverage BranchCounter
}

type Project

type Project struct {
	Packages       []*Package
	LineCoverage   LineCounter
	BranchCoverage BranchCounter
}

Jump to

Keyboard shortcuts

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