Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
Config holds configuration for LCOM analysis.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default LCOM configuration.
type MethodAccess ¶
MethodAccess describes a method, which instance variables it accesses, and which sibling methods it calls (intra-class calls, e.g. self.helper()).
type Result ¶
type Result struct {
ClassName string
FilePath string
StartLine int
EndLine int
LCOM4 int
TotalMethods int
ExcludedMethods int
InstanceVariables []string
MethodGroups [][]string
RiskLevel domain.RiskLevel
}
Result holds the LCOM4 analysis result for a class.
func ComputeLCOM4 ¶
func ComputeLCOM4(methods []MethodAccess, config Config) *Result
ComputeLCOM4 computes the LCOM4 metric using the Union-Find algorithm. LCOM4 counts the number of connected components among methods, where two methods are connected if they share at least one instance variable or one calls the other (intra-class method calls).
Click to show internal directories.
Click to hide internal directories.