instability

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package instability provides functions to retrieve instability, abstractness and distance from main diagonal of each package in a Golang project

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackageInstability

type PackageInstability struct {
	PackageName          string  `json:"package_name"`          // the package name
	AbstractionsCount    int     `json:"abstractions_count"`    // number of abstractions in the package
	ImplementationsCount int     `json:"implementations_count"` // number of implementations in the package
	AfferentCoupling     int     `json:"afferent_coupling"`     // the number of elements in other packages that depend upon elements within this package is an indicator of the package's responsibility.
	EfferentCoupling     int     `json:"efferent_coupling"`     // the number of elements in other packages that the elements in this package depend upon is an indicator of the package's dependence on externalities
	Instability          float64 `json:"instability"`           // calculated instability ( I = Ce / (Ce+Ca) )
	Abstractness         float64 `json:"abstractness"`          // calculated abstractness ( A = Abstractions/Total )
	Distance             float64 `json:"distance"`              // distance from main diagonal ( D = Abs[I + A - 1] )
}

PackageInstability represents software package metrics for a specific package more info: https://en.wikipedia.org/wiki/Software_package_metrics

func GetInstability

func GetInstability(prj *project.ProjectInfo) ([]*PackageInstability, error)

GetInstability retrieves the PackageInstability data for each package in the provided project

An error is returned when it's not possible to get the packages information

Jump to

Keyboard shortcuts

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