models

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 0 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

View Source
var ReportFileName string = "report.json"

ReportFileName File name for json report

Functions

This section is empty.

Types

type Mutant

type Mutant struct {
	Mutator       Mutator `json:"mutator"`
	Diff          string  `json:"diff"`
	ProcessOutput string  `json:"processOutput,omitempty"`
}

Mutant report by mutant for one mutation on one file

type Mutator

type Mutator struct {
	MutatorName        string `json:"mutatorName"`
	OriginalSourceCode string `json:"originalSourceCode"`
	MutatedSourceCode  string `json:"mutatedSourceCode"`
	OriginalFilePath   string `json:"originalFilePath"`
	OriginalStartLine  int64  `json:"originalStartLine"`
}

Mutator mutator and changes in file

type Options

type Options struct {
	General struct {
		Debug                bool   `long:"debug" description:"Debug log output"`
		DoNotRemoveTmpFolder bool   `long:"do-not-remove-tmp-folder" description:"Do not remove the tmp folder where all mutations are saved to"`
		Help                 bool   `long:"help" description:"Show this help message"`
		Verbose              bool   `long:"verbose" description:"Verbose log output"`
		Config               string `long:"config" description:"Path to config file"`
	} `group:"General options"`

	Files struct {
		Blacklist []string `` /* 140-byte string literal not displayed */
		ListFiles bool     `long:"list-files" description:"List found files"`
		PrintAST  bool     `long:"print-ast" description:"Print the ASTs of all given files and exit"`
	} `group:"File options"`

	Mutator struct {
		DisableMutators []string `` /* 157-byte string literal not displayed */
		ListMutators    bool     `long:"list-mutators" description:"List all available mutators (including disabled)"`
	} `group:"Mutator options"`

	Filter struct {
		Match string `long:"match" description:"Only functions are mutated that confirm to the arguments regex"`
	} `group:"Filter options"`

	Exec struct {
		Exec    string `long:"exec" description:"Execute this command for every mutation (by default the built-in exec command is used)"`
		NoExec  bool   `long:"no-exec" description:"Skip the built-in exec command and just generate the mutations"`
		Timeout uint   `long:"exec-timeout" description:"Sets a timeout for the command execution (in seconds)" default:"10"`
	} `group:"Exec options"`

	Test struct {
		Recursive bool `long:"test-recursive" description:"Defines if the executer should test recursively"`
	} `group:"Test options"`

	Remaining struct {
		Targets []string `description:"Packages, directories and files even with patterns (by default the current directory)"`
	} `positional-args:"true" required:"true"`

	Config struct {
		SkipFileWithoutTest  bool     `yaml:"skip_without_test"`
		SkipFileWithBuildTag bool     `yaml:"skip_with_build_tags"`
		JSONOutput           bool     `yaml:"json_output"`
		SilentMode           bool     `yaml:"silent_mode"`
		ExcludeDirs          []string `yaml:"exclude_dirs"`
	}
}

Options Main config structure

type Report

type Report struct {
	Stats     Stats    `json:"stats"`
	Escaped   []Mutant `json:"escaped"`
	Timeouted []Mutant `json:"timeouted"`
	Killed    []Mutant `json:"killed"`
	Errored   []Mutant `json:"errored"`
}

Report Structure for mutation report

func (*Report) Calculate

func (report *Report) Calculate()

Calculate calculation for final report

func (*Report) MsiScore

func (report *Report) MsiScore() float64

MsiScore msi score calculation

func (*Report) TotalCount

func (report *Report) TotalCount() int64

TotalCount total mutations count

type Stats

type Stats struct {
	TotalMutantsCount    int64   `json:"totalMutantsCount"`
	KilledCount          int64   `json:"killedCount"`
	NotCoveredCount      int64   `json:"notCoveredCount"`
	EscapedCount         int64   `json:"escapedCount"`
	ErrorCount           int64   `json:"errorCount"`
	SkippedCount         int64   `json:"skippedCount"`
	TimeOutCount         int64   `json:"timeOutCount"`
	Msi                  float64 `json:"msi"`
	MutationCodeCoverage int64   `json:"mutationCodeCoverage"`
	CoveredCodeMsi       float64 `json:"coveredCodeMsi"`
	DuplicatedCount      int64   `json:"-"`
}

Stats There is stats for mutations

Jump to

Keyboard shortcuts

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