Documentation
¶
Index ¶
- Constants
- Variables
- func ArchitectureRulesFromPyscnConfig(cfg *config.PyscnConfig) *domain.ArchitectureRules
- func BuildCommunityGraphData(response *domain.CommunityAnalysisResult, threshold int) communityGraphData
- func EncodeJSON(v interface{}) (string, error)
- func EncodeYAML(v interface{}) (string, error)
- func EscapeHTML(value string) string
- func EscapeHTMLSlice(values []string) []string
- func FindProjectRoot(paths []string) string
- func GenerateHTMLFooter() string
- func GenerateMetricCard(value, label string) string
- func GenerateSectionHeader(title string) string
- func GenerateSinglePageContent(content string) string
- func GenerateStarLink() string
- func GenerateStatusBadge(text, severity string) string
- func GenerateTabButton(id, label string, active bool) string
- func GenerateTabContent(id string, active bool, content string) string
- func GenerateTabScript() string
- func GenerateTabsEnd() string
- func GenerateTabsMiddle() string
- func GenerateTabsStart() string
- func HasExplicitArchitectureConfig(rules *domain.ArchitectureRules) bool
- func IsInteractiveEnvironment() bool
- func IsSSH() bool
- func JoinEscapedHTML(values []string, separator string) string
- func LoadAnalysisTimingFactors() map[domain.AnalysisKind]float64
- func NewErrorCategorizer() domain.ErrorCategorizer
- func NewParallelExecutor() domain.ParallelExecutor
- func NewProgressManager() domain.ProgressManager
- func NewSimpleTask(name string, enabled bool, execute func(context.Context) (interface{}, error)) domain.ExecutableTask
- func OpenBrowser(url string) error
- func SafeHTMLID(value string) string
- func UpdateAnalysisTimingFactors(estimatedSeconds, actualSeconds map[domain.AnalysisKind]float64)
- func WriteCommunityHTMLSummary(builder *strings.Builder, response *domain.CommunityAnalysisResult)
- func WriteCommunityTextSummary(writer io.Writer, response *domain.CommunityAnalysisResult)
- func WriteJSON(w io.Writer, v interface{}) error
- func WriteYAML(w io.Writer, v interface{}) error
- type AnalyzeConfigurationLoaderImpl
- type AnalyzeFormatter
- type CBOConfigurationLoaderImpl
- func (cl *CBOConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *CBOConfigurationLoaderImpl) LoadConfig(path string) (*domain.CBORequest, error)
- func (cl *CBOConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.CBORequest
- func (cl *CBOConfigurationLoaderImpl) MergeConfig(base *domain.CBORequest, override *domain.CBORequest) *domain.CBORequest
- type CBOFormatterImpl
- type CBOServiceImpl
- func (s *CBOServiceImpl) Analyze(ctx context.Context, req domain.CBORequest) (*domain.CBOResponse, error)
- func (s *CBOServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.CBORequest) (*domain.CBOResponse, error)
- func (s *CBOServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.CBORequest) (*domain.CBOResponse, error)
- type CloneConfigurationLoader
- func (c *CloneConfigurationLoader) FindDefaultConfigFile(targetPath string) string
- func (c *CloneConfigurationLoader) GetDefaultCloneConfig(targetPath string) *domain.CloneRequest
- func (c *CloneConfigurationLoader) LoadCloneConfig(configPath string) (*domain.CloneRequest, error)
- func (c *CloneConfigurationLoader) MergeConfig(base *domain.CloneRequest, override *domain.CloneRequest) *domain.CloneRequest
- func (c *CloneConfigurationLoader) SaveCloneConfig(cloneConfig *domain.CloneRequest, configPath string) error
- type CloneHTMLData
- type CloneOutputFormatter
- type CloneService
- func (s *CloneService) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req *domain.CloneRequest) (*domain.CloneResponse, error)
- func (s *CloneService) ComputeSimilarity(ctx context.Context, fragment1, fragment2 string) (float64, error)
- func (s *CloneService) DetectClones(ctx context.Context, req *domain.CloneRequest) (*domain.CloneResponse, error)
- func (s *CloneService) DetectClonesInFiles(ctx context.Context, filePaths []string, req *domain.CloneRequest) (*domain.CloneResponse, error)
- type CommunityAnalysisServiceImpl
- type CommunityConfigurationLoaderImpl
- func (cl *CommunityConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *CommunityConfigurationLoaderImpl) LoadConfig(path string) (*domain.CommunityAnalysisRequest, error)
- func (cl *CommunityConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.CommunityAnalysisRequest
- func (cl *CommunityConfigurationLoaderImpl) MergeConfig(base *domain.CommunityAnalysisRequest, ...) *domain.CommunityAnalysisRequest
- type CommunityFormatter
- type ComplexityHTMLData
- type ComplexityServiceImpl
- func (s *ComplexityServiceImpl) Analyze(ctx context.Context, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
- func (s *ComplexityServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
- func (s *ComplexityServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
- type ConfigurationLoaderImpl
- func (c *ConfigurationLoaderImpl) CreateConfigTemplate(path string) error
- func (c *ConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (c *ConfigurationLoaderImpl) GetDefaultThresholds() (low, medium int)
- func (c *ConfigurationLoaderImpl) LoadConfig(path string) (*domain.ComplexityRequest, error)
- func (c *ConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.ComplexityRequest
- func (c *ConfigurationLoaderImpl) MergeConfig(base *domain.ComplexityRequest, override *domain.ComplexityRequest) *domain.ComplexityRequest
- func (c *ConfigurationLoaderImpl) ValidateConfig(req *domain.ComplexityRequest) error
- type DIAntipatternConfigurationLoaderImpl
- func (cl *DIAntipatternConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *DIAntipatternConfigurationLoaderImpl) LoadConfig(path string) (*domain.DIAntipatternRequest, error)
- func (cl *DIAntipatternConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.DIAntipatternRequest
- func (cl *DIAntipatternConfigurationLoaderImpl) MergeConfig(base *domain.DIAntipatternRequest, override *domain.DIAntipatternRequest) *domain.DIAntipatternRequest
- type DIAntipatternFormatter
- type DIAntipatternServiceImpl
- func (s *DIAntipatternServiceImpl) Analyze(ctx context.Context, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
- func (s *DIAntipatternServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
- func (s *DIAntipatternServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, ...) (*domain.DIAntipatternResponse, error)
- type DeadCodeConfigurationLoaderImpl
- func (cl *DeadCodeConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *DeadCodeConfigurationLoaderImpl) LoadConfig(path string) (*domain.DeadCodeRequest, error)
- func (cl *DeadCodeConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.DeadCodeRequest
- func (cl *DeadCodeConfigurationLoaderImpl) MergeConfig(base *domain.DeadCodeRequest, override *domain.DeadCodeRequest) *domain.DeadCodeRequest
- func (cl *DeadCodeConfigurationLoaderImpl) SaveConfig(req *domain.DeadCodeRequest, path string) error
- func (cl *DeadCodeConfigurationLoaderImpl) ValidateConfig(req *domain.DeadCodeRequest) error
- type DeadCodeFormatterImpl
- func (f *DeadCodeFormatterImpl) Format(response *domain.DeadCodeResponse, format domain.OutputFormat) (string, error)
- func (f *DeadCodeFormatterImpl) FormatFinding(finding domain.DeadCodeFinding, format domain.OutputFormat) (string, error)
- func (f *DeadCodeFormatterImpl) Write(response *domain.DeadCodeResponse, format domain.OutputFormat, ...) error
- type DeadCodeHTMLData
- type DeadCodeServiceImpl
- func (s *DeadCodeServiceImpl) Analyze(ctx context.Context, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
- func (s *DeadCodeServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.DeadCodeRequest) (*domain.FileDeadCode, error)
- func (s *DeadCodeServiceImpl) AnalyzeFunction(ctx context.Context, functionCFG interface{}, req domain.DeadCodeRequest) (*domain.FunctionDeadCode, error)
- func (s *DeadCodeServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
- type ErrorCategorizerImpl
- type FileOutputWriter
- type FileReaderImpl
- func (f *FileReaderImpl) CollectPythonFiles(paths []string, recursive bool, includePatterns, excludePatterns []string) ([]string, error)
- func (f *FileReaderImpl) FileExists(path string) (bool, error)
- func (f *FileReaderImpl) GetFileInfo(path string) (os.FileInfo, error)
- func (f *FileReaderImpl) IsValidPythonFile(path string) bool
- func (f *FileReaderImpl) ReadFile(path string) ([]byte, error)
- func (f *FileReaderImpl) ValidatePaths(paths []string) error
- type FormatUtils
- func (f *FormatUtils) ConvertToStandardRisk(risk string) RiskLevel
- func (f *FormatUtils) FormatDuration(durationMs int64) string
- func (f *FormatUtils) FormatFileStats(analyzed, total, skipped int) string
- func (f *FormatUtils) FormatLabel(label string, value interface{}) string
- func (f *FormatUtils) FormatLabelWithIndent(indent int, label string, value interface{}) string
- func (f *FormatUtils) FormatMainHeader(title string) string
- func (f *FormatUtils) FormatPercentage(value float64) string
- func (f *FormatUtils) FormatRiskDistribution(high, medium, low int) string
- func (f *FormatUtils) FormatRiskWithColor(risk RiskLevel) string
- func (f *FormatUtils) FormatSectionHeader(title string) string
- func (f *FormatUtils) FormatSectionSeparator() string
- func (f *FormatUtils) FormatSummaryStats(stats map[string]interface{}) string
- func (f *FormatUtils) FormatTableHeader(columns ...string) string
- func (f *FormatUtils) FormatWarningsSection(warnings []string) string
- func (f *FormatUtils) GetRiskColor(risk RiskLevel) string
- type HTMLFormatterImpl
- func (f *HTMLFormatterImpl) CalculateCloneScore(response *domain.CloneResponse) ScoreData
- func (f *HTMLFormatterImpl) CalculateComplexityScore(response *domain.ComplexityResponse) ScoreData
- func (f *HTMLFormatterImpl) CalculateDeadCodeScore(response *domain.DeadCodeResponse) ScoreData
- func (f *HTMLFormatterImpl) CalculateOverallScore(scores []ScoreData, projectName string) OverallScoreData
- func (f *HTMLFormatterImpl) FormatCloneAsHTML(response *domain.CloneResponse, projectName string) (string, error)
- func (f *HTMLFormatterImpl) FormatComplexityAsHTML(response *domain.ComplexityResponse, projectName string) (string, error)
- func (f *HTMLFormatterImpl) FormatDeadCodeAsHTML(response *domain.DeadCodeResponse, projectName string) (string, error)
- type HTMLTemplate
- type LCOMConfigurationLoaderImpl
- func (cl *LCOMConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *LCOMConfigurationLoaderImpl) LoadConfig(path string) (*domain.LCOMRequest, error)
- func (cl *LCOMConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.LCOMRequest
- func (cl *LCOMConfigurationLoaderImpl) MergeConfig(base *domain.LCOMRequest, override *domain.LCOMRequest) *domain.LCOMRequest
- type LCOMFormatterImpl
- type LCOMServiceImpl
- func (s *LCOMServiceImpl) Analyze(ctx context.Context, req domain.LCOMRequest) (*domain.LCOMResponse, error)
- func (s *LCOMServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.LCOMRequest) (*domain.LCOMResponse, error)
- func (s *LCOMServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.LCOMRequest) (*domain.LCOMResponse, error)
- type MockDataConfigurationLoaderImpl
- func (cl *MockDataConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
- func (cl *MockDataConfigurationLoaderImpl) LoadConfig(path string) (*domain.MockDataRequest, error)
- func (cl *MockDataConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.MockDataRequest
- func (cl *MockDataConfigurationLoaderImpl) MergeConfig(base *domain.MockDataRequest, override *domain.MockDataRequest) *domain.MockDataRequest
- type MockDataFormatterImpl
- type MockDataServiceImpl
- func (s *MockDataServiceImpl) Analyze(ctx context.Context, req domain.MockDataRequest) (*domain.MockDataResponse, error)
- func (s *MockDataServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.MockDataRequest) (*domain.FileMockData, error)
- func (s *MockDataServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.MockDataRequest) (*domain.MockDataResponse, error)
- type OutputFormatResolver
- type OutputFormatterImpl
- func (f *OutputFormatterImpl) Format(response *domain.ComplexityResponse, format domain.OutputFormat) (string, error)
- func (f *OutputFormatterImpl) FormatSummaryOnly(response *domain.ComplexityResponse, format domain.OutputFormat) (string, error)
- func (f *OutputFormatterImpl) Write(response *domain.ComplexityResponse, format domain.OutputFormat, ...) error
- type OverallScoreData
- type ParallelExecutorImpl
- type ProgressManagerImpl
- func (pm *ProgressManagerImpl) Close()
- func (pm *ProgressManagerImpl) Complete(success bool)
- func (pm *ProgressManagerImpl) Initialize(maxValue int)
- func (pm *ProgressManagerImpl) IsInteractive() bool
- func (pm *ProgressManagerImpl) SetWriter(writer io.Writer)
- func (pm *ProgressManagerImpl) Start()
- func (pm *ProgressManagerImpl) Update(processed, total int)
- type ProjectFile
- type ProjectModuleGraph
- type ProjectSnapshot
- func BuildAnalysisProjectSnapshot(ctx context.Context, analysisPaths, modulePaths []string, ...) *ProjectSnapshot
- func BuildProjectSnapshot(ctx context.Context, paths []string) *ProjectSnapshot
- func BuildProjectSnapshotWithOptions(ctx context.Context, paths []string, options ProjectSnapshotOptions) *ProjectSnapshot
- func (s *ProjectSnapshot) BuildDependencyGraph(ctx context.Context, graphOptions *domain.ModuleGraphOptions) (*ProjectModuleGraph, error)
- func (s *ProjectSnapshot) Coverage() domain.AnalysisCoverage
- func (s *ProjectSnapshot) FileProjections() []*ProjectFile
- func (s *ProjectSnapshot) ModuleCoverage() domain.AnalysisCoverage
- func (s *ProjectSnapshot) Paths() []string
- type ProjectSnapshotOptions
- type RiskLevel
- type ScoreData
- type SimpleTask
- type SystemAnalysisConfigurationLoaderImpl
- func (cl *SystemAnalysisConfigurationLoaderImpl) LoadConfig(path string) (*domain.SystemAnalysisRequest, error)
- func (cl *SystemAnalysisConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.SystemAnalysisRequest
- func (cl *SystemAnalysisConfigurationLoaderImpl) MergeConfig(base *domain.SystemAnalysisRequest, override *domain.SystemAnalysisRequest) *domain.SystemAnalysisRequest
- type SystemAnalysisConfigurationLoaderWithFlags
- type SystemAnalysisFormatterImpl
- type SystemAnalysisServiceImpl
- func (s *SystemAnalysisServiceImpl) Analyze(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
- func (s *SystemAnalysisServiceImpl) AnalyzeArchitecture(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.ArchitectureAnalysisResult, error)
- func (s *SystemAnalysisServiceImpl) AnalyzeDependencies(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.DependencyAnalysisResult, error)
- func (s *SystemAnalysisServiceImpl) AnalyzeGraph(ctx context.Context, projectGraph *ProjectModuleGraph, ...) (*domain.SystemAnalysisResponse, error)
- func (s *SystemAnalysisServiceImpl) BuildModuleLayerMap(graph *analyzer.DependencyGraph, rules *domain.ArchitectureRules) map[string]string
- func (s *SystemAnalysisServiceImpl) ResolveArchitectureRules(graph *analyzer.DependencyGraph, rules *domain.ArchitectureRules) *domain.ArchitectureRules
Constants ¶
const ( HeaderWidth = 40 LabelWidth = 25 SectionPadding = 2 ItemPadding = 4 )
Standard formatting constants
const ( ColorReset = "\x1b[0m" ColorRed = "\x1b[31m" ColorYellow = "\x1b[33m" ColorGreen = "\x1b[32m" ColorCyan = "\x1b[36m" ColorBold = "\x1b[1m" )
ANSI color codes for consistent color usage
const RepositoryURL = "https://github.com/ludo-technologies/pyscn"
RepositoryURL is the canonical GitHub repository for pyscn. Reports and CLI output link here so users who only ever run the tool can still find the project.
Variables ¶
var ExampleSystemAnalysisConfig = `` /* 414-byte string literal not displayed */
Example configuration file content for documentation
Functions ¶
func ArchitectureRulesFromPyscnConfig ¶ added in v1.25.0
func ArchitectureRulesFromPyscnConfig(cfg *config.PyscnConfig) *domain.ArchitectureRules
ArchitectureRulesFromPyscnConfig extracts explicit architecture rules from pyscn config.
func BuildCommunityGraphData ¶ added in v1.25.0
func BuildCommunityGraphData(response *domain.CommunityAnalysisResult, threshold int) communityGraphData
BuildCommunityGraphData converts a community analysis result into the compact graph payload used by the HTML visualization. When the module count exceeds threshold, the graph collapses to one node per community so the layout stays responsive. A threshold <= 0 falls back to communityGraphNodeThreshold.
func EncodeJSON ¶
EncodeJSON returns an indented JSON string for the given value.
func EncodeYAML ¶
EncodeYAML returns a YAML string for the given value.
func EscapeHTML ¶ added in v1.22.5
func EscapeHTMLSlice ¶ added in v1.22.5
func FindProjectRoot ¶ added in v1.25.0
FindProjectRoot locates the project root from the given paths by finding their discovered config file first, then falling back to the common parent and standard Python project markers.
func GenerateHTMLFooter ¶
func GenerateHTMLFooter() string
GenerateHTMLFooter generates the standard HTML footer
func GenerateMetricCard ¶
GenerateMetricCard generates a metric card HTML
func GenerateSectionHeader ¶
GenerateSectionHeader generates a section header
func GenerateSinglePageContent ¶
GenerateSinglePageContent generates a single page content wrapper (no tabs)
func GenerateStarLink ¶ added in v1.27.0
func GenerateStarLink() string
GenerateStarLink renders the GitHub call-to-action shown in report footers. It is a plain link rather than a remote badge image so reports stay self-contained and do not phone home when opened.
func GenerateStatusBadge ¶
GenerateStatusBadge generates a status badge based on severity
func GenerateTabButton ¶
GenerateTabButton generates a tab button
func GenerateTabContent ¶
GenerateTabContent generates a tab content wrapper
func GenerateTabScript ¶
func GenerateTabScript() string
GenerateTabScript generates the JavaScript for tab switching
func GenerateTabsEnd ¶
func GenerateTabsEnd() string
GenerateTabsEnd generates the end of a tabbed interface
func GenerateTabsMiddle ¶
func GenerateTabsMiddle() string
GenerateTabsMiddle generates the middle section between tab buttons and content
func GenerateTabsStart ¶
func GenerateTabsStart() string
GenerateTabsStart generates the start of a tabbed interface
func HasExplicitArchitectureConfig ¶ added in v1.25.0
func HasExplicitArchitectureConfig(rules *domain.ArchitectureRules) bool
HasExplicitArchitectureConfig reports whether architecture rules were configured by the user.
func IsInteractiveEnvironment ¶ added in v1.1.0
func IsInteractiveEnvironment() bool
IsInteractiveEnvironment returns true if the environment appears to be an interactive TTY session (and not CI)
func IsSSH ¶ added in v1.1.0
func IsSSH() bool
IsSSH returns true if the session is running over SSH
func JoinEscapedHTML ¶ added in v1.22.5
func LoadAnalysisTimingFactors ¶ added in v1.24.1
func LoadAnalysisTimingFactors() map[domain.AnalysisKind]float64
LoadAnalysisTimingFactors returns calibration factors recorded by previous runs on this project. Returns an empty map when no usable cache exists. Disabled under `go test` so test runs neither read nor pollute the cache.
func NewErrorCategorizer ¶
func NewErrorCategorizer() domain.ErrorCategorizer
NewErrorCategorizer creates a new error categorizer
func NewParallelExecutor ¶
func NewParallelExecutor() domain.ParallelExecutor
NewParallelExecutor creates a new parallel executor
func NewProgressManager ¶
func NewProgressManager() domain.ProgressManager
NewProgressManager creates a new progress manager
func NewSimpleTask ¶
func NewSimpleTask(name string, enabled bool, execute func(context.Context) (interface{}, error)) domain.ExecutableTask
NewSimpleTask creates a new simple task
func OpenBrowser ¶
OpenBrowser opens the specified URL in the default browser
func SafeHTMLID ¶ added in v1.22.5
func UpdateAnalysisTimingFactors ¶ added in v1.24.1
func UpdateAnalysisTimingFactors(estimatedSeconds, actualSeconds map[domain.AnalysisKind]float64)
UpdateAnalysisTimingFactors records observed task durations against their estimates, smoothing with previously stored factors. Failures are ignored: the cache only improves progress estimation and must never affect analysis.
func WriteCommunityHTMLSummary ¶ added in v1.25.0
func WriteCommunityHTMLSummary(builder *strings.Builder, response *domain.CommunityAnalysisResult)
WriteCommunityHTMLSummary writes a concise community section for unified analyze HTML output.
func WriteCommunityTextSummary ¶ added in v1.25.0
func WriteCommunityTextSummary(writer io.Writer, response *domain.CommunityAnalysisResult)
WriteCommunityTextSummary writes a concise community section for unified analyze text output.
Types ¶
type AnalyzeConfigurationLoaderImpl ¶ added in v1.16.0
type AnalyzeConfigurationLoaderImpl struct{}
AnalyzeConfigurationLoaderImpl resolves and loads config for AnalyzeUseCase.
func NewAnalyzeConfigurationLoader ¶ added in v1.16.0
func NewAnalyzeConfigurationLoader() *AnalyzeConfigurationLoaderImpl
NewAnalyzeConfigurationLoader creates a new analyze configuration loader.
func (*AnalyzeConfigurationLoaderImpl) LoadAnalyzeExecutionConfig ¶ added in v1.16.0
func (l *AnalyzeConfigurationLoaderImpl) LoadAnalyzeExecutionConfig(configPath string, targetPath string) (domain.AnalyzeExecutionConfig, error)
LoadAnalyzeExecutionConfig resolves the effective config path and loads the AnalyzeUseCase-specific settings it needs.
type AnalyzeFormatter ¶
type AnalyzeFormatter struct {
// contains filtered or unexported fields
}
AnalyzeFormatter handles formatting of unified analysis reports
func NewAnalyzeFormatter ¶
func NewAnalyzeFormatter() *AnalyzeFormatter
NewAnalyzeFormatter creates a new analyze formatter
func (*AnalyzeFormatter) Write ¶
func (f *AnalyzeFormatter) Write(response *domain.AnalyzeResponse, format domain.OutputFormat, writer io.Writer) error
Write formats and writes the unified analysis response
type CBOConfigurationLoaderImpl ¶ added in v1.4.0
type CBOConfigurationLoaderImpl struct{}
CBOConfigurationLoaderImpl implements the CBOConfigurationLoader interface
func NewCBOConfigurationLoader ¶ added in v1.4.0
func NewCBOConfigurationLoader() *CBOConfigurationLoaderImpl
NewCBOConfigurationLoader creates a new CBO configuration loader service
func (*CBOConfigurationLoaderImpl) FindDefaultConfigFile ¶ added in v1.4.0
func (cl *CBOConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*CBOConfigurationLoaderImpl) LoadConfig ¶ added in v1.4.0
func (cl *CBOConfigurationLoaderImpl) LoadConfig(path string) (*domain.CBORequest, error)
LoadConfig loads CBO configuration from the specified path using TOML-only strategy
func (*CBOConfigurationLoaderImpl) LoadDefaultConfig ¶ added in v1.4.0
func (cl *CBOConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.CBORequest
LoadDefaultConfig loads the default CBO configuration, first checking for .pyscn.toml
func (*CBOConfigurationLoaderImpl) MergeConfig ¶ added in v1.4.0
func (cl *CBOConfigurationLoaderImpl) MergeConfig(base *domain.CBORequest, override *domain.CBORequest) *domain.CBORequest
MergeConfig merges CLI flags with configuration file
type CBOFormatterImpl ¶
type CBOFormatterImpl struct{}
CBOFormatterImpl implements CBOOutputFormatter interface
func NewCBOFormatter ¶
func NewCBOFormatter() *CBOFormatterImpl
NewCBOFormatter creates a new CBO output formatter
func (*CBOFormatterImpl) Format ¶
func (f *CBOFormatterImpl) Format(response *domain.CBOResponse, format domain.OutputFormat) (string, error)
Format formats the CBO analysis response according to the specified format
func (*CBOFormatterImpl) Write ¶
func (f *CBOFormatterImpl) Write(response *domain.CBOResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted output to the writer
type CBOServiceImpl ¶
type CBOServiceImpl struct {
// contains filtered or unexported fields
}
CBOServiceImpl implements the CBOService interface
func NewCBOService ¶
func NewCBOService() *CBOServiceImpl
NewCBOService creates a new CBO service implementation
func (*CBOServiceImpl) Analyze ¶
func (s *CBOServiceImpl) Analyze(ctx context.Context, req domain.CBORequest) (*domain.CBOResponse, error)
Analyze performs CBO analysis on multiple files
func (*CBOServiceImpl) AnalyzeFile ¶
func (s *CBOServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.CBORequest) (*domain.CBOResponse, error)
AnalyzeFile analyzes a single Python file
func (*CBOServiceImpl) AnalyzeSnapshot ¶ added in v1.21.0
func (s *CBOServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.CBORequest) (*domain.CBOResponse, error)
AnalyzeSnapshot performs CBO analysis using already parsed project files.
type CloneConfigurationLoader ¶
type CloneConfigurationLoader struct{}
CloneConfigurationLoader implements the domain.CloneConfigurationLoader interface
func NewCloneConfigurationLoader ¶
func NewCloneConfigurationLoader() *CloneConfigurationLoader
NewCloneConfigurationLoader creates a new clone configuration loader
func (*CloneConfigurationLoader) FindDefaultConfigFile ¶
func (c *CloneConfigurationLoader) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*CloneConfigurationLoader) GetDefaultCloneConfig ¶
func (c *CloneConfigurationLoader) GetDefaultCloneConfig(targetPath string) *domain.CloneRequest
GetDefaultCloneConfig returns clone detection configuration discovered from targetPath, or built-in defaults when no config file applies.
func (*CloneConfigurationLoader) LoadCloneConfig ¶
func (c *CloneConfigurationLoader) LoadCloneConfig(configPath string) (*domain.CloneRequest, error)
LoadCloneConfig loads clone detection configuration from file using TOML-only strategy
func (*CloneConfigurationLoader) MergeConfig ¶ added in v1.16.0
func (c *CloneConfigurationLoader) MergeConfig(base *domain.CloneRequest, override *domain.CloneRequest) *domain.CloneRequest
MergeConfig merges request values over loaded clone configuration. Zero values (0, "", nil) in override mean "not set" and preserve the config-backed base value; any other value is an explicit override.
func (*CloneConfigurationLoader) SaveCloneConfig ¶
func (c *CloneConfigurationLoader) SaveCloneConfig(cloneConfig *domain.CloneRequest, configPath string) error
SaveCloneConfig saves clone detection configuration to a TOML file
type CloneHTMLData ¶
type CloneHTMLData struct {
OverallScore OverallScoreData `json:"overall_score"`
Response *domain.CloneResponse `json:"response"`
ScoreDetails ScoreData `json:"score_details"`
}
CloneHTMLData represents clone detection data for HTML template
type CloneOutputFormatter ¶
type CloneOutputFormatter struct{}
CloneOutputFormatter implements the domain.CloneOutputFormatter interface
func NewCloneOutputFormatter ¶
func NewCloneOutputFormatter() *CloneOutputFormatter
NewCloneOutputFormatter creates a new clone output formatter
func (*CloneOutputFormatter) FormatCloneResponse ¶
func (f *CloneOutputFormatter) FormatCloneResponse(response *domain.CloneResponse, format domain.OutputFormat, writer io.Writer) error
FormatCloneResponse formats a clone response according to the specified format
func (*CloneOutputFormatter) FormatCloneStatistics ¶
func (f *CloneOutputFormatter) FormatCloneStatistics(stats *domain.CloneStatistics, format domain.OutputFormat, writer io.Writer) error
FormatCloneStatistics formats clone statistics
type CloneService ¶
type CloneService struct {
}
CloneService implements the domain.CloneService interface
func NewCloneService ¶
func NewCloneService() *CloneService
NewCloneService creates a new clone service
func (*CloneService) AnalyzeSnapshot ¶ added in v1.30.0
func (s *CloneService) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req *domain.CloneRequest) (*domain.CloneResponse, error)
AnalyzeSnapshot performs clone detection from source captured by a project snapshot.
func (*CloneService) ComputeSimilarity ¶
func (s *CloneService) ComputeSimilarity(ctx context.Context, fragment1, fragment2 string) (float64, error)
ComputeSimilarity computes similarity between two code fragments
func (*CloneService) DetectClones ¶
func (s *CloneService) DetectClones(ctx context.Context, req *domain.CloneRequest) (*domain.CloneResponse, error)
DetectClones performs clone detection on the given request
func (*CloneService) DetectClonesInFiles ¶
func (s *CloneService) DetectClonesInFiles(ctx context.Context, filePaths []string, req *domain.CloneRequest) (*domain.CloneResponse, error)
DetectClonesInFiles performs clone detection on specific files
type CommunityAnalysisServiceImpl ¶ added in v1.25.0
type CommunityAnalysisServiceImpl struct{}
CommunityAnalysisServiceImpl implements domain.CommunityAnalysisService.
func NewCommunityAnalysisService ¶ added in v1.25.0
func NewCommunityAnalysisService() *CommunityAnalysisServiceImpl
NewCommunityAnalysisService creates a new community analysis service.
func (*CommunityAnalysisServiceImpl) Analyze ¶ added in v1.25.0
func (s *CommunityAnalysisServiceImpl) Analyze(ctx context.Context, req domain.CommunityAnalysisRequest) (*domain.CommunityAnalysisResult, error)
Analyze performs community detection over the module dependency graph.
func (*CommunityAnalysisServiceImpl) AnalyzeGraph ¶ added in v1.30.0
func (s *CommunityAnalysisServiceImpl) AnalyzeGraph(ctx context.Context, projectGraph *ProjectModuleGraph, req domain.CommunityAnalysisRequest) (*domain.CommunityAnalysisResult, error)
AnalyzeGraph performs community detection over a caller-owned dependency graph.
type CommunityConfigurationLoaderImpl ¶ added in v1.25.0
type CommunityConfigurationLoaderImpl struct{}
CommunityConfigurationLoaderImpl implements domain.CommunityConfigurationLoader.
func NewCommunityConfigurationLoader ¶ added in v1.25.0
func NewCommunityConfigurationLoader() *CommunityConfigurationLoaderImpl
NewCommunityConfigurationLoader creates a new community configuration loader.
func (*CommunityConfigurationLoaderImpl) FindDefaultConfigFile ¶ added in v1.25.0
func (cl *CommunityConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*CommunityConfigurationLoaderImpl) LoadConfig ¶ added in v1.25.0
func (cl *CommunityConfigurationLoaderImpl) LoadConfig(path string) (*domain.CommunityAnalysisRequest, error)
LoadConfig loads community configuration from the specified path.
func (*CommunityConfigurationLoaderImpl) LoadDefaultConfig ¶ added in v1.25.0
func (cl *CommunityConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.CommunityAnalysisRequest
LoadDefaultConfig loads the default community configuration, checking for project config first.
func (*CommunityConfigurationLoaderImpl) MergeConfig ¶ added in v1.25.0
func (cl *CommunityConfigurationLoaderImpl) MergeConfig(base *domain.CommunityAnalysisRequest, override *domain.CommunityAnalysisRequest) *domain.CommunityAnalysisRequest
MergeConfig merges configuration file values with request overrides.
type CommunityFormatter ¶ added in v1.25.0
type CommunityFormatter struct{}
CommunityFormatter formats community analysis results for output.
func NewCommunityFormatter ¶ added in v1.25.0
func NewCommunityFormatter() *CommunityFormatter
NewCommunityFormatter creates a community analysis formatter.
func (*CommunityFormatter) Format ¶ added in v1.25.0
func (f *CommunityFormatter) Format(response *domain.CommunityAnalysisResult, format domain.OutputFormat) (string, error)
Format formats community analysis results according to the requested output format.
func (*CommunityFormatter) Write ¶ added in v1.25.0
func (f *CommunityFormatter) Write(response *domain.CommunityAnalysisResult, format domain.OutputFormat, writer io.Writer) error
Write formats and writes community analysis output.
type ComplexityHTMLData ¶
type ComplexityHTMLData struct {
OverallScore OverallScoreData `json:"overall_score"`
Response *domain.ComplexityResponse `json:"response"`
ScoreDetails ScoreData `json:"score_details"`
}
ComplexityHTMLData represents complexity analysis data for HTML template
type ComplexityServiceImpl ¶
type ComplexityServiceImpl struct {
// contains filtered or unexported fields
}
ComplexityServiceImpl implements the ComplexityService interface
func NewComplexityService ¶
func NewComplexityService() *ComplexityServiceImpl
NewComplexityService creates a new complexity service implementation
func (*ComplexityServiceImpl) Analyze ¶
func (s *ComplexityServiceImpl) Analyze(ctx context.Context, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
Analyze performs complexity analysis on multiple files
func (*ComplexityServiceImpl) AnalyzeFile ¶
func (s *ComplexityServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
AnalyzeFile analyzes a single Python file
func (*ComplexityServiceImpl) AnalyzeSnapshot ¶ added in v1.21.0
func (s *ComplexityServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.ComplexityRequest) (*domain.ComplexityResponse, error)
AnalyzeSnapshot performs complexity analysis using already parsed project files.
type ConfigurationLoaderImpl ¶
type ConfigurationLoaderImpl struct{}
ConfigurationLoaderImpl implements the ConfigurationLoader interface
func NewConfigurationLoader ¶
func NewConfigurationLoader() *ConfigurationLoaderImpl
NewConfigurationLoader creates a new configuration loader service
func (*ConfigurationLoaderImpl) CreateConfigTemplate ¶
func (c *ConfigurationLoaderImpl) CreateConfigTemplate(path string) error
CreateConfigTemplate creates a template configuration file
func (*ConfigurationLoaderImpl) FindDefaultConfigFile ¶
func (c *ConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*ConfigurationLoaderImpl) GetDefaultThresholds ¶
func (c *ConfigurationLoaderImpl) GetDefaultThresholds() (low, medium int)
GetDefaultThresholds returns the default complexity thresholds
func (*ConfigurationLoaderImpl) LoadConfig ¶
func (c *ConfigurationLoaderImpl) LoadConfig(path string) (*domain.ComplexityRequest, error)
LoadConfig loads configuration from the specified path
func (*ConfigurationLoaderImpl) LoadDefaultConfig ¶
func (c *ConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.ComplexityRequest
LoadDefaultConfig loads the default configuration, first checking for .pyscn.toml
func (*ConfigurationLoaderImpl) MergeConfig ¶
func (c *ConfigurationLoaderImpl) MergeConfig(base *domain.ComplexityRequest, override *domain.ComplexityRequest) *domain.ComplexityRequest
MergeConfig merges CLI flags with configuration file
func (*ConfigurationLoaderImpl) ValidateConfig ¶
func (c *ConfigurationLoaderImpl) ValidateConfig(req *domain.ComplexityRequest) error
ValidateConfig validates a configuration request
type DIAntipatternConfigurationLoaderImpl ¶ added in v1.16.0
type DIAntipatternConfigurationLoaderImpl struct{}
DIAntipatternConfigurationLoaderImpl implements the DIAntipatternConfigurationLoader interface
func NewDIAntipatternConfigurationLoader ¶ added in v1.16.0
func NewDIAntipatternConfigurationLoader() *DIAntipatternConfigurationLoaderImpl
NewDIAntipatternConfigurationLoader creates a new DI anti-pattern configuration loader service
func (*DIAntipatternConfigurationLoaderImpl) FindDefaultConfigFile ¶ added in v1.16.0
func (cl *DIAntipatternConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*DIAntipatternConfigurationLoaderImpl) LoadConfig ¶ added in v1.16.0
func (cl *DIAntipatternConfigurationLoaderImpl) LoadConfig(path string) (*domain.DIAntipatternRequest, error)
LoadConfig loads DI anti-pattern configuration from the specified path using TOML-only strategy
func (*DIAntipatternConfigurationLoaderImpl) LoadDefaultConfig ¶ added in v1.16.0
func (cl *DIAntipatternConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.DIAntipatternRequest
LoadDefaultConfig loads the default DI anti-pattern configuration, first checking for .pyscn.toml
func (*DIAntipatternConfigurationLoaderImpl) MergeConfig ¶ added in v1.16.0
func (cl *DIAntipatternConfigurationLoaderImpl) MergeConfig(base *domain.DIAntipatternRequest, override *domain.DIAntipatternRequest) *domain.DIAntipatternRequest
MergeConfig merges CLI flags with configuration file
type DIAntipatternFormatter ¶ added in v1.16.0
type DIAntipatternFormatter struct{}
DIAntipatternFormatter implements the DIAntipatternOutputFormatter interface
func NewDIAntipatternFormatter ¶ added in v1.16.0
func NewDIAntipatternFormatter() *DIAntipatternFormatter
NewDIAntipatternFormatter creates a new DI anti-pattern formatter
func (*DIAntipatternFormatter) Format ¶ added in v1.16.0
func (f *DIAntipatternFormatter) Format(response *domain.DIAntipatternResponse, format domain.OutputFormat) (string, error)
Format formats the analysis response according to the specified format
func (*DIAntipatternFormatter) Write ¶ added in v1.16.0
func (f *DIAntipatternFormatter) Write(response *domain.DIAntipatternResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted output to the writer
type DIAntipatternServiceImpl ¶ added in v1.16.0
type DIAntipatternServiceImpl struct {
// contains filtered or unexported fields
}
DIAntipatternServiceImpl implements the DIAntipatternService interface
func NewDIAntipatternService ¶ added in v1.16.0
func NewDIAntipatternService() *DIAntipatternServiceImpl
NewDIAntipatternService creates a new DI anti-pattern service
func (*DIAntipatternServiceImpl) Analyze ¶ added in v1.16.0
func (s *DIAntipatternServiceImpl) Analyze(ctx context.Context, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
Analyze performs DI anti-pattern analysis on multiple files
func (*DIAntipatternServiceImpl) AnalyzeFile ¶ added in v1.16.0
func (s *DIAntipatternServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
AnalyzeFile analyzes a single Python file
func (*DIAntipatternServiceImpl) AnalyzeSnapshot ¶ added in v1.30.0
func (s *DIAntipatternServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.DIAntipatternRequest) (*domain.DIAntipatternResponse, error)
AnalyzeSnapshot performs DI analysis from the canonical parsed project.
type DeadCodeConfigurationLoaderImpl ¶
type DeadCodeConfigurationLoaderImpl struct{}
DeadCodeConfigurationLoaderImpl implements the DeadCodeConfigurationLoader interface
func NewDeadCodeConfigurationLoader ¶
func NewDeadCodeConfigurationLoader() *DeadCodeConfigurationLoaderImpl
NewDeadCodeConfigurationLoader creates a new dead code configuration loader service
func (*DeadCodeConfigurationLoaderImpl) FindDefaultConfigFile ¶
func (cl *DeadCodeConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*DeadCodeConfigurationLoaderImpl) LoadConfig ¶
func (cl *DeadCodeConfigurationLoaderImpl) LoadConfig(path string) (*domain.DeadCodeRequest, error)
LoadConfig loads dead code configuration from the specified path using TOML-only strategy
func (*DeadCodeConfigurationLoaderImpl) LoadDefaultConfig ¶
func (cl *DeadCodeConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.DeadCodeRequest
LoadDefaultConfig loads the default dead code configuration, first checking for .pyscn.toml
func (*DeadCodeConfigurationLoaderImpl) MergeConfig ¶
func (cl *DeadCodeConfigurationLoaderImpl) MergeConfig(base *domain.DeadCodeRequest, override *domain.DeadCodeRequest) *domain.DeadCodeRequest
MergeConfig merges CLI flags with configuration file
func (*DeadCodeConfigurationLoaderImpl) SaveConfig ¶
func (cl *DeadCodeConfigurationLoaderImpl) SaveConfig(req *domain.DeadCodeRequest, path string) error
SaveConfig saves dead code configuration to a TOML file
func (*DeadCodeConfigurationLoaderImpl) ValidateConfig ¶
func (cl *DeadCodeConfigurationLoaderImpl) ValidateConfig(req *domain.DeadCodeRequest) error
ValidateConfig validates a dead code configuration
type DeadCodeFormatterImpl ¶
type DeadCodeFormatterImpl struct{}
DeadCodeFormatterImpl implements the DeadCodeFormatter interface
func NewDeadCodeFormatter ¶
func NewDeadCodeFormatter() *DeadCodeFormatterImpl
NewDeadCodeFormatter creates a new dead code formatter service
func (*DeadCodeFormatterImpl) Format ¶
func (f *DeadCodeFormatterImpl) Format(response *domain.DeadCodeResponse, format domain.OutputFormat) (string, error)
Format formats the dead code analysis response according to the specified format
func (*DeadCodeFormatterImpl) FormatFinding ¶
func (f *DeadCodeFormatterImpl) FormatFinding(finding domain.DeadCodeFinding, format domain.OutputFormat) (string, error)
FormatFinding formats a single dead code finding
func (*DeadCodeFormatterImpl) Write ¶
func (f *DeadCodeFormatterImpl) Write(response *domain.DeadCodeResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted dead code output to the writer
type DeadCodeHTMLData ¶
type DeadCodeHTMLData struct {
OverallScore OverallScoreData `json:"overall_score"`
Response *domain.DeadCodeResponse `json:"response"`
ScoreDetails ScoreData `json:"score_details"`
}
DeadCodeHTMLData represents dead code analysis data for HTML template
type DeadCodeServiceImpl ¶
type DeadCodeServiceImpl struct {
// contains filtered or unexported fields
}
DeadCodeServiceImpl implements the DeadCodeService interface
func NewDeadCodeService ¶
func NewDeadCodeService() *DeadCodeServiceImpl
NewDeadCodeService creates a new dead code service implementation
func (*DeadCodeServiceImpl) Analyze ¶
func (s *DeadCodeServiceImpl) Analyze(ctx context.Context, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
Analyze performs dead code analysis on multiple files
func (*DeadCodeServiceImpl) AnalyzeFile ¶
func (s *DeadCodeServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.DeadCodeRequest) (*domain.FileDeadCode, error)
AnalyzeFile analyzes a single Python file for dead code
func (*DeadCodeServiceImpl) AnalyzeFunction ¶
func (s *DeadCodeServiceImpl) AnalyzeFunction(ctx context.Context, functionCFG interface{}, req domain.DeadCodeRequest) (*domain.FunctionDeadCode, error)
AnalyzeFunction analyzes a single function for dead code
func (*DeadCodeServiceImpl) AnalyzeSnapshot ¶ added in v1.21.0
func (s *DeadCodeServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.DeadCodeRequest) (*domain.DeadCodeResponse, error)
AnalyzeSnapshot performs dead code analysis using already parsed project files.
type ErrorCategorizerImpl ¶
type ErrorCategorizerImpl struct {
// contains filtered or unexported fields
}
ErrorCategorizerImpl implements the ErrorCategorizer interface
func (*ErrorCategorizerImpl) Categorize ¶
func (ec *ErrorCategorizerImpl) Categorize(err error) *domain.CategorizedError
Categorize determines the category of an error
func (*ErrorCategorizerImpl) GetRecoverySuggestions ¶
func (ec *ErrorCategorizerImpl) GetRecoverySuggestions(category domain.ErrorCategory) []string
GetRecoverySuggestions returns recovery suggestions for an error category
type FileOutputWriter ¶
type FileOutputWriter struct {
// contains filtered or unexported fields
}
FileOutputWriter writes reports to files or provided writers and optionally opens HTML in a browser.
func NewFileOutputWriter ¶
func NewFileOutputWriter(status io.Writer) *FileOutputWriter
NewFileOutputWriter creates a new FileOutputWriter.
type FileReaderImpl ¶
type FileReaderImpl struct{}
FileReaderImpl implements the FileReader interface
func NewFileReader ¶
func NewFileReader() *FileReaderImpl
NewFileReader creates a new file reader service
func (*FileReaderImpl) CollectPythonFiles ¶
func (f *FileReaderImpl) CollectPythonFiles(paths []string, recursive bool, includePatterns, excludePatterns []string) ([]string, error)
CollectPythonFiles recursively finds all Python files in the given paths
func (*FileReaderImpl) FileExists ¶
func (f *FileReaderImpl) FileExists(path string) (bool, error)
FileExists checks if a file exists
func (*FileReaderImpl) GetFileInfo ¶
func (f *FileReaderImpl) GetFileInfo(path string) (os.FileInfo, error)
GetFileInfo provides additional information about a file
func (*FileReaderImpl) IsValidPythonFile ¶
func (f *FileReaderImpl) IsValidPythonFile(path string) bool
IsValidPythonFile checks if a file is a valid Python file
func (*FileReaderImpl) ReadFile ¶
func (f *FileReaderImpl) ReadFile(path string) ([]byte, error)
ReadFile reads the content of a file
func (*FileReaderImpl) ValidatePaths ¶
func (f *FileReaderImpl) ValidatePaths(paths []string) error
ValidatePaths validates that all provided paths exist and are accessible
type FormatUtils ¶
type FormatUtils struct{}
FormatUtils provides shared formatting utilities
func NewFormatUtils ¶
func NewFormatUtils() *FormatUtils
NewFormatUtils creates a new format utilities instance
func (*FormatUtils) ConvertToStandardRisk ¶
func (f *FormatUtils) ConvertToStandardRisk(risk string) RiskLevel
ConvertToStandardRisk converts various risk representations to standard format
func (*FormatUtils) FormatDuration ¶
func (f *FormatUtils) FormatDuration(durationMs int64) string
FormatDuration formats duration in milliseconds consistently
func (*FormatUtils) FormatFileStats ¶
func (f *FormatUtils) FormatFileStats(analyzed, total, skipped int) string
FormatFileStats creates standardized file statistics
func (*FormatUtils) FormatLabel ¶
func (f *FormatUtils) FormatLabel(label string, value interface{}) string
FormatLabel creates a consistently formatted label with right alignment
func (*FormatUtils) FormatLabelWithIndent ¶
func (f *FormatUtils) FormatLabelWithIndent(indent int, label string, value interface{}) string
FormatLabelWithIndent creates a formatted label with specific indentation
func (*FormatUtils) FormatMainHeader ¶
func (f *FormatUtils) FormatMainHeader(title string) string
FormatMainHeader creates a standardized main header
func (*FormatUtils) FormatPercentage ¶
func (f *FormatUtils) FormatPercentage(value float64) string
FormatPercentage formats a percentage value consistently
func (*FormatUtils) FormatRiskDistribution ¶
func (f *FormatUtils) FormatRiskDistribution(high, medium, low int) string
FormatRiskDistribution creates a standardized risk distribution section
func (*FormatUtils) FormatRiskWithColor ¶
func (f *FormatUtils) FormatRiskWithColor(risk RiskLevel) string
FormatRiskWithColor formats a risk level with appropriate color
func (*FormatUtils) FormatSectionHeader ¶
func (f *FormatUtils) FormatSectionHeader(title string) string
FormatSectionHeader creates a standardized section header
func (*FormatUtils) FormatSectionSeparator ¶
func (f *FormatUtils) FormatSectionSeparator() string
FormatSectionSeparator creates a section separator
func (*FormatUtils) FormatSummaryStats ¶
func (f *FormatUtils) FormatSummaryStats(stats map[string]interface{}) string
FormatSummaryStats creates a standardized summary statistics section
func (*FormatUtils) FormatTableHeader ¶
func (f *FormatUtils) FormatTableHeader(columns ...string) string
FormatTableHeader creates a table header with consistent formatting
func (*FormatUtils) FormatWarningsSection ¶
func (f *FormatUtils) FormatWarningsSection(warnings []string) string
FormatWarningsSection creates a standardized warnings section
func (*FormatUtils) GetRiskColor ¶
func (f *FormatUtils) GetRiskColor(risk RiskLevel) string
GetRiskColor returns the appropriate color for a risk level
type HTMLFormatterImpl ¶
type HTMLFormatterImpl struct{}
HTMLFormatterImpl provides common HTML formatting functionality with Lighthouse-style scoring
func NewHTMLFormatter ¶
func NewHTMLFormatter() *HTMLFormatterImpl
NewHTMLFormatter creates a new HTML formatter service
func (*HTMLFormatterImpl) CalculateCloneScore ¶
func (f *HTMLFormatterImpl) CalculateCloneScore(response *domain.CloneResponse) ScoreData
CalculateCloneScore calculates a Lighthouse-style score for clone detection
func (*HTMLFormatterImpl) CalculateComplexityScore ¶
func (f *HTMLFormatterImpl) CalculateComplexityScore(response *domain.ComplexityResponse) ScoreData
CalculateComplexityScore calculates a Lighthouse-style score (0-100) for complexity
func (*HTMLFormatterImpl) CalculateDeadCodeScore ¶
func (f *HTMLFormatterImpl) CalculateDeadCodeScore(response *domain.DeadCodeResponse) ScoreData
CalculateDeadCodeScore calculates a Lighthouse-style score for dead code detection
func (*HTMLFormatterImpl) CalculateOverallScore ¶
func (f *HTMLFormatterImpl) CalculateOverallScore(scores []ScoreData, projectName string) OverallScoreData
CalculateOverallScore calculates weighted average of all scores
func (*HTMLFormatterImpl) FormatCloneAsHTML ¶
func (f *HTMLFormatterImpl) FormatCloneAsHTML(response *domain.CloneResponse, projectName string) (string, error)
FormatCloneAsHTML formats clone detection as HTML
func (*HTMLFormatterImpl) FormatComplexityAsHTML ¶
func (f *HTMLFormatterImpl) FormatComplexityAsHTML(response *domain.ComplexityResponse, projectName string) (string, error)
FormatComplexityAsHTML formats complexity analysis as HTML
func (*HTMLFormatterImpl) FormatDeadCodeAsHTML ¶
func (f *HTMLFormatterImpl) FormatDeadCodeAsHTML(response *domain.DeadCodeResponse, projectName string) (string, error)
FormatDeadCodeAsHTML formats dead code analysis as HTML
type HTMLTemplate ¶
type HTMLTemplate struct {
Title string
Subtitle string
GeneratedAt time.Time
Version string
Duration int64
ScoreValue int
ScoreGrade string
ShowScore bool
}
HTMLTemplate provides a standard HTML template for all reports
func (*HTMLTemplate) GenerateHTMLHeader ¶
func (t *HTMLTemplate) GenerateHTMLHeader() string
GenerateHTMLHeader generates the standard HTML header with consistent styling
type LCOMConfigurationLoaderImpl ¶ added in v1.11.0
type LCOMConfigurationLoaderImpl struct{}
LCOMConfigurationLoaderImpl implements the LCOMConfigurationLoader interface
func NewLCOMConfigurationLoader ¶ added in v1.11.0
func NewLCOMConfigurationLoader() *LCOMConfigurationLoaderImpl
NewLCOMConfigurationLoader creates a new LCOM configuration loader service
func (*LCOMConfigurationLoaderImpl) FindDefaultConfigFile ¶ added in v1.11.0
func (cl *LCOMConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*LCOMConfigurationLoaderImpl) LoadConfig ¶ added in v1.11.0
func (cl *LCOMConfigurationLoaderImpl) LoadConfig(path string) (*domain.LCOMRequest, error)
LoadConfig loads LCOM configuration from the specified path using TOML-only strategy
func (*LCOMConfigurationLoaderImpl) LoadDefaultConfig ¶ added in v1.11.0
func (cl *LCOMConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.LCOMRequest
LoadDefaultConfig loads the default LCOM configuration, first checking for .pyscn.toml
func (*LCOMConfigurationLoaderImpl) MergeConfig ¶ added in v1.11.0
func (cl *LCOMConfigurationLoaderImpl) MergeConfig(base *domain.LCOMRequest, override *domain.LCOMRequest) *domain.LCOMRequest
MergeConfig merges CLI flags with configuration file
type LCOMFormatterImpl ¶ added in v1.11.0
type LCOMFormatterImpl struct{}
LCOMFormatterImpl implements LCOMOutputFormatter interface
func NewLCOMFormatter ¶ added in v1.11.0
func NewLCOMFormatter() *LCOMFormatterImpl
NewLCOMFormatter creates a new LCOM output formatter
func (*LCOMFormatterImpl) Format ¶ added in v1.11.0
func (f *LCOMFormatterImpl) Format(response *domain.LCOMResponse, format domain.OutputFormat) (string, error)
Format formats the LCOM analysis response according to the specified format
func (*LCOMFormatterImpl) Write ¶ added in v1.11.0
func (f *LCOMFormatterImpl) Write(response *domain.LCOMResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted output to the writer
type LCOMServiceImpl ¶ added in v1.11.0
type LCOMServiceImpl struct {
// contains filtered or unexported fields
}
LCOMServiceImpl implements the LCOMService interface
func NewLCOMService ¶ added in v1.11.0
func NewLCOMService() *LCOMServiceImpl
NewLCOMService creates a new LCOM service implementation
func (*LCOMServiceImpl) Analyze ¶ added in v1.11.0
func (s *LCOMServiceImpl) Analyze(ctx context.Context, req domain.LCOMRequest) (*domain.LCOMResponse, error)
Analyze performs LCOM analysis on multiple files
func (*LCOMServiceImpl) AnalyzeFile ¶ added in v1.11.0
func (s *LCOMServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.LCOMRequest) (*domain.LCOMResponse, error)
AnalyzeFile analyzes a single Python file
func (*LCOMServiceImpl) AnalyzeSnapshot ¶ added in v1.21.0
func (s *LCOMServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.LCOMRequest) (*domain.LCOMResponse, error)
AnalyzeSnapshot performs LCOM analysis using already parsed project files.
type MockDataConfigurationLoaderImpl ¶ added in v1.7.0
type MockDataConfigurationLoaderImpl struct{}
MockDataConfigurationLoaderImpl implements the MockDataConfigurationLoader interface
func NewMockDataConfigurationLoader ¶ added in v1.7.0
func NewMockDataConfigurationLoader() *MockDataConfigurationLoaderImpl
NewMockDataConfigurationLoader creates a new mock data configuration loader service
func (*MockDataConfigurationLoaderImpl) FindDefaultConfigFile ¶ added in v1.7.0
func (cl *MockDataConfigurationLoaderImpl) FindDefaultConfigFile(targetPath string) string
FindDefaultConfigFile discovers the config file governing targetPath.
func (*MockDataConfigurationLoaderImpl) LoadConfig ¶ added in v1.7.0
func (cl *MockDataConfigurationLoaderImpl) LoadConfig(path string) (*domain.MockDataRequest, error)
LoadConfig loads mock data configuration from the specified path using TOML-only strategy
func (*MockDataConfigurationLoaderImpl) LoadDefaultConfig ¶ added in v1.7.0
func (cl *MockDataConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.MockDataRequest
LoadDefaultConfig loads the default mock data configuration, first checking for .pyscn.toml
func (*MockDataConfigurationLoaderImpl) MergeConfig ¶ added in v1.7.0
func (cl *MockDataConfigurationLoaderImpl) MergeConfig(base *domain.MockDataRequest, override *domain.MockDataRequest) *domain.MockDataRequest
MergeConfig merges CLI flags with configuration file
type MockDataFormatterImpl ¶ added in v1.7.0
type MockDataFormatterImpl struct{}
MockDataFormatterImpl implements the MockDataFormatter interface
func NewMockDataFormatter ¶ added in v1.7.0
func NewMockDataFormatter() *MockDataFormatterImpl
NewMockDataFormatter creates a new mock data formatter service
func (*MockDataFormatterImpl) Format ¶ added in v1.7.0
func (f *MockDataFormatterImpl) Format(response *domain.MockDataResponse, format domain.OutputFormat) (string, error)
Format formats the mock data analysis response according to the specified format
func (*MockDataFormatterImpl) Write ¶ added in v1.7.0
func (f *MockDataFormatterImpl) Write(response *domain.MockDataResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted mock data output to the writer
type MockDataServiceImpl ¶ added in v1.7.0
type MockDataServiceImpl struct {
// contains filtered or unexported fields
}
MockDataServiceImpl implements the MockDataService interface
func NewMockDataService ¶ added in v1.7.0
func NewMockDataService() *MockDataServiceImpl
NewMockDataService creates a new mock data service implementation
func NewMockDataServiceWithConfig ¶ added in v1.7.0
func NewMockDataServiceWithConfig(keywords, domains []string) *MockDataServiceImpl
NewMockDataServiceWithConfig creates a mock data service with custom configuration
func (*MockDataServiceImpl) Analyze ¶ added in v1.7.0
func (s *MockDataServiceImpl) Analyze(ctx context.Context, req domain.MockDataRequest) (*domain.MockDataResponse, error)
Analyze performs mock data analysis on multiple files
func (*MockDataServiceImpl) AnalyzeFile ¶ added in v1.7.0
func (s *MockDataServiceImpl) AnalyzeFile(ctx context.Context, filePath string, req domain.MockDataRequest) (*domain.FileMockData, error)
AnalyzeFile analyzes a single Python file for mock data
func (*MockDataServiceImpl) AnalyzeSnapshot ¶ added in v1.30.0
func (s *MockDataServiceImpl) AnalyzeSnapshot(ctx context.Context, snapshot *ProjectSnapshot, req domain.MockDataRequest) (*domain.MockDataResponse, error)
AnalyzeSnapshot performs mock-data detection from the canonical parsed project without rereading or reparsing source files.
type OutputFormatResolver ¶
type OutputFormatResolver struct{}
OutputFormatResolver resolves output format and file extension selections.
func NewOutputFormatResolver ¶
func NewOutputFormatResolver() *OutputFormatResolver
NewOutputFormatResolver creates an output format resolver.
func (*OutputFormatResolver) Determine ¶
func (r *OutputFormatResolver) Determine(html, json, csv, yaml bool) (domain.OutputFormat, string, error)
Determine preserves the original four-flag resolver contract. With no selection it returns text output without a file extension.
func (*OutputFormatResolver) DetermineAnalyzeReport ¶ added in v1.29.0
func (r *OutputFormatResolver) DetermineAnalyzeReport(html, json, csv, yaml, text bool) (domain.OutputFormat, string, error)
DetermineAnalyzeReport resolves the five analyze report flags. With no selection it returns the command's default HTML report.
type OutputFormatterImpl ¶
type OutputFormatterImpl struct{}
OutputFormatterImpl implements the OutputFormatter interface
func NewOutputFormatter ¶
func NewOutputFormatter() *OutputFormatterImpl
NewOutputFormatter creates a new output formatter service
func (*OutputFormatterImpl) Format ¶
func (f *OutputFormatterImpl) Format(response *domain.ComplexityResponse, format domain.OutputFormat) (string, error)
Format formats the analysis response according to the specified format
func (*OutputFormatterImpl) FormatSummaryOnly ¶
func (f *OutputFormatterImpl) FormatSummaryOnly(response *domain.ComplexityResponse, format domain.OutputFormat) (string, error)
FormatSummaryOnly formats only the summary information
func (*OutputFormatterImpl) Write ¶
func (f *OutputFormatterImpl) Write(response *domain.ComplexityResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted output to the writer
type OverallScoreData ¶
type OverallScoreData struct {
Score int `json:"score"`
Color string `json:"color"`
Status string `json:"status"`
Breakdown []ScoreData `json:"breakdown"`
ProjectName string `json:"project_name"`
Timestamp string `json:"timestamp"`
}
OverallScoreData represents the combined score information
type ParallelExecutorImpl ¶
type ParallelExecutorImpl struct {
// contains filtered or unexported fields
}
ParallelExecutorImpl implements the ParallelExecutor interface
func (*ParallelExecutorImpl) Execute ¶
func (pe *ParallelExecutorImpl) Execute(ctx context.Context, tasks []domain.ExecutableTask) error
Execute runs tasks in parallel with the given configuration
func (*ParallelExecutorImpl) SetMaxConcurrency ¶
func (pe *ParallelExecutorImpl) SetMaxConcurrency(max int)
SetMaxConcurrency sets the maximum number of concurrent tasks
func (*ParallelExecutorImpl) SetTimeout ¶
func (pe *ParallelExecutorImpl) SetTimeout(timeout time.Duration)
SetTimeout sets the timeout for all tasks
type ProgressManagerImpl ¶
type ProgressManagerImpl struct {
// contains filtered or unexported fields
}
ProgressManagerImpl implements the ProgressManager interface
func (*ProgressManagerImpl) Close ¶
func (pm *ProgressManagerImpl) Close()
Close cleans up any resources
func (*ProgressManagerImpl) Complete ¶
func (pm *ProgressManagerImpl) Complete(success bool)
Complete marks the progress as completed (finishes the progress bar)
func (*ProgressManagerImpl) Initialize ¶
func (pm *ProgressManagerImpl) Initialize(maxValue int)
Initialize sets up progress tracking with the maximum value
func (*ProgressManagerImpl) IsInteractive ¶
func (pm *ProgressManagerImpl) IsInteractive() bool
IsInteractive returns true if progress bars should be shown
func (*ProgressManagerImpl) SetWriter ¶
func (pm *ProgressManagerImpl) SetWriter(writer io.Writer)
SetWriter sets the output writer for progress bars
func (*ProgressManagerImpl) Start ¶
func (pm *ProgressManagerImpl) Start()
Start starts the progress bar
func (*ProgressManagerImpl) Update ¶
func (pm *ProgressManagerImpl) Update(processed, total int)
Update updates the progress
type ProjectFile ¶ added in v1.21.0
type ProjectFile struct {
Path string
AST *parser.Node
RawMetrics *analyzer.RawMetricsResult
ReadErr error
ParseErr error
// contains filtered or unexported fields
}
ProjectFile stores one Python file after read and parse.
func (*ProjectFile) CFGs ¶ added in v1.21.0
func (f *ProjectFile) CFGs() (analyzer.ControlFlowGraphs, error)
CFGs builds CFGs once and shares them across CFG-backed analyzers.
func (*ProjectFile) Parsed ¶ added in v1.21.0
func (f *ProjectFile) Parsed() bool
Parsed reports whether the file has a valid parsed AST.
type ProjectModuleGraph ¶ added in v1.30.0
type ProjectModuleGraph struct {
// contains filtered or unexported fields
}
ProjectModuleGraph is an owned graph projection of a project snapshot. Its analyzer representation remains private to the service layer.
func (*ProjectModuleGraph) Clone ¶ added in v1.30.0
func (g *ProjectModuleGraph) Clone() *ProjectModuleGraph
Clone returns an independent graph for one analyzer to consume.
type ProjectSnapshot ¶ added in v1.21.0
type ProjectSnapshot struct {
Files []*ProjectFile
// contains filtered or unexported fields
}
ProjectSnapshot stores the parsed source needed by multiple analyzers.
func BuildAnalysisProjectSnapshot ¶ added in v1.30.0
func BuildAnalysisProjectSnapshot(ctx context.Context, analysisPaths, modulePaths []string, options ProjectSnapshotOptions) *ProjectSnapshot
BuildAnalysisProjectSnapshot captures the implementation and importable module surfaces once while retaining their distinct analyzer scopes.
func BuildProjectSnapshot ¶ added in v1.21.0
func BuildProjectSnapshot(ctx context.Context, paths []string) *ProjectSnapshot
BuildProjectSnapshot reads and parses each file once for the full analyze command.
func BuildProjectSnapshotWithOptions ¶ added in v1.21.0
func BuildProjectSnapshotWithOptions(ctx context.Context, paths []string, options ProjectSnapshotOptions) *ProjectSnapshot
BuildProjectSnapshotWithOptions reads and parses each file once with analyzer-scoped caches.
func (*ProjectSnapshot) BuildDependencyGraph ¶ added in v1.30.0
func (s *ProjectSnapshot) BuildDependencyGraph(ctx context.Context, graphOptions *domain.ModuleGraphOptions) (*ProjectModuleGraph, error)
BuildDependencyGraph projects the snapshot's successfully parsed files into a new dependency graph. The returned graph is owned by the caller.
func (*ProjectSnapshot) Coverage ¶ added in v1.30.0
func (s *ProjectSnapshot) Coverage() domain.AnalysisCoverage
Coverage reports project-wide read and parse coverage from the snapshot.
func (*ProjectSnapshot) FileProjections ¶ added in v1.30.0
func (s *ProjectSnapshot) FileProjections() []*ProjectFile
FileProjections returns independent copies of the captured project files.
func (*ProjectSnapshot) ModuleCoverage ¶ added in v1.30.0
func (s *ProjectSnapshot) ModuleCoverage() domain.AnalysisCoverage
ModuleCoverage reports read and parse coverage for every file that defines the captured dependency-graph surface, including stub-only modules.
func (*ProjectSnapshot) Paths ¶ added in v1.21.0
func (s *ProjectSnapshot) Paths() []string
Paths returns the file paths represented by the snapshot.
type ProjectSnapshotOptions ¶ added in v1.21.0
ProjectSnapshotOptions controls which optional per-file analysis caches are built.
type RiskLevel ¶
type RiskLevel string
RiskLevel represents the standard risk levels across all tools
type ScoreData ¶
type ScoreData struct {
Score int `json:"score"`
Label string `json:"label"`
Color string `json:"color"`
Status string `json:"status"`
Category string `json:"category"`
}
ScoreData represents scoring information for HTML output
type SimpleTask ¶
type SimpleTask struct {
// contains filtered or unexported fields
}
SimpleTask is a basic implementation of ExecutableTask
func (*SimpleTask) Execute ¶
func (t *SimpleTask) Execute(ctx context.Context) (interface{}, error)
Execute runs the task and returns the result
func (*SimpleTask) IsEnabled ¶
func (t *SimpleTask) IsEnabled() bool
IsEnabled returns whether the task should be executed
type SystemAnalysisConfigurationLoaderImpl ¶
type SystemAnalysisConfigurationLoaderImpl struct{}
SystemAnalysisConfigurationLoaderImpl implements the SystemAnalysisConfigurationLoader interface
func NewSystemAnalysisConfigurationLoader ¶
func NewSystemAnalysisConfigurationLoader() *SystemAnalysisConfigurationLoaderImpl
NewSystemAnalysisConfigurationLoader creates a new system analysis configuration loader
func (*SystemAnalysisConfigurationLoaderImpl) LoadConfig ¶
func (cl *SystemAnalysisConfigurationLoaderImpl) LoadConfig(path string) (*domain.SystemAnalysisRequest, error)
LoadConfig loads configuration from the specified path using the shared TomlConfigLoader
func (*SystemAnalysisConfigurationLoaderImpl) LoadDefaultConfig ¶
func (cl *SystemAnalysisConfigurationLoaderImpl) LoadDefaultConfig(targetPath string) *domain.SystemAnalysisRequest
LoadDefaultConfig returns the built-in defaults. System analysis config is resolved by the caller, so there is nothing to discover from targetPath.
func (*SystemAnalysisConfigurationLoaderImpl) MergeConfig ¶
func (cl *SystemAnalysisConfigurationLoaderImpl) MergeConfig(base *domain.SystemAnalysisRequest, override *domain.SystemAnalysisRequest) *domain.SystemAnalysisRequest
MergeConfig merges CLI flags with configuration file
type SystemAnalysisConfigurationLoaderWithFlags ¶
type SystemAnalysisConfigurationLoaderWithFlags struct {
*SystemAnalysisConfigurationLoaderImpl
}
SystemAnalysisConfigurationLoaderWithFlags extends the base loader with CLI flag integration
func NewSystemAnalysisConfigurationLoaderWithFlags ¶
func NewSystemAnalysisConfigurationLoaderWithFlags() *SystemAnalysisConfigurationLoaderWithFlags
NewSystemAnalysisConfigurationLoaderWithFlags creates a configuration loader that integrates CLI flags
func (*SystemAnalysisConfigurationLoaderWithFlags) LoadConfigWithFlags ¶
func (cl *SystemAnalysisConfigurationLoaderWithFlags) LoadConfigWithFlags( configPath string, cliRequest *domain.SystemAnalysisRequest, ) (*domain.SystemAnalysisRequest, error)
LoadConfigWithFlags loads configuration and merges with CLI flags
type SystemAnalysisFormatterImpl ¶
type SystemAnalysisFormatterImpl struct{}
SystemAnalysisFormatterImpl implements the SystemAnalysisOutputFormatter interface
func NewSystemAnalysisFormatter ¶
func NewSystemAnalysisFormatter() *SystemAnalysisFormatterImpl
NewSystemAnalysisFormatter creates a new system analysis output formatter
func (*SystemAnalysisFormatterImpl) Format ¶
func (f *SystemAnalysisFormatterImpl) Format(response *domain.SystemAnalysisResponse, format domain.OutputFormat) (string, error)
Format formats the system analysis response according to the specified format
func (*SystemAnalysisFormatterImpl) Write ¶
func (f *SystemAnalysisFormatterImpl) Write(response *domain.SystemAnalysisResponse, format domain.OutputFormat, writer io.Writer) error
Write writes the formatted output to the writer
type SystemAnalysisServiceImpl ¶
type SystemAnalysisServiceImpl struct {
// contains filtered or unexported fields
}
SystemAnalysisServiceImpl implements the SystemAnalysisService interface
func NewSystemAnalysisService ¶
func NewSystemAnalysisService() *SystemAnalysisServiceImpl
NewSystemAnalysisService creates a new system analysis service implementation
func (*SystemAnalysisServiceImpl) Analyze ¶
func (s *SystemAnalysisServiceImpl) Analyze(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
Analyze performs comprehensive system analysis including dependencies, architecture, and quality metrics
func (*SystemAnalysisServiceImpl) AnalyzeArchitecture ¶
func (s *SystemAnalysisServiceImpl) AnalyzeArchitecture(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.ArchitectureAnalysisResult, error)
AnalyzeArchitecture performs architecture validation only
func (*SystemAnalysisServiceImpl) AnalyzeDependencies ¶
func (s *SystemAnalysisServiceImpl) AnalyzeDependencies(ctx context.Context, req domain.SystemAnalysisRequest) (*domain.DependencyAnalysisResult, error)
AnalyzeDependencies performs dependency analysis only
func (*SystemAnalysisServiceImpl) AnalyzeGraph ¶ added in v1.30.0
func (s *SystemAnalysisServiceImpl) AnalyzeGraph(ctx context.Context, projectGraph *ProjectModuleGraph, req domain.SystemAnalysisRequest) (*domain.SystemAnalysisResponse, error)
AnalyzeGraph performs system analysis over a caller-owned dependency graph.
func (*SystemAnalysisServiceImpl) BuildModuleLayerMap ¶ added in v1.25.0
func (s *SystemAnalysisServiceImpl) BuildModuleLayerMap(graph *analyzer.DependencyGraph, rules *domain.ArchitectureRules) map[string]string
BuildModuleLayerMap maps each module to a layer based on ArchitectureRules.
func (*SystemAnalysisServiceImpl) ResolveArchitectureRules ¶ added in v1.25.0
func (s *SystemAnalysisServiceImpl) ResolveArchitectureRules(graph *analyzer.DependencyGraph, rules *domain.ArchitectureRules) *domain.ArchitectureRules
ResolveArchitectureRules returns resolved architecture rules with style presets applied.
Source Files
¶
- analysis_issues.go
- analyze_config_loader.go
- analyze_formatter.go
- analyze_html.go
- architecture_config.go
- browser.go
- cbo_config_loader.go
- cbo_formatter.go
- cbo_service.go
- clone_config_loader.go
- clone_formatter.go
- clone_service.go
- community_analysis_service.go
- community_config_loader.go
- community_formatter.go
- community_graph_assets.go
- community_graph_html.go
- complexity_service.go
- config_discovery.go
- config_loader.go
- dead_code_config_loader.go
- dead_code_formatter.go
- dead_code_service.go
- di_antipattern_config_loader.go
- di_antipattern_formatter.go
- di_antipattern_service.go
- directory_complexity_formatter.go
- error_categorizer.go
- file_output_writer.go
- file_reader.go
- format_utils.go
- html_formatter.go
- html_template.go
- lcom_config_loader.go
- lcom_formatter.go
- lcom_service.go
- mock_data_config_loader.go
- mock_data_formatter.go
- mock_data_service.go
- output_format_resolver.go
- output_formatter.go
- parallel_executor.go
- progress_manager.go
- project_root.go
- project_snapshot.go
- responsibility_analysis.go
- system_analysis_config_loader.go
- system_analysis_formatter.go
- system_analysis_service.go
- timing_cache.go