Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeJSON(v interface{}) (string, error)
- func EncodeYAML(v interface{}) (string, error)
- func GenerateHTMLFooter() string
- func GenerateMetricCard(value, label string) string
- func GenerateSectionHeader(title string) string
- func GenerateSinglePageContent(content string) 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 IsInteractiveEnvironment() bool
- func IsSSH() bool
- 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 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() string
- func (cl *CBOConfigurationLoaderImpl) LoadConfig(path string) (*domain.CBORequest, error)
- func (cl *CBOConfigurationLoaderImpl) LoadDefaultConfig() *domain.CBORequest
- func (cl *CBOConfigurationLoaderImpl) MergeConfig(base *domain.CBORequest, override *domain.CBORequest) *domain.CBORequest
- type CBOFormatterImpl
- type CBOServiceImpl
- type CloneConfigurationLoader
- func (c *CloneConfigurationLoader) FindDefaultConfigFile() string
- func (c *CloneConfigurationLoader) GetDefaultCloneConfig() *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 CloneConfigurationLoaderWithFlags
- func (cl *CloneConfigurationLoaderWithFlags) FindDefaultConfigFile() string
- func (cl *CloneConfigurationLoaderWithFlags) GetDefaultCloneConfig() *domain.CloneRequest
- func (cl *CloneConfigurationLoaderWithFlags) LoadCloneConfig(path string) (*domain.CloneRequest, error)
- func (cl *CloneConfigurationLoaderWithFlags) MergeConfig(base *domain.CloneRequest, override *domain.CloneRequest) *domain.CloneRequest
- func (cl *CloneConfigurationLoaderWithFlags) SaveCloneConfig(config *domain.CloneRequest, path string) error
- type CloneHTMLData
- type CloneOutputFormatter
- type CloneService
- 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 ComplexityHTMLData
- type ComplexityServiceImpl
- type ConfigurationLoaderImpl
- func (c *ConfigurationLoaderImpl) CreateConfigTemplate(path string) error
- func (c *ConfigurationLoaderImpl) FindDefaultConfigFile() string
- func (c *ConfigurationLoaderImpl) GetDefaultThresholds() (low, medium int)
- func (c *ConfigurationLoaderImpl) LoadConfig(path string) (*domain.ComplexityRequest, error)
- func (c *ConfigurationLoaderImpl) LoadDefaultConfig() *domain.ComplexityRequest
- func (c *ConfigurationLoaderImpl) MergeConfig(base *domain.ComplexityRequest, override *domain.ComplexityRequest) *domain.ComplexityRequest
- func (c *ConfigurationLoaderImpl) ValidateConfig(req *domain.ComplexityRequest) error
- type ConfigurationLoaderWithFlags
- func (c *ConfigurationLoaderWithFlags) CreateConfigTemplate(path string) error
- func (c *ConfigurationLoaderWithFlags) FindDefaultConfigFile() string
- func (c *ConfigurationLoaderWithFlags) GetDefaultThresholds() (low, medium int)
- func (c *ConfigurationLoaderWithFlags) LoadConfig(path string) (*domain.ComplexityRequest, error)
- func (c *ConfigurationLoaderWithFlags) LoadDefaultConfig() *domain.ComplexityRequest
- func (c *ConfigurationLoaderWithFlags) MergeConfig(base *domain.ComplexityRequest, override *domain.ComplexityRequest) *domain.ComplexityRequest
- func (c *ConfigurationLoaderWithFlags) ValidateConfig(req *domain.ComplexityRequest) error
- type DIAntipatternConfigurationLoaderImpl
- func (cl *DIAntipatternConfigurationLoaderImpl) FindDefaultConfigFile() string
- func (cl *DIAntipatternConfigurationLoaderImpl) LoadConfig(path string) (*domain.DIAntipatternRequest, error)
- func (cl *DIAntipatternConfigurationLoaderImpl) LoadDefaultConfig() *domain.DIAntipatternRequest
- func (cl *DIAntipatternConfigurationLoaderImpl) MergeConfig(base *domain.DIAntipatternRequest, override *domain.DIAntipatternRequest) *domain.DIAntipatternRequest
- type DIAntipatternFormatter
- type DIAntipatternServiceImpl
- type DeadCodeConfigurationLoaderImpl
- func (cl *DeadCodeConfigurationLoaderImpl) FindDefaultConfigFile() string
- func (cl *DeadCodeConfigurationLoaderImpl) LoadConfig(path string) (*domain.DeadCodeRequest, error)
- func (cl *DeadCodeConfigurationLoaderImpl) LoadDefaultConfig() *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 DeadCodeConfigurationLoaderWithFlags
- func (cl *DeadCodeConfigurationLoaderWithFlags) FindDefaultConfigFile() string
- func (cl *DeadCodeConfigurationLoaderWithFlags) LoadConfig(path string) (*domain.DeadCodeRequest, error)
- func (cl *DeadCodeConfigurationLoaderWithFlags) LoadDefaultConfig() *domain.DeadCodeRequest
- func (cl *DeadCodeConfigurationLoaderWithFlags) MergeConfig(base *domain.DeadCodeRequest, override *domain.DeadCodeRequest) *domain.DeadCodeRequest
- 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)
- 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, withIssues 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() string
- func (cl *LCOMConfigurationLoaderImpl) LoadConfig(path string) (*domain.LCOMRequest, error)
- func (cl *LCOMConfigurationLoaderImpl) LoadDefaultConfig() *domain.LCOMRequest
- func (cl *LCOMConfigurationLoaderImpl) MergeConfig(base *domain.LCOMRequest, override *domain.LCOMRequest) *domain.LCOMRequest
- type LCOMFormatterImpl
- type LCOMServiceImpl
- type MockDataConfigurationLoaderImpl
- func (cl *MockDataConfigurationLoaderImpl) FindDefaultConfigFile() string
- func (cl *MockDataConfigurationLoaderImpl) LoadConfig(path string) (*domain.MockDataRequest, error)
- func (cl *MockDataConfigurationLoaderImpl) LoadDefaultConfig() *domain.MockDataRequest
- func (cl *MockDataConfigurationLoaderImpl) MergeConfig(base *domain.MockDataRequest, override *domain.MockDataRequest) *domain.MockDataRequest
- type MockDataFormatterImpl
- type MockDataServiceImpl
- 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 RiskLevel
- type ScoreData
- type SimpleTask
- type SystemAnalysisConfigurationLoaderImpl
- func (cl *SystemAnalysisConfigurationLoaderImpl) LoadConfig(path string) (*domain.SystemAnalysisRequest, error)
- func (cl *SystemAnalysisConfigurationLoaderImpl) LoadDefaultConfig() *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)
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
Variables ¶
var ExampleSystemAnalysisConfig = `` /* 394-byte string literal not displayed */
Example configuration file content for documentation
Functions ¶
func EncodeJSON ¶
EncodeJSON returns an indented JSON string for the given value.
func EncodeYAML ¶
EncodeYAML returns a YAML string for the given value.
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 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 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 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
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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
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() *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
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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
func (*CloneConfigurationLoader) GetDefaultCloneConfig ¶
func (c *CloneConfigurationLoader) GetDefaultCloneConfig() *domain.CloneRequest
GetDefaultCloneConfig returns default clone detection configuration
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. Without explicit flag tracking, values that still match domain defaults are treated as "not overridden" so config-backed values are preserved.
func (*CloneConfigurationLoader) SaveCloneConfig ¶
func (c *CloneConfigurationLoader) SaveCloneConfig(cloneConfig *domain.CloneRequest, configPath string) error
SaveCloneConfig saves clone detection configuration to a TOML file
type CloneConfigurationLoaderWithFlags ¶
type CloneConfigurationLoaderWithFlags struct {
// contains filtered or unexported fields
}
CloneConfigurationLoaderWithFlags wraps clone configuration loading with explicit flag tracking
func NewCloneConfigurationLoaderWithFlags ¶
func NewCloneConfigurationLoaderWithFlags(explicitFlags map[string]bool) *CloneConfigurationLoaderWithFlags
NewCloneConfigurationLoaderWithFlags creates a new clone configuration loader that tracks explicit flags
func (*CloneConfigurationLoaderWithFlags) FindDefaultConfigFile ¶
func (cl *CloneConfigurationLoaderWithFlags) FindDefaultConfigFile() string
FindDefaultConfigFile looks for .pyscn.toml in the current directory
func (*CloneConfigurationLoaderWithFlags) GetDefaultCloneConfig ¶
func (cl *CloneConfigurationLoaderWithFlags) GetDefaultCloneConfig() *domain.CloneRequest
GetDefaultCloneConfig loads the default clone configuration
func (*CloneConfigurationLoaderWithFlags) LoadCloneConfig ¶
func (cl *CloneConfigurationLoaderWithFlags) LoadCloneConfig(path string) (*domain.CloneRequest, error)
LoadCloneConfig loads clone configuration from the specified path
func (*CloneConfigurationLoaderWithFlags) MergeConfig ¶
func (cl *CloneConfigurationLoaderWithFlags) MergeConfig(base *domain.CloneRequest, override *domain.CloneRequest) *domain.CloneRequest
MergeConfig merges CLI flags with configuration file, respecting explicit flags
func (*CloneConfigurationLoaderWithFlags) SaveCloneConfig ¶
func (cl *CloneConfigurationLoaderWithFlags) SaveCloneConfig(config *domain.CloneRequest, path string) error
SaveCloneConfig saves clone configuration to the specified path
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) 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 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
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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
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() *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 ConfigurationLoaderWithFlags ¶
type ConfigurationLoaderWithFlags struct {
// contains filtered or unexported fields
}
ConfigurationLoaderWithFlags wraps configuration loading with explicit flag tracking
func NewConfigurationLoaderWithFlags ¶
func NewConfigurationLoaderWithFlags(explicitFlags map[string]bool) *ConfigurationLoaderWithFlags
NewConfigurationLoaderWithFlags creates a new configuration loader that tracks explicit flags
func (*ConfigurationLoaderWithFlags) CreateConfigTemplate ¶
func (c *ConfigurationLoaderWithFlags) CreateConfigTemplate(path string) error
CreateConfigTemplate creates a template configuration file
func (*ConfigurationLoaderWithFlags) FindDefaultConfigFile ¶
func (c *ConfigurationLoaderWithFlags) FindDefaultConfigFile() string
FindDefaultConfigFile looks for .pyscn.toml in the current directory
func (*ConfigurationLoaderWithFlags) GetDefaultThresholds ¶
func (c *ConfigurationLoaderWithFlags) GetDefaultThresholds() (low, medium int)
GetDefaultThresholds returns the default complexity thresholds
func (*ConfigurationLoaderWithFlags) LoadConfig ¶
func (c *ConfigurationLoaderWithFlags) LoadConfig(path string) (*domain.ComplexityRequest, error)
LoadConfig loads configuration from the specified path
func (*ConfigurationLoaderWithFlags) LoadDefaultConfig ¶
func (c *ConfigurationLoaderWithFlags) LoadDefaultConfig() *domain.ComplexityRequest
LoadDefaultConfig loads the default configuration
func (*ConfigurationLoaderWithFlags) MergeConfig ¶
func (c *ConfigurationLoaderWithFlags) MergeConfig(base *domain.ComplexityRequest, override *domain.ComplexityRequest) *domain.ComplexityRequest
MergeConfig merges CLI flags with configuration file, respecting explicit flags
func (*ConfigurationLoaderWithFlags) ValidateConfig ¶
func (c *ConfigurationLoaderWithFlags) 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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
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() *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
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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
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() *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 DeadCodeConfigurationLoaderWithFlags ¶
type DeadCodeConfigurationLoaderWithFlags struct {
// contains filtered or unexported fields
}
DeadCodeConfigurationLoaderWithFlags wraps dead code configuration loading with explicit flag tracking
func NewDeadCodeConfigurationLoaderWithFlags ¶
func NewDeadCodeConfigurationLoaderWithFlags(explicitFlags map[string]bool) *DeadCodeConfigurationLoaderWithFlags
NewDeadCodeConfigurationLoaderWithFlags creates a new dead code configuration loader that tracks explicit flags
func (*DeadCodeConfigurationLoaderWithFlags) FindDefaultConfigFile ¶
func (cl *DeadCodeConfigurationLoaderWithFlags) FindDefaultConfigFile() string
FindDefaultConfigFile looks for .pyscn.toml in the current directory
func (*DeadCodeConfigurationLoaderWithFlags) LoadConfig ¶
func (cl *DeadCodeConfigurationLoaderWithFlags) LoadConfig(path string) (*domain.DeadCodeRequest, error)
LoadConfig loads dead code configuration from the specified path
func (*DeadCodeConfigurationLoaderWithFlags) LoadDefaultConfig ¶
func (cl *DeadCodeConfigurationLoaderWithFlags) LoadDefaultConfig() *domain.DeadCodeRequest
LoadDefaultConfig loads the default dead code configuration
func (*DeadCodeConfigurationLoaderWithFlags) MergeConfig ¶
func (cl *DeadCodeConfigurationLoaderWithFlags) MergeConfig(base *domain.DeadCodeRequest, override *domain.DeadCodeRequest) *domain.DeadCodeRequest
MergeConfig merges CLI flags with configuration file, respecting explicit flags
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
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, withIssues 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() string
FindDefaultConfigFile searches for a config file in the current directory
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() *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
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() string
FindDefaultConfigFile looks for TOML config files from the current directory upward.
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() *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
type OutputFormatResolver ¶
type OutputFormatResolver struct{}
OutputFormatResolver resolves output format and file extension from flags.
func NewOutputFormatResolver ¶
func NewOutputFormatResolver() *OutputFormatResolver
func (*OutputFormatResolver) Determine ¶
func (r *OutputFormatResolver) Determine(html, json, csv, yaml bool) (domain.OutputFormat, string, error)
Determine evaluates format flags and returns the selected format and extension. Exactly one of html/json/csv/yaml may be true; if none are true, defaults to text.
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 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() *domain.SystemAnalysisRequest
LoadDefaultConfig loads the default configuration
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
Source Files
¶
- analyze_config_loader.go
- analyze_formatter.go
- browser.go
- cbo_config_loader.go
- cbo_formatter.go
- cbo_service.go
- clone_config_loader.go
- clone_config_loader_with_flags.go
- clone_formatter.go
- clone_service.go
- complexity_service.go
- config_loader.go
- config_loader_with_flags.go
- dead_code_config_loader.go
- dead_code_config_loader_with_flags.go
- dead_code_formatter.go
- dead_code_service.go
- di_antipattern_config_loader.go
- di_antipattern_formatter.go
- di_antipattern_service.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
- responsibility_analysis.go
- system_analysis_config_loader.go
- system_analysis_formatter.go
- system_analysis_service.go