Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssessRisk ¶
AssessRisk determines the risk level based on the CBO count and config thresholds.
func MatchesPattern ¶
MatchesPattern checks if a name matches any of the given wildcard patterns. Patterns support '*' as a wildcard using filepath.Match semantics.
Types ¶
type ClassDependency ¶
type ClassDependency struct {
ClassName string
Kind DependencyKind
}
ClassDependency represents a single dependency from one class to another.
type ClassInfo ¶
type ClassInfo struct {
Name string
FilePath string
StartLine int
EndLine int
Dependencies []ClassDependency
IsAbstract bool
BaseClasses []string
Methods []string
Attributes []string
}
ClassInfo holds the information about a class needed for CBO computation. Language-specific analyzers populate this from their AST.
type Config ¶
Config holds configuration for CBO analysis.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default CBO configuration.
type DependencyKind ¶
type DependencyKind int
DependencyKind represents the type of dependency between classes.
const ( DepInheritance DependencyKind = iota // Class inheritance DepTypeHint // Type hint/annotation DepInstantiation // Object instantiation DepAttributeAccess // Attribute access on another class DepImport // Import dependency )
func (DependencyKind) String ¶
func (k DependencyKind) String() string
String returns the string representation of a DependencyKind.
type Result ¶
type Result struct {
ClassName string
FilePath string
StartLine int
EndLine int
CouplingCount int
DependencyBreakdown map[DependencyKind]int
DependentClasses []string
RiskLevel domain.RiskLevel
IsAbstract bool
}
Result holds the CBO analysis result for a single class.
func ComputeCBO ¶
ComputeCBO computes Coupling Between Objects for each class.