Documentation ¶
Overview ¶
Package coupling provides functions to evaluate the coupling level respect to a dependency in a Golang project
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyCoupling ¶
type DependencyCoupling struct { Dependency string `json:"dependency"` // the dependency evaluated for coupling level CouplingLevel int `json:"coupling_level"` // calculated coupling level for this dependency PackageDetails []*PackageCoupling `json:"details"` // coupling level detailed by package }
func CalculateCoupling ¶
func CalculateCoupling(prj *project.ProjectInfo, dep string) (*DependencyCoupling, error)
CalculateCoupling retrieves information about the coupling level of a provided Golang project respect to a specific dependency
An error is returned when it's not possible to get the packages information
type FileCoupling ¶
type FileCoupling struct { Package string `json:"package"` // the package File string `json:"file"` // the file FileContent string `json:"file_content"` // the file content Lines []int `json:"coupling_lines"` // the line where the dependency is used CouplingLevel int `json:"coupling_level"` // calculated coupling level for this file Details []Detail `json:"details"` // details about the dependency }
type PackageCoupling ¶
type PackageCoupling struct { Package string `json:"package"` // the package evaluated CouplingLevel int `json:"coupling_level"` // calculated coupling level for this package FileDetails []*FileCoupling `json:"details"` // coupling level detailed by package }
type SortFilesByDependencyLevel ¶
type SortFilesByDependencyLevel []*FileCoupling
func (SortFilesByDependencyLevel) Len ¶
func (a SortFilesByDependencyLevel) Len() int
func (SortFilesByDependencyLevel) Less ¶
func (a SortFilesByDependencyLevel) Less(i, j int) bool
func (SortFilesByDependencyLevel) Swap ¶
func (a SortFilesByDependencyLevel) Swap(i, j int)
type SortPackagesByDependencyLevel ¶
type SortPackagesByDependencyLevel []*PackageCoupling
func (SortPackagesByDependencyLevel) Len ¶
func (a SortPackagesByDependencyLevel) Len() int
func (SortPackagesByDependencyLevel) Less ¶
func (a SortPackagesByDependencyLevel) Less(i, j int) bool
func (SortPackagesByDependencyLevel) Swap ¶
func (a SortPackagesByDependencyLevel) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.