Documentation ¶
Overview ¶
Package pkg has the main brains of Effrit. @package_owner = @skarlso
Index ¶
Constants ¶
const ( // EffritFileName sets the name of the file Effrit is using to save package data. EffritFileName = ".effrit_package_data.json" // CommentTag is the name of the tag. CommentTag = "@package_owner" // CommentFormat is the format used to parse a line for owner name. CommentFormat = "// " + CommentTag + " = %s" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Package ¶
type Package struct { Name string FullName string Imports []string ImportCount float64 DependedOnByCount float64 DependedOnByNames []string Stability float64 Abstractness float64 DistanceFromMedian float64 Dir string GoFiles []string }
Package is a single package as determined by go list.
func (Package) MarshalJSON ¶ added in v0.1.3
MarshalJSON returns a JSON encoding of Package
type Packages ¶
type Packages struct {
// contains filtered or unexported fields
}
Packages represents a collection of packages.
func NewPackages ¶
NewPackages returns a new initialized package collection.
func Scan ¶
Scan will scan a project using go list. As go list is running in the background, scan will display a waiting indicator.
func (*Packages) CalculateAbstractnessOfPackages ¶
CalculateAbstractnessOfPackages will walk all the files in the package and analyses abstractness.
func (*Packages) CalculateDistance ¶
func (pkg *Packages) CalculateDistance()
CalculateDistance will calculate the distance from the main sequence for all packages. 0: As far away from the main sequence as possible 1: Close as possible 0,0: Zone of Pain 1,1: Zone of Uselessness
func (*Packages) CalculateInstability ¶
func (pkg *Packages) CalculateInstability()
CalculateInstability will calculate the instability metric for all packages.
func (*Packages) Display ¶
Display displays the analysed information in a pretty way... TODO: Add multiple display options and Graph generation.
func (*Packages) Dump ¶
func (pkg *Packages) Dump()
Dump dumps the connections between packages in a JSON format for other tools to process.
func (*Packages) GatherDependedOnByCount ¶
func (pkg *Packages) GatherDependedOnByCount()
GatherDependedOnByCount looks for packages which import other packages in the project.