app

package
v1.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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

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

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

WithErrorCategorizer sets the error categorizer

func (*AnalyzeUseCaseBuilder) WithFileReader

WithFileReader sets the file reader

func (*AnalyzeUseCaseBuilder) WithFormatter

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

WithParallelExecutor sets the parallel executor

func (*AnalyzeUseCaseBuilder) WithProgressManager

WithProgressManager sets the progress manager

func (*AnalyzeUseCaseBuilder) WithSystemUseCase

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

WithFormatter sets the output formatter

func (*CloneUseCaseBuilder) WithOutputWriter

func (b *CloneUseCaseBuilder) WithOutputWriter(output domain.ReportWriter) *CloneUseCaseBuilder

WithOutputWriter sets the report writer

func (*CloneUseCaseBuilder) WithService

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

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

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

AnalyzeAndReturn performs community analysis and returns the response without formatting.

func (*CommunityUseCase) Execute added in v1.25.0

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 (*CommunityUseCaseBuilder) WithConfigLoader added in v1.25.0

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 (*CommunityUseCaseBuilder) WithGraphService added in v1.30.0

WithGraphService sets the community collaborator used by aggregate graph analysis.

func (*CommunityUseCaseBuilder) WithOutputWriter added in v1.25.0

func (*CommunityUseCaseBuilder) WithService added in v1.25.0

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

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

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

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

WithConfigLoader sets the configuration loader

func (*ComplexityUseCaseBuilder) WithFileReader

func (b *ComplexityUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *ComplexityUseCaseBuilder

WithFileReader sets the file reader

func (*ComplexityUseCaseBuilder) WithFormatter

WithFormatter sets the output formatter

func (*ComplexityUseCaseBuilder) WithOutputWriter

WithOutputWriter sets the report writer

func (*ComplexityUseCaseBuilder) WithService

WithService sets the complexity service

func (*ComplexityUseCaseBuilder) WithSnapshotService added in v1.30.0

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

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

AnalyzeAndReturn performs DI anti-pattern analysis and returns the response without formatting

func (*DIAntipatternUseCase) AnalyzeSnapshotAndReturn added in v1.30.0

AnalyzeSnapshotAndReturn analyzes DI anti-patterns from a canonical project snapshot.

func (*DIAntipatternUseCase) Execute added in v1.16.0

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

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

WithConfigLoader sets the configuration loader

func (*DIAntipatternUseCaseBuilder) WithFileReader added in v1.16.0

WithFileReader sets the file reader

func (*DIAntipatternUseCaseBuilder) WithFormatter added in v1.16.0

WithFormatter sets the output formatter

func (*DIAntipatternUseCaseBuilder) WithOutputWriter added in v1.16.0

WithOutputWriter sets the report writer

func (*DIAntipatternUseCaseBuilder) WithService added in v1.16.0

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

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

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

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

WithConfigLoader sets the configuration loader

func (*DeadCodeUseCaseBuilder) WithFileReader

func (b *DeadCodeUseCaseBuilder) WithFileReader(fileReader domain.FileReader) *DeadCodeUseCaseBuilder

WithFileReader sets the file reader

func (*DeadCodeUseCaseBuilder) WithFormatter

WithFormatter sets the output formatter

func (*DeadCodeUseCaseBuilder) WithOutputWriter

WithOutputWriter sets the report writer

func (*DeadCodeUseCaseBuilder) WithService

WithService sets the dead code service

func (*DeadCodeUseCaseBuilder) WithSnapshotService added in v1.30.0

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

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

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

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

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

WithFormatter sets the output formatter

func (*MockDataUseCaseBuilder) WithOutput added in v1.7.0

WithOutput sets the report writer

func (*MockDataUseCaseBuilder) WithService added in v1.7.0

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

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

NewSystemAnalysisUseCase creates a new system analysis use case

func (*SystemAnalysisUseCase) AnalyzeAndReturn

AnalyzeAndReturn performs system analysis and returns the response without formatting

func (*SystemAnalysisUseCase) AnalyzeArchitectureOnly

AnalyzeArchitectureOnly performs architecture analysis only

func (*SystemAnalysisUseCase) AnalyzeDependenciesOnly

AnalyzeDependenciesOnly performs dependency analysis only

func (*SystemAnalysisUseCase) Execute

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

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

WithConfigLoader sets the configuration loader

func (*SystemAnalysisUseCaseBuilder) WithFileReader

WithFileReader sets the file reader

func (*SystemAnalysisUseCaseBuilder) WithFormatter

WithFormatter sets the output formatter

func (*SystemAnalysisUseCaseBuilder) WithGraphService added in v1.30.0

WithGraphService sets the system collaborator used by aggregate graph analysis.

func (*SystemAnalysisUseCaseBuilder) WithOutputWriter

WithOutputWriter sets the report writer

func (*SystemAnalysisUseCaseBuilder) WithService

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

Jump to

Keyboard shortcuts

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