Documentation
¶
Index ¶
- func ResolveFilePaths(fileReader domain.FileReader, paths []string, recursive bool, ...) ([]string, error)
- type AnalyzeRequestOverrides
- type AnalyzeUseCase
- func (uc *AnalyzeUseCase) Execute(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string) (*domain.AnalyzeResponse, error)
- func (uc *AnalyzeUseCase) ExecuteProjectWithOverrides(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string, ...) (*ProjectAnalysisResult, error)
- func (uc *AnalyzeUseCase) ExecuteWithOverrides(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string, ...) (*domain.AnalyzeResponse, error)
- type AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) Build() (*AnalyzeUseCase, error)
- func (b *AnalyzeUseCaseBuilder) WithCBOUseCase(uc *CBOUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithCloneUseCase(uc *CloneUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithCommunityUseCase(uc *CommunityUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithComplexityUseCase(uc *ComplexityUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithConfigLoader(cl domain.AnalyzeConfigurationLoader) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithDeadCodeUseCase(uc *DeadCodeUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithErrorCategorizer(ec domain.ErrorCategorizer) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithFileReader(fr domain.FileReader) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithFormatter(f domain.AnalyzeOutputFormatter) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithLCOMUseCase(uc *LCOMUseCase) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithParallelExecutor(pe domain.ParallelExecutor) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithProgressManager(pm domain.ProgressManager) *AnalyzeUseCaseBuilder
- func (b *AnalyzeUseCaseBuilder) WithSystemUseCase(uc *SystemAnalysisUseCase) *AnalyzeUseCaseBuilder
- type AnalyzeUseCaseConfig
- type CBOAnalysisService
- type CBOUseCase
- type CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) Build() (*CBOUseCase, error)
- func (b *CBOUseCaseBuilder) BuildWithDefaults() (*CBOUseCase, error)
- func (b *CBOUseCaseBuilder) WithConfigLoader(configLoader domain.CBOConfigurationLoader) *CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) WithFormatter(formatter domain.CBOOutputFormatter) *CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) WithService(service domain.CBOService) *CBOUseCaseBuilder
- func (b *CBOUseCaseBuilder) WithSnapshotService(service CBOAnalysisService) *CBOUseCaseBuilder
- type CloneAnalysisService
- type CloneUseCase
- func (uc *CloneUseCase) ComputeFragmentSimilarity(ctx context.Context, fragment1, fragment2 string) (float64, error)
- func (uc *CloneUseCase) Execute(ctx context.Context, req domain.CloneRequest) error
- func (uc *CloneUseCase) ExecuteAndReturn(ctx context.Context, req domain.CloneRequest) (*domain.CloneResponse, error)
- func (uc *CloneUseCase) ExecuteWithFiles(ctx context.Context, filePaths []string, req domain.CloneRequest) error
- func (uc *CloneUseCase) SaveConfiguration(req domain.CloneRequest, configPath string) error
- type CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) Build() (*CloneUseCase, error)
- func (b *CloneUseCaseBuilder) WithConfigLoader(configLoader domain.CloneConfigurationLoader) *CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) WithFormatter(formatter domain.CloneOutputFormatter) *CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) WithService(service domain.CloneService) *CloneUseCaseBuilder
- func (b *CloneUseCaseBuilder) WithSnapshotService(service CloneAnalysisService) *CloneUseCaseBuilder
- type CommunityAnalysisService
- type CommunityUseCase
- type CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) Build() (*CommunityUseCase, error)
- func (b *CommunityUseCaseBuilder) WithConfigLoader(configLoader domain.CommunityConfigurationLoader) *CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) WithFormatter(formatter domain.CommunityAnalysisOutputFormatter) *CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) WithGraphService(service CommunityAnalysisService) *CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CommunityUseCaseBuilder
- func (b *CommunityUseCaseBuilder) WithService(service domain.CommunityAnalysisService) *CommunityUseCaseBuilder
- type ComplexityAnalysisService
- type ComplexityUseCase
- func (uc *ComplexityUseCase) AnalyzeAndReturn(ctx context.Context, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
- func (uc *ComplexityUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.ComplexityRequest) error
- func (uc *ComplexityUseCase) Execute(ctx context.Context, req domain.ComplexityRequest) error
- type ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) Build() (*ComplexityUseCase, error)
- func (b *ComplexityUseCaseBuilder) BuildWithDefaults() (*ComplexityUseCase, error)
- func (b *ComplexityUseCaseBuilder) WithConfigLoader(configLoader domain.ConfigurationLoader) *ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) WithFormatter(formatter domain.OutputFormatter) *ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) WithService(service domain.ComplexityService) *ComplexityUseCaseBuilder
- func (b *ComplexityUseCaseBuilder) WithSnapshotService(service ComplexityAnalysisService) *ComplexityUseCaseBuilder
- type DIAntipatternSnapshotService
- type DIAntipatternUseCase
- func (uc *DIAntipatternUseCase) AnalyzeAndReturn(ctx context.Context, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
- func (uc *DIAntipatternUseCase) AnalyzeSnapshotAndReturn(ctx context.Context, snapshot *svc.ProjectSnapshot, ...) (*domain.DIAntipatternResponse, error)
- func (uc *DIAntipatternUseCase) Execute(ctx context.Context, req domain.DIAntipatternRequest) error
- type DIAntipatternUseCaseBuilder
- func (b *DIAntipatternUseCaseBuilder) Build() (*DIAntipatternUseCase, error)
- func (b *DIAntipatternUseCaseBuilder) WithConfigLoader(configLoader domain.DIAntipatternConfigurationLoader) *DIAntipatternUseCaseBuilder
- func (b *DIAntipatternUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *DIAntipatternUseCaseBuilder
- func (b *DIAntipatternUseCaseBuilder) WithFormatter(formatter domain.DIAntipatternOutputFormatter) *DIAntipatternUseCaseBuilder
- func (b *DIAntipatternUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *DIAntipatternUseCaseBuilder
- func (b *DIAntipatternUseCaseBuilder) WithService(service domain.DIAntipatternService) *DIAntipatternUseCaseBuilder
- type DeadCodeAnalysisService
- type DeadCodeUseCase
- func (uc *DeadCodeUseCase) AnalyzeAndReturn(ctx context.Context, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
- func (uc *DeadCodeUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.DeadCodeRequest) error
- func (uc *DeadCodeUseCase) AnalyzeFunction(ctx context.Context, functionCFG interface{}, req domain.DeadCodeRequest) (*domain.FunctionDeadCode, error)
- func (uc *DeadCodeUseCase) Execute(ctx context.Context, req domain.DeadCodeRequest) error
- func (uc *DeadCodeUseCase) ExecuteWithOptions(ctx context.Context, req domain.DeadCodeRequest, ...) error
- func (uc *DeadCodeUseCase) GetSupportedFormats() []domain.OutputFormat
- func (uc *DeadCodeUseCase) GetSupportedSeverityLevels() []domain.DeadCodeSeverity
- func (uc *DeadCodeUseCase) GetSupportedSortCriteria() []domain.DeadCodeSortCriteria
- func (uc *DeadCodeUseCase) QuickAnalysis(ctx context.Context, filePaths []string, outputWriter *os.File) error
- func (uc *DeadCodeUseCase) ValidateConfiguration(req domain.DeadCodeRequest) error
- type DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) Build() (*DeadCodeUseCase, error)
- func (b *DeadCodeUseCaseBuilder) BuildWithDefaults() (*DeadCodeUseCase, error)
- func (b *DeadCodeUseCaseBuilder) WithConfigLoader(configLoader domain.DeadCodeConfigurationLoader) *DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) WithFormatter(formatter domain.DeadCodeFormatter) *DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) WithService(service domain.DeadCodeService) *DeadCodeUseCaseBuilder
- func (b *DeadCodeUseCaseBuilder) WithSnapshotService(service DeadCodeAnalysisService) *DeadCodeUseCaseBuilder
- type DeadCodeUseCaseOptions
- type LCOMAnalysisService
- type LCOMUseCase
- type LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) Build() (*LCOMUseCase, error)
- func (b *LCOMUseCaseBuilder) WithConfigLoader(configLoader domain.LCOMConfigurationLoader) *LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) WithFormatter(formatter domain.LCOMOutputFormatter) *LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) WithService(service domain.LCOMService) *LCOMUseCaseBuilder
- func (b *LCOMUseCaseBuilder) WithSnapshotService(service LCOMAnalysisService) *LCOMUseCaseBuilder
- type MockDataSnapshotService
- type MockDataUseCase
- func (uc *MockDataUseCase) AnalyzeAndReturn(ctx context.Context, req domain.MockDataRequest) (*domain.MockDataResponse, error)
- func (uc *MockDataUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.MockDataRequest) error
- func (uc *MockDataUseCase) AnalyzeSnapshotAndReturn(ctx context.Context, snapshot *svc.ProjectSnapshot, req domain.MockDataRequest) (*domain.MockDataResponse, error)
- func (uc *MockDataUseCase) Execute(ctx context.Context, req domain.MockDataRequest) error
- type MockDataUseCaseBuilder
- func (b *MockDataUseCaseBuilder) Build() (*MockDataUseCase, error)
- func (b *MockDataUseCaseBuilder) BuildWithDefaults() (*MockDataUseCase, error)
- func (b *MockDataUseCaseBuilder) WithConfigLoader(configLoader domain.MockDataConfigurationLoader) *MockDataUseCaseBuilder
- func (b *MockDataUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *MockDataUseCaseBuilder
- func (b *MockDataUseCaseBuilder) WithFormatter(formatter domain.MockDataFormatter) *MockDataUseCaseBuilder
- func (b *MockDataUseCaseBuilder) WithOutput(output domain.ReportWriter) *MockDataUseCaseBuilder
- func (b *MockDataUseCaseBuilder) WithService(service domain.MockDataService) *MockDataUseCaseBuilder
- type ProjectAnalysisResult
- type SystemAnalysisService
- type SystemAnalysisUseCase
- func (uc *SystemAnalysisUseCase) AnalyzeAndReturn(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
- func (uc *SystemAnalysisUseCase) AnalyzeArchitectureOnly(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.ArchitectureAnalysisResult, error)
- func (uc *SystemAnalysisUseCase) AnalyzeDependenciesOnly(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.DependencyAnalysisResult, error)
- func (uc *SystemAnalysisUseCase) Execute(ctx context.Context, req domain.SystemAnalysisRequest) error
- type SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) Build() (*SystemAnalysisUseCase, error)
- func (b *SystemAnalysisUseCaseBuilder) BuildWithDefaults() (*SystemAnalysisUseCase, error)
- func (b *SystemAnalysisUseCaseBuilder) WithConfigLoader(configLoader domain.SystemAnalysisConfigurationLoader) *SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) WithFormatter(formatter domain.SystemAnalysisOutputFormatter) *SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) WithGraphService(service SystemAnalysisService) *SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *SystemAnalysisUseCaseBuilder
- func (b *SystemAnalysisUseCaseBuilder) WithService(service domain.SystemAnalysisService) *SystemAnalysisUseCaseBuilder
- type UseCaseOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveFilePaths ¶ added in v1.2.0
func ResolveFilePaths( fileReader domain.FileReader, paths []string, recursive bool, includePatterns []string, excludePatterns []string, validatePythonFile bool, ) ([]string, error)
ResolveFilePaths resolves file paths for analysis. If all paths are already files (not directories), returns them directly. Otherwise, collects Python files from the provided paths using the specified filters.
Parameters:
- fileReader: The file reader abstraction for file operations
- paths: The input paths to resolve (can be files or directories)
- recursive: Whether to recursively collect files from subdirectories
- includePatterns: Glob patterns for files to include
- excludePatterns: Glob patterns for files to exclude
- validatePythonFile: If true, also validates paths are Python files (stricter check)
Returns:
- []string: List of resolved Python file paths
- error: Any error encountered during resolution
This function optimizes the case where AnalyzeUseCase pre-collects files and passes them to individual analysis use cases, avoiding redundant file collection.
Types ¶
type AnalyzeRequestOverrides ¶ added in v1.26.4
type AnalyzeRequestOverrides struct {
Recursive *bool
ComplexityEnabled *bool
DeadCodeEnabled *bool
SystemEnabled *bool
SystemAnalyzeDependencies *bool
SystemAnalyzeArchitecture *bool
ModuleGraph *domain.ModuleGraphOptions
}
AnalyzeRequestOverrides contains request-scoped values that take precedence over the resolved project configuration.
type AnalyzeUseCase ¶
type AnalyzeUseCase struct {
// contains filtered or unexported fields
}
AnalyzeUseCase orchestrates comprehensive analysis
func (*AnalyzeUseCase) Execute ¶
func (uc *AnalyzeUseCase) Execute(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string) (*domain.AnalyzeResponse, error)
Execute performs comprehensive analysis
func (*AnalyzeUseCase) ExecuteProjectWithOverrides ¶ added in v1.30.0
func (uc *AnalyzeUseCase) ExecuteProjectWithOverrides(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string, overrides AnalyzeRequestOverrides) (*ProjectAnalysisResult, error)
ExecuteProjectWithOverrides returns the response and the sealed snapshot that produced it.
func (*AnalyzeUseCase) ExecuteWithOverrides ¶ added in v1.26.4
func (uc *AnalyzeUseCase) ExecuteWithOverrides(ctx context.Context, useCaseCfg AnalyzeUseCaseConfig, paths []string, overrides AnalyzeRequestOverrides) (*domain.AnalyzeResponse, error)
ExecuteWithOverrides performs comprehensive analysis with request-scoped overrides applied after project configuration is resolved.
type AnalyzeUseCaseBuilder ¶
type AnalyzeUseCaseBuilder struct {
// contains filtered or unexported fields
}
AnalyzeUseCaseBuilder builds an AnalyzeUseCase
func NewAnalyzeUseCaseBuilder ¶
func NewAnalyzeUseCaseBuilder() *AnalyzeUseCaseBuilder
NewAnalyzeUseCaseBuilder creates a new builder
func (*AnalyzeUseCaseBuilder) Build ¶
func (b *AnalyzeUseCaseBuilder) Build() (*AnalyzeUseCase, error)
Build creates the AnalyzeUseCase
func (*AnalyzeUseCaseBuilder) WithCBOUseCase ¶
func (b *AnalyzeUseCaseBuilder) WithCBOUseCase(uc *CBOUseCase) *AnalyzeUseCaseBuilder
WithCBOUseCase sets the CBO use case
func (*AnalyzeUseCaseBuilder) WithCloneUseCase ¶
func (b *AnalyzeUseCaseBuilder) WithCloneUseCase(uc *CloneUseCase) *AnalyzeUseCaseBuilder
WithCloneUseCase sets the clone use case
func (*AnalyzeUseCaseBuilder) WithCommunityUseCase ¶ added in v1.25.0
func (b *AnalyzeUseCaseBuilder) WithCommunityUseCase(uc *CommunityUseCase) *AnalyzeUseCaseBuilder
WithCommunityUseCase sets the community analysis use case
func (*AnalyzeUseCaseBuilder) WithComplexityUseCase ¶
func (b *AnalyzeUseCaseBuilder) WithComplexityUseCase(uc *ComplexityUseCase) *AnalyzeUseCaseBuilder
WithComplexityUseCase sets the complexity use case
func (*AnalyzeUseCaseBuilder) WithConfigLoader ¶ added in v1.16.0
func (b *AnalyzeUseCaseBuilder) WithConfigLoader(cl domain.AnalyzeConfigurationLoader) *AnalyzeUseCaseBuilder
WithConfigLoader sets the analyze configuration loader.
func (*AnalyzeUseCaseBuilder) WithDeadCodeUseCase ¶
func (b *AnalyzeUseCaseBuilder) WithDeadCodeUseCase(uc *DeadCodeUseCase) *AnalyzeUseCaseBuilder
WithDeadCodeUseCase sets the dead code use case
func (*AnalyzeUseCaseBuilder) WithErrorCategorizer ¶
func (b *AnalyzeUseCaseBuilder) WithErrorCategorizer(ec domain.ErrorCategorizer) *AnalyzeUseCaseBuilder
WithErrorCategorizer sets the error categorizer
func (*AnalyzeUseCaseBuilder) WithFileReader ¶
func (b *AnalyzeUseCaseBuilder) WithFileReader(fr domain.FileReader) *AnalyzeUseCaseBuilder
WithFileReader sets the file reader
func (*AnalyzeUseCaseBuilder) WithFormatter ¶
func (b *AnalyzeUseCaseBuilder) WithFormatter(f domain.AnalyzeOutputFormatter) *AnalyzeUseCaseBuilder
WithFormatter sets the formatter
func (*AnalyzeUseCaseBuilder) WithLCOMUseCase ¶ added in v1.11.0
func (b *AnalyzeUseCaseBuilder) WithLCOMUseCase(uc *LCOMUseCase) *AnalyzeUseCaseBuilder
WithLCOMUseCase sets the LCOM use case
func (*AnalyzeUseCaseBuilder) WithParallelExecutor ¶
func (b *AnalyzeUseCaseBuilder) WithParallelExecutor(pe domain.ParallelExecutor) *AnalyzeUseCaseBuilder
WithParallelExecutor sets the parallel executor
func (*AnalyzeUseCaseBuilder) WithProgressManager ¶
func (b *AnalyzeUseCaseBuilder) WithProgressManager(pm domain.ProgressManager) *AnalyzeUseCaseBuilder
WithProgressManager sets the progress manager
func (*AnalyzeUseCaseBuilder) WithSystemUseCase ¶
func (b *AnalyzeUseCaseBuilder) WithSystemUseCase(uc *SystemAnalysisUseCase) *AnalyzeUseCaseBuilder
WithSystemUseCase sets the system analysis use case
type AnalyzeUseCaseConfig ¶
type AnalyzeUseCaseConfig struct {
SkipComplexity bool
SkipDeadCode bool
SkipClones bool
SkipCBO bool
SkipLCOM bool
SkipSystem bool
SkipCommunities bool
// SelectAnalysesUsed is true when --select was provided on the CLI.
SelectAnalysesUsed bool
// SkipCommunitiesExplicit is true when --skip-communities was provided.
SkipCommunitiesExplicit bool
MinComplexity int
MinSeverity domain.DeadCodeSeverity
CloneSimilarity float64
MinCBO int
// Complexity thresholds (0 = unset, use config file or default)
LowThreshold int
MediumThreshold int
CognitiveComplexityThreshold int
NestingDepthThreshold int
FunctionSLOCWarnThreshold int
FunctionSLOCCriticalThreshold int
// Clone detection options
EnableDFA bool // Enable Data Flow Analysis for enhanced Type-4 detection
ConfigFile string
Verbose bool
}
AnalyzeUseCaseConfig holds configuration for the analyze use case
func ApplyAnalyzeSelection ¶ added in v1.25.0
func ApplyAnalyzeSelection(config AnalyzeUseCaseConfig, analyses []string) AnalyzeUseCaseConfig
ApplyAnalyzeSelection applies explicit analyzer selection to the use-case config. It is shared by CLI and MCP entrypoints so selection semantics stay consistent across transports.
type CBOAnalysisService ¶ added in v1.30.0
type CBOAnalysisService interface {
domain.CBOService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.CBORequest) (*domain.CBOResponse, error)
}
CBOAnalysisService adds canonical snapshot analysis to the standalone CBO contract.
type CBOUseCase ¶
type CBOUseCase struct {
// contains filtered or unexported fields
}
CBOUseCase orchestrates the CBO analysis workflow
func NewCBOUseCase ¶
func NewCBOUseCase( service domain.CBOService, fileReader domain.FileReader, formatter domain.CBOOutputFormatter, configLoader domain.CBOConfigurationLoader, ) *CBOUseCase
NewCBOUseCase creates a new CBO use case
func NewSnapshotCBOUseCase ¶ added in v1.30.0
func NewSnapshotCBOUseCase(service CBOAnalysisService, fileReader domain.FileReader, formatter domain.CBOOutputFormatter, configLoader domain.CBOConfigurationLoader) *CBOUseCase
NewSnapshotCBOUseCase constructs a CBO use case for aggregate snapshot analysis.
func (*CBOUseCase) AnalyzeAndReturn ¶
func (uc *CBOUseCase) AnalyzeAndReturn(ctx context.Context, req domain.CBORequest) (*domain.CBOResponse, error)
AnalyzeAndReturn performs CBO analysis and returns the response without formatting
func (*CBOUseCase) AnalyzeFile ¶
func (uc *CBOUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.CBORequest) error
AnalyzeFile analyzes a single file
func (*CBOUseCase) Execute ¶
func (uc *CBOUseCase) Execute(ctx context.Context, req domain.CBORequest) error
Execute performs the complete CBO analysis workflow
type CBOUseCaseBuilder ¶
type CBOUseCaseBuilder struct {
// contains filtered or unexported fields
}
CBOUseCaseBuilder provides a builder pattern for creating CBOUseCase
func NewCBOUseCaseBuilder ¶
func NewCBOUseCaseBuilder() *CBOUseCaseBuilder
NewCBOUseCaseBuilder creates a new builder
func (*CBOUseCaseBuilder) Build ¶
func (b *CBOUseCaseBuilder) Build() (*CBOUseCase, error)
Build creates the CBOUseCase with the configured dependencies
func (*CBOUseCaseBuilder) BuildWithDefaults ¶
func (b *CBOUseCaseBuilder) BuildWithDefaults() (*CBOUseCase, error)
BuildWithDefaults creates the CBOUseCase with default implementations for optional dependencies
func (*CBOUseCaseBuilder) WithConfigLoader ¶
func (b *CBOUseCaseBuilder) WithConfigLoader(configLoader domain.CBOConfigurationLoader) *CBOUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*CBOUseCaseBuilder) WithFileReader ¶
func (b *CBOUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CBOUseCaseBuilder
WithFileReader sets the file reader
func (*CBOUseCaseBuilder) WithFormatter ¶
func (b *CBOUseCaseBuilder) WithFormatter(formatter domain.CBOOutputFormatter) *CBOUseCaseBuilder
WithFormatter sets the output formatter
func (*CBOUseCaseBuilder) WithOutputWriter ¶
func (b *CBOUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CBOUseCaseBuilder
WithOutputWriter sets the report writer
func (*CBOUseCaseBuilder) WithService ¶
func (b *CBOUseCaseBuilder) WithService(service domain.CBOService) *CBOUseCaseBuilder
WithService sets the CBO service
func (*CBOUseCaseBuilder) WithSnapshotService ¶ added in v1.30.0
func (b *CBOUseCaseBuilder) WithSnapshotService(service CBOAnalysisService) *CBOUseCaseBuilder
WithSnapshotService sets the CBO collaborator used by aggregate snapshot analysis.
type CloneAnalysisService ¶ added in v1.30.0
type CloneAnalysisService interface {
domain.CloneService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, *domain.CloneRequest) (*domain.CloneResponse, error)
}
CloneAnalysisService adds canonical snapshot analysis to the standalone clone contract.
type CloneUseCase ¶
type CloneUseCase struct {
// contains filtered or unexported fields
}
CloneUseCase orchestrates clone detection operations
func NewCloneUseCase ¶
func NewCloneUseCase( service domain.CloneService, fileReader domain.FileReader, formatter domain.CloneOutputFormatter, configLoader domain.CloneConfigurationLoader, ) *CloneUseCase
NewCloneUseCase creates a new clone use case with the given dependencies
func NewSnapshotCloneUseCase ¶ added in v1.30.0
func NewSnapshotCloneUseCase(service CloneAnalysisService, fileReader domain.FileReader, formatter domain.CloneOutputFormatter, configLoader domain.CloneConfigurationLoader) *CloneUseCase
NewSnapshotCloneUseCase constructs a clone use case for aggregate snapshot analysis.
func (*CloneUseCase) ComputeFragmentSimilarity ¶
func (uc *CloneUseCase) ComputeFragmentSimilarity(ctx context.Context, fragment1, fragment2 string) (float64, error)
ComputeFragmentSimilarity computes similarity between two code fragments
func (*CloneUseCase) Execute ¶
func (uc *CloneUseCase) Execute(ctx context.Context, req domain.CloneRequest) error
Execute executes the clone detection use case
func (*CloneUseCase) ExecuteAndReturn ¶
func (uc *CloneUseCase) ExecuteAndReturn(ctx context.Context, req domain.CloneRequest) (*domain.CloneResponse, error)
ExecuteAndReturn performs clone detection and returns the response without formatting
func (*CloneUseCase) ExecuteWithFiles ¶
func (uc *CloneUseCase) ExecuteWithFiles(ctx context.Context, filePaths []string, req domain.CloneRequest) error
ExecuteWithFiles executes clone detection on specific files
func (*CloneUseCase) SaveConfiguration ¶
func (uc *CloneUseCase) SaveConfiguration(req domain.CloneRequest, configPath string) error
SaveConfiguration saves the current clone detection configuration
type CloneUseCaseBuilder ¶
type CloneUseCaseBuilder struct {
// contains filtered or unexported fields
}
CloneUseCaseBuilder helps build CloneUseCase with dependencies
func NewCloneUseCaseBuilder ¶
func NewCloneUseCaseBuilder() *CloneUseCaseBuilder
NewCloneUseCaseBuilder creates a new builder for CloneUseCase
func (*CloneUseCaseBuilder) Build ¶
func (b *CloneUseCaseBuilder) Build() (*CloneUseCase, error)
Build creates the CloneUseCase with the configured dependencies
func (*CloneUseCaseBuilder) WithConfigLoader ¶
func (b *CloneUseCaseBuilder) WithConfigLoader(configLoader domain.CloneConfigurationLoader) *CloneUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*CloneUseCaseBuilder) WithFileReader ¶
func (b *CloneUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CloneUseCaseBuilder
WithFileReader sets the file reader
func (*CloneUseCaseBuilder) WithFormatter ¶
func (b *CloneUseCaseBuilder) WithFormatter(formatter domain.CloneOutputFormatter) *CloneUseCaseBuilder
WithFormatter sets the output formatter
func (*CloneUseCaseBuilder) WithOutputWriter ¶
func (b *CloneUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CloneUseCaseBuilder
WithOutputWriter sets the report writer
func (*CloneUseCaseBuilder) WithService ¶
func (b *CloneUseCaseBuilder) WithService(service domain.CloneService) *CloneUseCaseBuilder
WithService sets the clone service
func (*CloneUseCaseBuilder) WithSnapshotService ¶ added in v1.30.0
func (b *CloneUseCaseBuilder) WithSnapshotService(service CloneAnalysisService) *CloneUseCaseBuilder
WithSnapshotService sets the clone collaborator used by aggregate snapshot analysis.
type CommunityAnalysisService ¶ added in v1.30.0
type CommunityAnalysisService interface {
domain.CommunityAnalysisService
AnalyzeGraph(context.Context, *svc.ProjectModuleGraph, domain.CommunityAnalysisRequest) (*domain.CommunityAnalysisResult, error)
}
CommunityAnalysisService is the complete service contract required by the community use case, including snapshot-backed graph analysis.
type CommunityUseCase ¶ added in v1.25.0
type CommunityUseCase struct {
// contains filtered or unexported fields
}
CommunityUseCase orchestrates the community analysis workflow.
func NewCommunityUseCase ¶ added in v1.25.0
func NewCommunityUseCase( service domain.CommunityAnalysisService, fileReader domain.FileReader, formatter domain.CommunityAnalysisOutputFormatter, configLoader domain.CommunityConfigurationLoader, ) *CommunityUseCase
NewCommunityUseCase creates a new community use case.
func NewGraphCommunityUseCase ¶ added in v1.30.0
func NewGraphCommunityUseCase(service CommunityAnalysisService, fileReader domain.FileReader, formatter domain.CommunityAnalysisOutputFormatter, configLoader domain.CommunityConfigurationLoader) *CommunityUseCase
NewGraphCommunityUseCase constructs a community use case for aggregate graph analysis.
func (*CommunityUseCase) AnalyzeAndReturn ¶ added in v1.25.0
func (uc *CommunityUseCase) AnalyzeAndReturn(ctx context.Context, req domain.CommunityAnalysisRequest) (*domain.CommunityAnalysisResult, error)
AnalyzeAndReturn performs community analysis and returns the response without formatting.
func (*CommunityUseCase) Execute ¶ added in v1.25.0
func (uc *CommunityUseCase) Execute(ctx context.Context, req domain.CommunityAnalysisRequest) error
Execute performs the complete community analysis workflow.
type CommunityUseCaseBuilder ¶ added in v1.25.0
type CommunityUseCaseBuilder struct {
// contains filtered or unexported fields
}
CommunityUseCaseBuilder provides a builder pattern for creating CommunityUseCase.
func NewCommunityUseCaseBuilder ¶ added in v1.25.0
func NewCommunityUseCaseBuilder() *CommunityUseCaseBuilder
NewCommunityUseCaseBuilder creates a new builder.
func (*CommunityUseCaseBuilder) Build ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) Build() (*CommunityUseCase, error)
func (*CommunityUseCaseBuilder) WithConfigLoader ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) WithConfigLoader(configLoader domain.CommunityConfigurationLoader) *CommunityUseCaseBuilder
func (*CommunityUseCaseBuilder) WithFileReader ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *CommunityUseCaseBuilder
func (*CommunityUseCaseBuilder) WithFormatter ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) WithFormatter(formatter domain.CommunityAnalysisOutputFormatter) *CommunityUseCaseBuilder
func (*CommunityUseCaseBuilder) WithGraphService ¶ added in v1.30.0
func (b *CommunityUseCaseBuilder) WithGraphService(service CommunityAnalysisService) *CommunityUseCaseBuilder
WithGraphService sets the community collaborator used by aggregate graph analysis.
func (*CommunityUseCaseBuilder) WithOutputWriter ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CommunityUseCaseBuilder
func (*CommunityUseCaseBuilder) WithService ¶ added in v1.25.0
func (b *CommunityUseCaseBuilder) WithService(service domain.CommunityAnalysisService) *CommunityUseCaseBuilder
type ComplexityAnalysisService ¶ added in v1.30.0
type ComplexityAnalysisService interface {
domain.ComplexityService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.ComplexityRequest) (*domain.ComplexityResponse, error)
}
ComplexityAnalysisService adds canonical snapshot analysis to the standalone complexity contract.
type ComplexityUseCase ¶
type ComplexityUseCase struct {
// contains filtered or unexported fields
}
ComplexityUseCase orchestrates the complexity analysis workflow
func NewComplexityUseCase ¶
func NewComplexityUseCase( service domain.ComplexityService, fileReader domain.FileReader, formatter domain.OutputFormatter, configLoader domain.ConfigurationLoader, ) *ComplexityUseCase
NewComplexityUseCase creates a new complexity use case
func NewSnapshotComplexityUseCase ¶ added in v1.30.0
func NewSnapshotComplexityUseCase(service ComplexityAnalysisService, fileReader domain.FileReader, formatter domain.OutputFormatter, configLoader domain.ConfigurationLoader) *ComplexityUseCase
NewSnapshotComplexityUseCase constructs the aggregate-analysis variant with an explicit snapshot collaborator.
func (*ComplexityUseCase) AnalyzeAndReturn ¶
func (uc *ComplexityUseCase) AnalyzeAndReturn(ctx context.Context, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
AnalyzeAndReturn performs complexity analysis and returns the response without formatting
func (*ComplexityUseCase) AnalyzeFile ¶
func (uc *ComplexityUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.ComplexityRequest) error
AnalyzeFile analyzes a single file
func (*ComplexityUseCase) Execute ¶
func (uc *ComplexityUseCase) Execute(ctx context.Context, req domain.ComplexityRequest) error
Execute performs the complete complexity analysis workflow
type ComplexityUseCaseBuilder ¶
type ComplexityUseCaseBuilder struct {
// contains filtered or unexported fields
}
ComplexityUseCaseBuilder provides a builder pattern for creating ComplexityUseCase
func NewComplexityUseCaseBuilder ¶
func NewComplexityUseCaseBuilder() *ComplexityUseCaseBuilder
NewComplexityUseCaseBuilder creates a new builder
func (*ComplexityUseCaseBuilder) Build ¶
func (b *ComplexityUseCaseBuilder) Build() (*ComplexityUseCase, error)
Build creates the ComplexityUseCase with the configured dependencies
func (*ComplexityUseCaseBuilder) BuildWithDefaults ¶
func (b *ComplexityUseCaseBuilder) BuildWithDefaults() (*ComplexityUseCase, error)
BuildWithDefaults creates the ComplexityUseCase with default implementations for optional dependencies
func (*ComplexityUseCaseBuilder) WithConfigLoader ¶
func (b *ComplexityUseCaseBuilder) WithConfigLoader(configLoader domain.ConfigurationLoader) *ComplexityUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*ComplexityUseCaseBuilder) WithFileReader ¶
func (b *ComplexityUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *ComplexityUseCaseBuilder
WithFileReader sets the file reader
func (*ComplexityUseCaseBuilder) WithFormatter ¶
func (b *ComplexityUseCaseBuilder) WithFormatter(formatter domain.OutputFormatter) *ComplexityUseCaseBuilder
WithFormatter sets the output formatter
func (*ComplexityUseCaseBuilder) WithOutputWriter ¶
func (b *ComplexityUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *ComplexityUseCaseBuilder
WithOutputWriter sets the report writer
func (*ComplexityUseCaseBuilder) WithService ¶
func (b *ComplexityUseCaseBuilder) WithService(service domain.ComplexityService) *ComplexityUseCaseBuilder
WithService sets the complexity service
func (*ComplexityUseCaseBuilder) WithSnapshotService ¶ added in v1.30.0
func (b *ComplexityUseCaseBuilder) WithSnapshotService(service ComplexityAnalysisService) *ComplexityUseCaseBuilder
WithSnapshotService sets the complexity collaborator used by aggregate snapshot analysis.
type DIAntipatternSnapshotService ¶ added in v1.30.0
type DIAntipatternSnapshotService interface {
domain.DIAntipatternService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
}
DIAntipatternSnapshotService adds canonical snapshot analysis to the standalone DI contract.
type DIAntipatternUseCase ¶ added in v1.16.0
type DIAntipatternUseCase struct {
// contains filtered or unexported fields
}
DIAntipatternUseCase orchestrates the DI anti-pattern analysis workflow
func NewDIAntipatternUseCase ¶ added in v1.16.0
func NewDIAntipatternUseCase( service domain.DIAntipatternService, fileReader domain.FileReader, formatter domain.DIAntipatternOutputFormatter, configLoader domain.DIAntipatternConfigurationLoader, ) *DIAntipatternUseCase
NewDIAntipatternUseCase creates a new DI anti-pattern use case
func NewSnapshotDIAntipatternUseCase ¶ added in v1.30.0
func NewSnapshotDIAntipatternUseCase(service DIAntipatternSnapshotService, fileReader domain.FileReader, formatter domain.DIAntipatternOutputFormatter, configLoader domain.DIAntipatternConfigurationLoader) *DIAntipatternUseCase
NewSnapshotDIAntipatternUseCase constructs a DI use case for snapshot analysis.
func (*DIAntipatternUseCase) AnalyzeAndReturn ¶ added in v1.16.0
func (uc *DIAntipatternUseCase) AnalyzeAndReturn(ctx context.Context, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
AnalyzeAndReturn performs DI anti-pattern analysis and returns the response without formatting
func (*DIAntipatternUseCase) AnalyzeSnapshotAndReturn ¶ added in v1.30.0
func (uc *DIAntipatternUseCase) AnalyzeSnapshotAndReturn(ctx context.Context, snapshot *svc.ProjectSnapshot, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
AnalyzeSnapshotAndReturn analyzes DI anti-patterns from a canonical project snapshot.
func (*DIAntipatternUseCase) Execute ¶ added in v1.16.0
func (uc *DIAntipatternUseCase) Execute(ctx context.Context, req domain.DIAntipatternRequest) error
Execute performs the complete DI anti-pattern analysis workflow
type DIAntipatternUseCaseBuilder ¶ added in v1.16.0
type DIAntipatternUseCaseBuilder struct {
// contains filtered or unexported fields
}
DIAntipatternUseCaseBuilder provides a builder pattern for creating DIAntipatternUseCase
func NewDIAntipatternUseCaseBuilder ¶ added in v1.16.0
func NewDIAntipatternUseCaseBuilder() *DIAntipatternUseCaseBuilder
NewDIAntipatternUseCaseBuilder creates a new builder
func (*DIAntipatternUseCaseBuilder) Build ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) Build() (*DIAntipatternUseCase, error)
Build creates the DIAntipatternUseCase with the configured dependencies. Optional dependencies (configLoader) are filled with no-op defaults if nil.
func (*DIAntipatternUseCaseBuilder) WithConfigLoader ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) WithConfigLoader(configLoader domain.DIAntipatternConfigurationLoader) *DIAntipatternUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*DIAntipatternUseCaseBuilder) WithFileReader ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *DIAntipatternUseCaseBuilder
WithFileReader sets the file reader
func (*DIAntipatternUseCaseBuilder) WithFormatter ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) WithFormatter(formatter domain.DIAntipatternOutputFormatter) *DIAntipatternUseCaseBuilder
WithFormatter sets the output formatter
func (*DIAntipatternUseCaseBuilder) WithOutputWriter ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *DIAntipatternUseCaseBuilder
WithOutputWriter sets the report writer
func (*DIAntipatternUseCaseBuilder) WithService ¶ added in v1.16.0
func (b *DIAntipatternUseCaseBuilder) WithService(service domain.DIAntipatternService) *DIAntipatternUseCaseBuilder
WithService sets the DI anti-pattern service
type DeadCodeAnalysisService ¶ added in v1.30.0
type DeadCodeAnalysisService interface {
domain.DeadCodeService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
}
DeadCodeAnalysisService adds canonical snapshot analysis to the standalone dead-code contract.
type DeadCodeUseCase ¶
type DeadCodeUseCase struct {
// contains filtered or unexported fields
}
DeadCodeUseCase orchestrates the dead code analysis workflow
func NewDeadCodeUseCase ¶
func NewDeadCodeUseCase( service domain.DeadCodeService, fileReader domain.FileReader, formatter domain.DeadCodeFormatter, configLoader domain.DeadCodeConfigurationLoader, ) *DeadCodeUseCase
NewDeadCodeUseCase creates a new dead code use case
func NewSnapshotDeadCodeUseCase ¶ added in v1.30.0
func NewSnapshotDeadCodeUseCase(service DeadCodeAnalysisService, fileReader domain.FileReader, formatter domain.DeadCodeFormatter, configLoader domain.DeadCodeConfigurationLoader) *DeadCodeUseCase
NewSnapshotDeadCodeUseCase constructs a dead-code use case for aggregate snapshot analysis.
func (*DeadCodeUseCase) AnalyzeAndReturn ¶
func (uc *DeadCodeUseCase) AnalyzeAndReturn(ctx context.Context, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
AnalyzeAndReturn performs dead code analysis and returns the response without formatting
func (*DeadCodeUseCase) AnalyzeFile ¶
func (uc *DeadCodeUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.DeadCodeRequest) error
AnalyzeFile analyzes a single file for dead code
func (*DeadCodeUseCase) AnalyzeFunction ¶
func (uc *DeadCodeUseCase) AnalyzeFunction(ctx context.Context, functionCFG interface{}, req domain.DeadCodeRequest) (*domain.FunctionDeadCode, error)
AnalyzeFunction analyzes a single function for dead code
func (*DeadCodeUseCase) Execute ¶
func (uc *DeadCodeUseCase) Execute(ctx context.Context, req domain.DeadCodeRequest) error
Execute performs the complete dead code analysis workflow
func (*DeadCodeUseCase) ExecuteWithOptions ¶
func (uc *DeadCodeUseCase) ExecuteWithOptions(ctx context.Context, req domain.DeadCodeRequest, options DeadCodeUseCaseOptions) error
ExecuteWithOptions performs dead code analysis with custom options
func (*DeadCodeUseCase) GetSupportedFormats ¶
func (uc *DeadCodeUseCase) GetSupportedFormats() []domain.OutputFormat
GetSupportedFormats returns the list of supported output formats
func (*DeadCodeUseCase) GetSupportedSeverityLevels ¶
func (uc *DeadCodeUseCase) GetSupportedSeverityLevels() []domain.DeadCodeSeverity
GetSupportedSeverityLevels returns the list of supported severity levels
func (*DeadCodeUseCase) GetSupportedSortCriteria ¶
func (uc *DeadCodeUseCase) GetSupportedSortCriteria() []domain.DeadCodeSortCriteria
GetSupportedSortCriteria returns the list of supported sort criteria
func (*DeadCodeUseCase) QuickAnalysis ¶
func (uc *DeadCodeUseCase) QuickAnalysis(ctx context.Context, filePaths []string, outputWriter *os.File) error
QuickAnalysis performs a quick dead code analysis with minimal configuration
func (*DeadCodeUseCase) ValidateConfiguration ¶
func (uc *DeadCodeUseCase) ValidateConfiguration(req domain.DeadCodeRequest) error
ValidateConfiguration validates a dead code configuration
type DeadCodeUseCaseBuilder ¶
type DeadCodeUseCaseBuilder struct {
// contains filtered or unexported fields
}
DeadCodeUseCaseBuilder provides a builder pattern for creating DeadCodeUseCase
func NewDeadCodeUseCaseBuilder ¶
func NewDeadCodeUseCaseBuilder() *DeadCodeUseCaseBuilder
NewDeadCodeUseCaseBuilder creates a new builder
func (*DeadCodeUseCaseBuilder) Build ¶
func (b *DeadCodeUseCaseBuilder) Build() (*DeadCodeUseCase, error)
Build creates the DeadCodeUseCase with the configured dependencies
func (*DeadCodeUseCaseBuilder) BuildWithDefaults ¶
func (b *DeadCodeUseCaseBuilder) BuildWithDefaults() (*DeadCodeUseCase, error)
BuildWithDefaults creates the DeadCodeUseCase with default implementations for optional dependencies
func (*DeadCodeUseCaseBuilder) WithConfigLoader ¶
func (b *DeadCodeUseCaseBuilder) WithConfigLoader(configLoader domain.DeadCodeConfigurationLoader) *DeadCodeUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*DeadCodeUseCaseBuilder) WithFileReader ¶
func (b *DeadCodeUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *DeadCodeUseCaseBuilder
WithFileReader sets the file reader
func (*DeadCodeUseCaseBuilder) WithFormatter ¶
func (b *DeadCodeUseCaseBuilder) WithFormatter(formatter domain.DeadCodeFormatter) *DeadCodeUseCaseBuilder
WithFormatter sets the output formatter
func (*DeadCodeUseCaseBuilder) WithOutputWriter ¶
func (b *DeadCodeUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *DeadCodeUseCaseBuilder
WithOutputWriter sets the report writer
func (*DeadCodeUseCaseBuilder) WithService ¶
func (b *DeadCodeUseCaseBuilder) WithService(service domain.DeadCodeService) *DeadCodeUseCaseBuilder
WithService sets the dead code service
func (*DeadCodeUseCaseBuilder) WithSnapshotService ¶ added in v1.30.0
func (b *DeadCodeUseCaseBuilder) WithSnapshotService(service DeadCodeAnalysisService) *DeadCodeUseCaseBuilder
WithSnapshotService sets the dead-code collaborator used by aggregate snapshot analysis.
type DeadCodeUseCaseOptions ¶
type DeadCodeUseCaseOptions struct {
EnableProgress bool
ProgressInterval time.Duration
MaxConcurrency int
TimeoutPerFile time.Duration
ShowContext bool
ContextLines int
}
DeadCodeUseCaseOptions provides configuration options for the dead code use case
func DefaultDeadCodeUseCaseOptions ¶
func DefaultDeadCodeUseCaseOptions() DeadCodeUseCaseOptions
DefaultDeadCodeUseCaseOptions returns default options
type LCOMAnalysisService ¶ added in v1.30.0
type LCOMAnalysisService interface {
domain.LCOMService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.LCOMRequest) (*domain.LCOMResponse, error)
}
LCOMAnalysisService adds canonical snapshot analysis to the standalone LCOM contract.
type LCOMUseCase ¶ added in v1.11.0
type LCOMUseCase struct {
// contains filtered or unexported fields
}
LCOMUseCase orchestrates the LCOM analysis workflow
func NewLCOMUseCase ¶ added in v1.11.0
func NewLCOMUseCase( service domain.LCOMService, fileReader domain.FileReader, formatter domain.LCOMOutputFormatter, configLoader domain.LCOMConfigurationLoader, ) *LCOMUseCase
NewLCOMUseCase creates a new LCOM use case
func NewSnapshotLCOMUseCase ¶ added in v1.30.0
func NewSnapshotLCOMUseCase(service LCOMAnalysisService, fileReader domain.FileReader, formatter domain.LCOMOutputFormatter, configLoader domain.LCOMConfigurationLoader) *LCOMUseCase
NewSnapshotLCOMUseCase constructs an LCOM use case for aggregate snapshot analysis.
func (*LCOMUseCase) AnalyzeAndReturn ¶ added in v1.11.0
func (uc *LCOMUseCase) AnalyzeAndReturn(ctx context.Context, req domain.LCOMRequest) (*domain.LCOMResponse, error)
AnalyzeAndReturn performs LCOM analysis and returns the response without formatting
func (*LCOMUseCase) Execute ¶ added in v1.11.0
func (uc *LCOMUseCase) Execute(ctx context.Context, req domain.LCOMRequest) error
Execute performs the complete LCOM analysis workflow
type LCOMUseCaseBuilder ¶ added in v1.11.0
type LCOMUseCaseBuilder struct {
// contains filtered or unexported fields
}
LCOMUseCaseBuilder provides a builder pattern for creating LCOMUseCase
func NewLCOMUseCaseBuilder ¶ added in v1.11.0
func NewLCOMUseCaseBuilder() *LCOMUseCaseBuilder
NewLCOMUseCaseBuilder creates a new builder
func (*LCOMUseCaseBuilder) Build ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) Build() (*LCOMUseCase, error)
Build creates the LCOMUseCase with the configured dependencies
func (*LCOMUseCaseBuilder) WithConfigLoader ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) WithConfigLoader(configLoader domain.LCOMConfigurationLoader) *LCOMUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*LCOMUseCaseBuilder) WithFileReader ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *LCOMUseCaseBuilder
WithFileReader sets the file reader
func (*LCOMUseCaseBuilder) WithFormatter ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) WithFormatter(formatter domain.LCOMOutputFormatter) *LCOMUseCaseBuilder
WithFormatter sets the output formatter
func (*LCOMUseCaseBuilder) WithOutputWriter ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *LCOMUseCaseBuilder
WithOutputWriter sets the report writer
func (*LCOMUseCaseBuilder) WithService ¶ added in v1.11.0
func (b *LCOMUseCaseBuilder) WithService(service domain.LCOMService) *LCOMUseCaseBuilder
WithService sets the LCOM service
func (*LCOMUseCaseBuilder) WithSnapshotService ¶ added in v1.30.0
func (b *LCOMUseCaseBuilder) WithSnapshotService(service LCOMAnalysisService) *LCOMUseCaseBuilder
WithSnapshotService sets the LCOM collaborator used by aggregate snapshot analysis.
type MockDataSnapshotService ¶ added in v1.30.0
type MockDataSnapshotService interface {
domain.MockDataService
AnalyzeSnapshot(context.Context, *svc.ProjectSnapshot, domain.MockDataRequest) (*domain.MockDataResponse, error)
}
MockDataSnapshotService adds canonical snapshot analysis to the standalone mock-data contract.
type MockDataUseCase ¶ added in v1.7.0
type MockDataUseCase struct {
// contains filtered or unexported fields
}
MockDataUseCase orchestrates the mock data analysis workflow
func NewMockDataUseCase ¶ added in v1.7.0
func NewMockDataUseCase( service domain.MockDataService, fileReader domain.FileReader, formatter domain.MockDataFormatter, configLoader domain.MockDataConfigurationLoader, ) *MockDataUseCase
NewMockDataUseCase creates a new mock data use case
func NewSnapshotMockDataUseCase ¶ added in v1.30.0
func NewSnapshotMockDataUseCase(service MockDataSnapshotService, fileReader domain.FileReader, formatter domain.MockDataFormatter, configLoader domain.MockDataConfigurationLoader) *MockDataUseCase
NewSnapshotMockDataUseCase constructs a mock-data use case for snapshot analysis.
func (*MockDataUseCase) AnalyzeAndReturn ¶ added in v1.7.0
func (uc *MockDataUseCase) AnalyzeAndReturn(ctx context.Context, req domain.MockDataRequest) (*domain.MockDataResponse, error)
AnalyzeAndReturn performs mock data analysis and returns the response without formatting
func (*MockDataUseCase) AnalyzeFile ¶ added in v1.7.0
func (uc *MockDataUseCase) AnalyzeFile(ctx context.Context, filePath string, req domain.MockDataRequest) error
AnalyzeFile analyzes a single file for mock data
func (*MockDataUseCase) AnalyzeSnapshotAndReturn ¶ added in v1.30.0
func (uc *MockDataUseCase) AnalyzeSnapshotAndReturn(ctx context.Context, snapshot *svc.ProjectSnapshot, req domain.MockDataRequest) (*domain.MockDataResponse, error)
AnalyzeSnapshotAndReturn analyzes mock data from a canonical project snapshot.
func (*MockDataUseCase) Execute ¶ added in v1.7.0
func (uc *MockDataUseCase) Execute(ctx context.Context, req domain.MockDataRequest) error
Execute performs the complete mock data analysis workflow
type MockDataUseCaseBuilder ¶ added in v1.7.0
type MockDataUseCaseBuilder struct {
// contains filtered or unexported fields
}
MockDataUseCaseBuilder provides a builder pattern for constructing MockDataUseCase
func NewMockDataUseCaseBuilder ¶ added in v1.7.0
func NewMockDataUseCaseBuilder() *MockDataUseCaseBuilder
NewMockDataUseCaseBuilder creates a new builder
func (*MockDataUseCaseBuilder) Build ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) Build() (*MockDataUseCase, error)
Build creates the MockDataUseCase with validation
func (*MockDataUseCaseBuilder) BuildWithDefaults ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) BuildWithDefaults() (*MockDataUseCase, error)
BuildWithDefaults creates the MockDataUseCase with default implementations
func (*MockDataUseCaseBuilder) WithConfigLoader ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) WithConfigLoader(configLoader domain.MockDataConfigurationLoader) *MockDataUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*MockDataUseCaseBuilder) WithFileReader ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *MockDataUseCaseBuilder
WithFileReader sets the file reader
func (*MockDataUseCaseBuilder) WithFormatter ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) WithFormatter(formatter domain.MockDataFormatter) *MockDataUseCaseBuilder
WithFormatter sets the output formatter
func (*MockDataUseCaseBuilder) WithOutput ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) WithOutput(output domain.ReportWriter) *MockDataUseCaseBuilder
WithOutput sets the report writer
func (*MockDataUseCaseBuilder) WithService ¶ added in v1.7.0
func (b *MockDataUseCaseBuilder) WithService(service domain.MockDataService) *MockDataUseCaseBuilder
WithService sets the mock data service
type ProjectAnalysisResult ¶ added in v1.30.0
type ProjectAnalysisResult struct {
Response *domain.AnalyzeResponse
Snapshot *service.ProjectSnapshot
}
ProjectAnalysisResult owns the canonical snapshot and the analyses derived from it for callers that need to run additional snapshot-aware policies.
type SystemAnalysisService ¶ added in v1.30.0
type SystemAnalysisService interface {
domain.SystemAnalysisService
AnalyzeGraph(context.Context, *svc.ProjectModuleGraph, domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
}
SystemAnalysisService is the complete service contract required by the system use case, including snapshot-backed graph analysis.
type SystemAnalysisUseCase ¶
type SystemAnalysisUseCase struct {
// contains filtered or unexported fields
}
SystemAnalysisUseCase orchestrates the system analysis workflow
func NewGraphSystemAnalysisUseCase ¶ added in v1.30.0
func NewGraphSystemAnalysisUseCase(service SystemAnalysisService, fileReader domain.FileReader, formatter domain.SystemAnalysisOutputFormatter, configLoader domain.SystemAnalysisConfigurationLoader) *SystemAnalysisUseCase
NewGraphSystemAnalysisUseCase constructs a system use case for aggregate graph analysis.
func NewSystemAnalysisUseCase ¶
func NewSystemAnalysisUseCase( service domain.SystemAnalysisService, fileReader domain.FileReader, formatter domain.SystemAnalysisOutputFormatter, configLoader domain.SystemAnalysisConfigurationLoader, ) *SystemAnalysisUseCase
NewSystemAnalysisUseCase creates a new system analysis use case
func (*SystemAnalysisUseCase) AnalyzeAndReturn ¶
func (uc *SystemAnalysisUseCase) AnalyzeAndReturn(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
AnalyzeAndReturn performs system analysis and returns the response without formatting
func (*SystemAnalysisUseCase) AnalyzeArchitectureOnly ¶
func (uc *SystemAnalysisUseCase) AnalyzeArchitectureOnly(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.ArchitectureAnalysisResult, error)
AnalyzeArchitectureOnly performs architecture analysis only
func (*SystemAnalysisUseCase) AnalyzeDependenciesOnly ¶
func (uc *SystemAnalysisUseCase) AnalyzeDependenciesOnly(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.DependencyAnalysisResult, error)
AnalyzeDependenciesOnly performs dependency analysis only
func (*SystemAnalysisUseCase) Execute ¶
func (uc *SystemAnalysisUseCase) Execute(ctx context.Context, req domain.SystemAnalysisRequest) error
Execute performs the complete system analysis workflow
type SystemAnalysisUseCaseBuilder ¶
type SystemAnalysisUseCaseBuilder struct {
// contains filtered or unexported fields
}
SystemAnalysisUseCaseBuilder provides a builder pattern for creating SystemAnalysisUseCase
func NewSystemAnalysisUseCaseBuilder ¶
func NewSystemAnalysisUseCaseBuilder() *SystemAnalysisUseCaseBuilder
NewSystemAnalysisUseCaseBuilder creates a new builder
func (*SystemAnalysisUseCaseBuilder) Build ¶
func (b *SystemAnalysisUseCaseBuilder) Build() (*SystemAnalysisUseCase, error)
Build creates the SystemAnalysisUseCase with the configured dependencies
func (*SystemAnalysisUseCaseBuilder) BuildWithDefaults ¶
func (b *SystemAnalysisUseCaseBuilder) BuildWithDefaults() (*SystemAnalysisUseCase, error)
BuildWithDefaults creates the SystemAnalysisUseCase with default implementations for optional dependencies
func (*SystemAnalysisUseCaseBuilder) WithConfigLoader ¶
func (b *SystemAnalysisUseCaseBuilder) WithConfigLoader(configLoader domain.SystemAnalysisConfigurationLoader) *SystemAnalysisUseCaseBuilder
WithConfigLoader sets the configuration loader
func (*SystemAnalysisUseCaseBuilder) WithFileReader ¶
func (b *SystemAnalysisUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *SystemAnalysisUseCaseBuilder
WithFileReader sets the file reader
func (*SystemAnalysisUseCaseBuilder) WithFormatter ¶
func (b *SystemAnalysisUseCaseBuilder) WithFormatter(formatter domain.SystemAnalysisOutputFormatter) *SystemAnalysisUseCaseBuilder
WithFormatter sets the output formatter
func (*SystemAnalysisUseCaseBuilder) WithGraphService ¶ added in v1.30.0
func (b *SystemAnalysisUseCaseBuilder) WithGraphService(service SystemAnalysisService) *SystemAnalysisUseCaseBuilder
WithGraphService sets the system collaborator used by aggregate graph analysis.
func (*SystemAnalysisUseCaseBuilder) WithOutputWriter ¶
func (b *SystemAnalysisUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *SystemAnalysisUseCaseBuilder
WithOutputWriter sets the report writer
func (*SystemAnalysisUseCaseBuilder) WithService ¶
func (b *SystemAnalysisUseCaseBuilder) WithService(service domain.SystemAnalysisService) *SystemAnalysisUseCaseBuilder
WithService sets the system analysis service
type UseCaseOptions ¶
type UseCaseOptions struct {
EnableProgress bool
ProgressInterval time.Duration
MaxConcurrency int
TimeoutPerFile time.Duration
}
UseCaseOptions provides configuration options for the use case
func DefaultUseCaseOptions ¶
func DefaultUseCaseOptions() UseCaseOptions
DefaultUseCaseOptions returns default options
Source Files
¶
- analysis_paths.go
- analysis_progress.go
- analyze_selection.go
- analyze_usecase.go
- cbo_usecase.go
- clone_usecase.go
- community_usecase.go
- complexity_usecase.go
- dead_code_usecase.go
- di_antipattern_usecase.go
- directory_complexity.go
- file_resolution_helper.go
- lcom_usecase.go
- mock_data_usecase.go
- module_quality.go
- system_analysis_usecase.go