report

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseViolations

func ParseViolations(path string) (konveyor.RuleSet, error)

Types

type AffectedFile

type AffectedFile struct {
	Description string    `json:"description"`
	FileRefs    []FileRef `json:"files"`
}

AffectedFile is a set of incidents found in a file

func (AffectedFile) AsIncidentsAndTags

func (a AffectedFile) AsIncidentsAndTags() ([]konveyor.Incident, []string)

type Effort

type Effort struct {
	Type        string `json:"type"`
	Points      int    `json:"points"`
	Description string `json:"description"`
}

type File

type File struct {
	ID                          string        `json:"id"`
	FullPath                    string        `json:"fullPath"`
	PrettyPath                  string        `json:"prettyPath"`
	PrettyFileName              string        `json:"prettyFileName"`
	SourceType                  string        `json:"sourceType"`
	StoryPoints                 int           `json:"storyPoints"`
	Hints                       []Hint        `json:"hints"`
	Tags                        []FileTag     `json:"tags"`
	ClassificationsAndHintsTags []interface{} `json:"classificationsAndHintsTags"`
	Content                     FileContent   `json:"fileContent"`
}

File defines a file. it has content of the file and hints & tags to display when its opened in the UI

func ParseFilesJson

func ParseFilesJson(basePath string) ([]File, error)

ParseFilesJson parses ./api/files.json at basePath

type FileContent

type FileContent struct {
	Id      string `json:"id"`
	Content string `json:"content"`
}

FileContent has the actual file content in it

func ParseFileContentJson

func ParseFileContentJson(path string) (FileContent, error)

ParseFileContentJson parses json file at path as FileContent

type FileRef

type FileRef struct {
	FileID      string `json:"fileId"`
	FileName    string `json:"fileName"`
	Occurrences int    `json:"occurrences"`
	File        File   `json:"file"`
}

FileRef is a reference to a file model

func (FileRef) AsIncidents

func (f FileRef) AsIncidents() []konveyor.Incident

type FileTag

type FileTag struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Level   string `json:"level"`
}

FileTag is a tag displayed for a file

type Hint

type Hint struct {
	Line    int    `json:"line"`
	Title   string `json:"title"`
	RuleID  string `json:"ruleId"`
	Content string `json:"content"`
	Links   []Link `json:"links"`
}

Hint is closely equivalent to a message in violations

type Issue

type Issue struct {
	ID                 string         `json:"id"`
	Name               string         `json:"name"`
	RuleID             string         `json:"ruleId"`
	Category           string         `json:"category"`
	Effort             Effort         `json:"effort"`
	TotalIncidents     int            `json:"totalIncidents"`
	TotalStoryPoints   int            `json:"totalStoryPoints"`
	Links              []interface{}  `json:"links"`
	AffectedFiles      []AffectedFile `json:"affectedFiles"`
	SourceTechnologies []string       `json:"sourceTechnologies"`
	TargetTechnologies []string       `json:"targetTechnologies"`
}

Issue is what we see in each row in windup output

func (Issue) AsViolationAndTags

func (i Issue) AsViolationAndTags() (konveyor.Violation, []string)

type Issues

type Issues map[string]*Issue

Issues is a map of RuleID -> Issue

func ParseIssuesJson

func ParseIssuesJson(basePath string) (Issues, error)

ParseIssuesJson parses ./api/issues.json at basePath

func (Issues) AsRuleset

func (i Issues) AsRuleset() konveyor.RuleSet
type Link struct {
	Title string `json:"title"`
	Href  string `json:"href"`
}

type Result

type Result struct {
	P []output
	W []output
	F []output
}

func CompareIncidents

func CompareIncidents(want, got []konveyor.Incident) Result

func CompareRuleset

func CompareRuleset(want, got konveyor.RuleSet) Result

func CompareTags

func CompareTags(want, got []string) Result

func CompareViolation

func CompareViolation(want, got konveyor.Violation) Result

func (*Result) Fail

func (r *Result) Fail(m string, s *Result)

func (*Result) Pass

func (r *Result) Pass(m string, s *Result)

func (*Result) String

func (r *Result) String() string

func (*Result) Warn

func (r *Result) Warn(m string, s *Result)

Jump to

Keyboard shortcuts

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