pyscn Analysis Report

Generated: 2025-12-31 21:30:25

Health Score: 66/100 (Grade: C)

Analysis Summary

Quality Scores

Complexity 65/100
Avg: 6.4, High-risk: 0
Dead Code 100/100
0 issues, 0 critical
Duplication 0/100
33.4% duplication, 37 groups
Coupling (CBO) 85/100
Avg: 1.8, High-coupling: 3/453
Dependencies 75/100
No cycles, Depth: 14
Architecture 100/100
99% compliant

File Statistics

354
Total Files
354
Analyzed Files
6.41
Avg Complexity
0
Dead Code Issues
2654
Unique Fragments
33.4%
Code Duplication
453
Total Classes
3
High Coupling (CBO)
1.77
Avg CBO

Dependencies

353
Total Modules
655
Total Dependencies
14
Max Depth
✅ 0
Circular Dependencies

Architecture

4
Violations
99.4%
Compliance
3
Layers Analyzed
655
Total Rules

Complexity Analysis

65/100
728
Total Functions
6.41
Average
15
Maximum

Top Complex Functions

Function File Complexity Nesting Depth Risk
FileProcessor.read_file_safely crackerjack/code_cleaner.py 15 5 medium
SecurityService.create_secure_token_file crackerjack/services/security.py 14 4 medium
FileIOService.read_text_file crackerjack/services/file_io_service.py 14 2 medium
AsyncTimeoutManager.with_timeout crackerjack/core/timeout_manager.py 14 3 medium
FileIOService.read_text_file_sync crackerjack/services/file_io_service.py 14 2 medium
ValidatedPattern._validate crackerjack/services/patterns/core.py 13 3 medium
PipAuditAdapter.build_command crackerjack/adapters/dependency/pip_audit.py 13 3 medium
FileSystemService.get_file_size crackerjack/services/filesystem.py 13 2 medium
main crackerjack/tools/check_added_large_files.py 13 2 medium
FileSystemService.write_file crackerjack/services/filesystem.py 13 3 medium

Showing top 10 of 728 functions

Dead Code Detection

100/100
0
Total Issues
0
Critical
0
Warnings

✓ No dead code detected

Clone Detection

0/100
2654
Unique Fragments
37
Clone Groups
0.96
Avg Similarity

Clone Groups

Code fragments grouped by similarity

Group 36 - 5 clones (Type Type-2, similarity: 1.00)

File Lines Size
crackerjack/tools/check_ast.py 48-101 54 lines
crackerjack/tools/check_json.py 46-99 54 lines
crackerjack/tools/check_toml.py 46-99 54 lines
crackerjack/tools/check_yaml.py 47-106 60 lines
crackerjack/tools/format_json.py 66-124 59 lines

Group 9 - 3 clones (Type Type-2, similarity: 1.00)

File Lines Size
crackerjack/adapters/sast/pyscn.py 60-400 341 lines
crackerjack/adapters/type/pyrefly.py 57-396 340 lines
crackerjack/adapters/type/ty.py 57-396 340 lines

Group 26 - 4 clones (Type Type-2, similarity: 1.00)

File Lines Size
crackerjack/services/ai/predictive_analytics.py 60-74 15 lines
crackerjack/services/ai/predictive_analytics.py 113-134 22 lines
crackerjack/services/predictive_analytics.py 63-77 15 lines
crackerjack/services/predictive_analytics.py 116-137 22 lines

Group 17 - 4 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/core/retry.py 122-164 43 lines
crackerjack/core/retry.py 167-209 43 lines
crackerjack/utils/retry_utils.py 122-164 43 lines
crackerjack/utils/retry_utils.py 167-209 43 lines

Group 24 - 4 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/models/config.py 179-190 12 lines
crackerjack/models/config.py 212-223 12 lines
crackerjack/models/pydantic_models.py 142-153 12 lines
crackerjack/models/pydantic_models.py 170-181 12 lines

Group 28 - 3 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/services/anomaly_detector.py 164-208 45 lines
crackerjack/services/changelog_automation.py 69-106 38 lines
crackerjack/services/quality/anomaly_detector.py 164-208 45 lines

Group 2 - 7 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/adapters/dependency/pip_audit.py 286-324 39 lines
crackerjack/adapters/sast/bandit.py 200-282 83 lines
crackerjack/adapters/sast/pyscn.py 196-263 68 lines
crackerjack/adapters/sast/semgrep.py 125-171 47 lines
crackerjack/adapters/security/gitleaks.py 207-298 92 lines
crackerjack/adapters/type/pyrefly.py 187-259 73 lines
crackerjack/adapters/type/ty.py 187-259 73 lines

Group 35 - 8 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/services/pattern_detector.py 108-150 43 lines
crackerjack/services/pattern_detector.py 184-237 54 lines
crackerjack/services/pattern_detector.py 276-323 48 lines
crackerjack/services/pattern_detector.py 325-380 56 lines
crackerjack/services/quality/pattern_detector.py 109-151 43 lines
crackerjack/services/quality/pattern_detector.py 185-238 54 lines
crackerjack/services/quality/pattern_detector.py 277-324 48 lines
crackerjack/services/quality/pattern_detector.py 326-381 56 lines

Group 11 - 3 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/agents/dry_agent.py 444-486 43 lines
crackerjack/agents/performance_agent.py 224-272 49 lines
crackerjack/agents/refactoring_agent.py 445-495 51 lines

Group 16 - 3 clones (Type Type-2, similarity: 0.99)

File Lines Size
crackerjack/core/performance_monitor.py 107-120 14 lines
crackerjack/core/performance_monitor.py 122-135 14 lines
crackerjack/core/performance_monitor.py 137-161 25 lines

Showing top 10 of 37 clone groups

Class Coupling

85/100

Coupling Between Objects (CBO) metrics

453
Total Classes
3
High Risk Classes
1.77
Average CBO
15
Max CBO

Most Dependent Classes

Class File CBO Risk Level Dependent Classes
CrackerjackSettings crackerjack/config/settings.py 15 high AdvancedSettings, GlobalLockSettings, CleaningSettings, PublishSettings, ProgressSettings, Settings, ExecutionSettings, CleanupSettings, MCPServerSettings, ZubanLSPSettings, ConsoleSettings, HookSettings, TestSettings, GitSettings, AISettings
WorkflowOptions crackerjack/models/pydantic_models.py 13 high BaseModel, CleaningConfig, HookConfig, PublishConfig, GitConfig, CleanupConfig, ZubanLSPConfig, TestConfig, AIConfig, ExecutionConfig, ProgressConfig, AdvancedConfig, MCPServerConfig
WorkflowOptions crackerjack/models/config.py 13 high TestConfig, GitConfig, AIConfig, ExecutionConfig, Any, CleaningConfig, HookConfig, PublishConfig, ProgressConfig, CleanupConfig, AdvancedConfig, MCPServerConfig, ZubanLSPConfig
CodeCleaner crackerjack/code_cleaner.py 9 medium CleaningPipeline, BaseModel, FileProcessor, CleaningErrorHandler, PackageCleaningResult, WhitespaceStep, FormattingStep, CleaningResult, BackupMetadata
PredictiveAnalyticsEngine crackerjack/services/ai/predictive_analytics.py 8 medium PredictorProtocol, TrendAnalysis, Prediction, MovingAveragePredictor, LinearTrendPredictor, datetime, SeasonalPredictor, CapacityForecast
EnhancedQualityBaselineService crackerjack/services/quality/quality_baseline_enhanced.py 7 medium SystemHealthStatus, DashboardState, QualityBaselineService, QualityAlert, QualityTrend, QualityReport, UnifiedMetrics
QAResult crackerjack/models/qa_results.py 7 medium Path, datetime, Any, BaseModel, UUID, QACheckType, QAResultStatus
PredictiveAnalyticsEngine crackerjack/services/predictive_analytics.py 7 medium MovingAveragePredictor, LinearTrendPredictor, SeasonalPredictor, CapacityForecast, datetime, TrendAnalysis, Prediction
BoundedStatusOperations crackerjack/services/bounded_status_operations.py 6 medium ServiceProtocol, OperationMetrics, OperationState, OperationLimits, OperationLimitExceededError, BoundedStatusOperationsProtocol
PatternDetector crackerjack/services/quality/pattern_detector.py 6 medium AntiPatternConfig, ComplexityVisitor, AntiPattern, PerformanceVisitor, SecurityVisitor, ImportVisitor

Showing top 10 of 453 classes

Module Dependencies

75/100

Project-wide module dependency graph metrics

353
Total Modules
655
Total Dependencies
14
Max Depth
✅ 0
Circular Dependencies

Circular Dependencies

✅ No circular dependencies detected

All modules have acyclic dependency relationships.

Longest Dependency Chains

# Depth Path
1 9 crackerjack.managers.hook_manager → crackerjack.executors.lsp_aware_hook_executor → crackerjack.executors.tool_proxy → crackerjack.mcp.tools.core_tools → crackerjack.services.initialization → crackerjack.services.filesystem → crackerjack.models.protocols → crackerjack.config.hooks → crackerjack.config.tool_commands
2 8 crackerjack.cli.facade → crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns → crackerjack.decorators.helpers
3 8 crackerjack.cli.facade → crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns → crackerjack.errors
4 8 crackerjack.cli.facade → crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns → crackerjack.mcp.cache
5 8 crackerjack.managers.hook_manager → crackerjack.executors.lsp_aware_hook_executor → crackerjack.executors.tool_proxy → crackerjack.mcp.tools.core_tools → crackerjack.services.initialization → crackerjack.services.filesystem → crackerjack.models.protocols → crackerjack.config.hooks
6 7 crackerjack.cli.facade → crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns
7 7 crackerjack.managers.hook_manager → crackerjack.executors.lsp_aware_hook_executor → crackerjack.executors.tool_proxy → crackerjack.mcp.tools.core_tools → crackerjack.services.initialization → crackerjack.services.filesystem → crackerjack.errors
8 7 crackerjack.managers.hook_manager → crackerjack.executors.lsp_aware_hook_executor → crackerjack.executors.tool_proxy → crackerjack.mcp.tools.core_tools → crackerjack.services.initialization → crackerjack.services.filesystem → crackerjack.models.protocols
9 7 crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns → crackerjack.errors
10 7 crackerjack.mcp.server → crackerjack.mcp.server_core → crackerjack.mcp.context → crackerjack.services.secure_path_utils → crackerjack.services.regex_patterns → crackerjack.decorators.patterns → crackerjack.mcp.cache

Architecture Validation

100/100
3
Layers Analyzed
655
Total Rules
4
Violations
99.4%
Compliance

Top Rule Violations

Severity Rule From To
error domain !> application crackerjack.models.config crackerjack.config.settings
error domain !> application crackerjack.models.config crackerjack.config
error domain !> application crackerjack.models.protocols crackerjack.config.hooks
error domain !> application crackerjack.models.protocols crackerjack.config.settings