gitflow-analytics 3.3.0__tar.gz → 3.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/PKG-INFO +1 -1
- gitflow_analytics-3.5.2/docs/REFACTOR.md +470 -0
- gitflow_analytics-3.5.2/docs/guides/identity-resolution-enhanced.md +271 -0
- gitflow_analytics-3.5.2/docs/guides/interactive-launcher.md +216 -0
- gitflow_analytics-3.5.2/docs/guides/managing-aliases.md +425 -0
- gitflow_analytics-3.5.2/docs/quick-reference/launcher-and-identity.md +189 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/_version.py +1 -1
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/cli.py +517 -15
- gitflow_analytics-3.5.2/src/gitflow_analytics/cli_wizards/__init__.py +10 -0
- gitflow_analytics-3.5.2/src/gitflow_analytics/cli_wizards/install_wizard.py +1181 -0
- gitflow_analytics-3.5.2/src/gitflow_analytics/cli_wizards/run_launcher.py +433 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/__init__.py +3 -0
- gitflow_analytics-3.5.2/src/gitflow_analytics/config/aliases.py +306 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/loader.py +35 -1
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/schema.py +13 -0
- gitflow_analytics-3.5.2/src/gitflow_analytics/constants.py +75 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/cache.py +7 -3
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/data_fetcher.py +66 -30
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/git_timeout_wrapper.py +6 -4
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/progress.py +2 -4
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/subprocess_git.py +31 -5
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/identity_llm/analysis_pass.py +13 -3
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/identity_llm/analyzer.py +14 -2
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/identity_llm/models.py +7 -1
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/openai_client.py +5 -3
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/config.py +6 -6
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/extractors/dependency_checker.py +14 -14
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/extractors/secret_detector.py +8 -14
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/extractors/vulnerability_scanner.py +9 -9
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/llm_analyzer.py +10 -10
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/security_analyzer.py +17 -17
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/analysis_progress_screen.py +1 -1
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/ui/progress_display.py +36 -29
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/verify_activity.py +23 -26
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/PKG-INFO +1 -1
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/SOURCES.txt +11 -48
- gitflow_analytics-3.3.0/docs/CLEANUP_SUMMARY.md +0 -184
- gitflow_analytics-3.3.0/docs/PROJECT_CLEANUP_REPORT.md +0 -233
- gitflow_analytics-3.3.0/docs/STORY_POINTS_CONFIG_SUMMARY.md +0 -107
- gitflow_analytics-3.3.0/docs/_archive/analysis-files/ewtn-critical-security-report.md +0 -180
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_085239_236.md +0 -100
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_114233_697.md +0 -78
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_115330_511.md +0 -80
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_120516_669.md +0 -78
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_124906_951.md +0 -87
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_175540_671.md +0 -78
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250915_214023_300.md +0 -95
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_engineer_20250916_130622_510.md +0 -76
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_ops_20250915_123323_419.md +0 -94
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_ops_20250915_134446_128.md +0 -96
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_ops_20250915_184656_725.md +0 -93
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_research_20250915_091233_023.md +0 -77
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_research_20250915_100404_339.md +0 -77
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/agent_research_20250915_110606_413.md +0 -86
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/system_prompt_20250915_084833_641.md +0 -2289
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/system_prompt_20250915_090830_660.md +0 -2303
- gitflow_analytics-3.3.0/docs/_archive/old-logs/prompts/system_prompt_20250916_130545_822.md +0 -2289
- gitflow_analytics-3.3.0/docs/_archive/old-reports/output/database_qualitative_report_20250630_20250824.md +0 -47
- gitflow_analytics-3.3.0/docs/_archive/old-reports/output/narrative_report_20250630_20250824.md +0 -142
- gitflow_analytics-3.3.0/docs/_archive/old-reports/reports-24week/database_qualitative_report_20250303_20250817.md +0 -55
- gitflow_analytics-3.3.0/docs/_archive/old-reports/reports-24week/narrative_report_20250303_20250817.md +0 -157
- gitflow_analytics-3.3.0/docs/_archive/old-reports/test-ewtn-reports/narrative_report_20250810.md +0 -70
- gitflow_analytics-3.3.0/docs/_archive/old-reports/test-reports/database_qualitative_report_20250908_20250914.md +0 -53
- gitflow_analytics-3.3.0/docs/_archive/old-reports/test-reports/narrative_report_20250908_20250914.md +0 -182
- gitflow_analytics-3.3.0/docs/_archive/old-reports/test-weekly-reports/database_qualitative_report_20250623_20250817.md +0 -67
- gitflow_analytics-3.3.0/docs/_archive/old-reports/test-weekly-reports/narrative_report_20250623_20250817.md +0 -169
- gitflow_analytics-3.3.0/docs/_archive/temp-files/FIX_SUMMARY.md +0 -147
- gitflow_analytics-3.3.0/docs/guides/LLM_CLASSIFICATION_GUIDE.md +0 -164
- gitflow_analytics-3.3.0/src/gitflow_analytics/security/reports/__init__.py +0 -5
- gitflow_analytics-3.3.0/src/gitflow_analytics/security/reports/security_report.py +0 -358
- gitflow_analytics-3.3.0/tests/debug_bulk_exists.py +0 -62
- gitflow_analytics-3.3.0/tests/debug_commit_story_points.py +0 -145
- gitflow_analytics-3.3.0/tests/debug_database_storage.py +0 -228
- gitflow_analytics-3.3.0/tests/debug_jira_enrichment.py +0 -110
- gitflow_analytics-3.3.0/tests/debug_story_points.py +0 -121
- gitflow_analytics-3.3.0/tests/test_branch_analysis.py +0 -193
- gitflow_analytics-3.3.0/tests/test_branch_direct.py +0 -129
- gitflow_analytics-3.3.0/tests/test_branch_fetching.py +0 -187
- gitflow_analytics-3.3.0/tests/test_branch_simple.py +0 -89
- gitflow_analytics-3.3.0/tests/test_branch_verification.py +0 -183
- gitflow_analytics-3.3.0/tests/test_circuit_breaker.py +0 -191
- gitflow_analytics-3.3.0/tests/tui/test_tui_basic.py +0 -114
- gitflow_analytics-3.3.0/tests/tui/test_tui_screenshots.py +0 -86
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/CHANGELOG.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/CLAUDE.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/LICENSE +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/MANIFEST.in +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/SECURITY.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/STRUCTURE.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/_archive/temp-files/PROGRESS_TRACKING_FIXES.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/_archive/temp-files/SYNTAX_ERROR_FIX.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/architecture/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/architecture/branch-analysis-optimization.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/architecture/caching-strategy.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/architecture/llm-classifier-refactoring.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/architecture/ml-pipeline.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/configuration/configuration.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/deployment/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/circuit-breaker-implementation.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/commit-classification-design.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/git_pm_correlation_design.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/platform-agnostic-pm-framework.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/design/qualitative_data_extraction.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/developer/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/developer/contributing.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/developer/development-setup.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/developer/training-guide.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/examples/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/getting-started/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/getting-started/first-analysis.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/getting-started/installation.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/getting-started/quickstart.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/guides/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/guides/chatgpt-setup.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/guides/ml-categorization.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/guides/troubleshooting.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/reference/README.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/reference/cache-system.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/reference/cli-commands.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/reference/configuration-schema.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/docs/reference/json-export-schema.md +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/pyproject.toml +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/setup.cfg +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/batch_classifier.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/classifier.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/feature_extractor.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/linguist_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/classification/model.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/errors.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/profiles.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/repository.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config/validator.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/config.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/branch_mapper.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/git_auth.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/identity.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/metrics_storage.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/core/schema_version.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/extractors/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/extractors/base.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/extractors/ml_tickets.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/extractors/story_points.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/extractors/tickets.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/identity_llm/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/integrations/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/integrations/github_integration.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/integrations/jira_integration.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/integrations/orchestrator.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/metrics/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/metrics/activity_scoring.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/metrics/branch_health.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/metrics/dora.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/models/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/models/database.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/adapters/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/adapters/jira_adapter.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/base.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/models.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/orchestrator.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/pm_framework/registry.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/chatgpt_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/change_type.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/domain_classifier.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/intent_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/base.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/batch_processor.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/cache.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/cost_tracker.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/prompts.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm/response_parser.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/llm_commit_classifier.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/classifiers/risk_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/core/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/core/llm_fallback.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/core/nlp_engine.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/core/pattern_cache.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/core/processor.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/enhanced_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/example_enhanced_usage.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/models/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/models/schemas.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/utils/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/utils/batch_processor.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/utils/cost_tracker.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/utils/metrics.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/qualitative/utils/text_processing.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/analytics_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/base.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/branch_health_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/classification_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/cli_integration.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/csv_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/data_models.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/database_report_generator.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/example_usage.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/factory.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/formatters.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/html_generator.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/interfaces.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/json_exporter.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/narrative_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/story_point_correlation.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/reports/weekly_trends_writer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/security/extractors/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/training/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/training/model_loader.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/training/pipeline.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/app.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/progress_adapter.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/configuration_screen.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/loading_screen.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/main_screen.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/screens/results_screen.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/widgets/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/widgets/data_table.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/widgets/export_modal.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/tui/widgets/progress_widget.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics/ui/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/dependency_links.txt +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/entry_points.txt +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/requires.txt +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/src/gitflow_analytics.egg-info/top_level.txt +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/conftest.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/test_analyzer.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/test_cache.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/test_data_fetcher.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/test_identity.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/core/test_progress.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/extractors/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/integrations/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/metrics/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/models/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/qualitative/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/qualitative/test_basic_integration.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/reports/__init__.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_atomic_caching.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_classification_system.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_cli.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_config.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_config_extends.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_config_profiles.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_config_story_points.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_jira_connection.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_llm_commit_classification.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_march_2025_comparison.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_metrics.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_ml_accuracy.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_ml_components.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_ml_comprehensive.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_ml_integration.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_pm_env_resolution.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_report_abstraction.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_reports.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_story_points_analysis.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_training_pipeline.py +0 -0
- {gitflow_analytics-3.3.0 → gitflow_analytics-3.5.2}/tests/test_two_step_process.py +0 -0
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
# GitFlow Analytics Refactoring Guide
|
|
2
|
+
|
|
3
|
+
**Last Updated**: 2025-10-06
|
|
4
|
+
**Current Code Quality**: B- (improving from C+)
|
|
5
|
+
**Target Code Quality**: A-
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
This document tracks ongoing refactoring efforts to improve code quality, maintainability, and safety in the GitFlow Analytics project. We follow an incremental, risk-managed approach with comprehensive testing at each phase.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Refactoring Phases
|
|
14
|
+
|
|
15
|
+
### Phase 1: Critical Safety Fixes ✅ COMPLETED
|
|
16
|
+
|
|
17
|
+
**Objective**: Eliminate critical safety issues and add foundational type hints
|
|
18
|
+
|
|
19
|
+
**Completed Items:**
|
|
20
|
+
1. **Fixed 5 Bare Exception Handlers** (CRITICAL)
|
|
21
|
+
- `subprocess_git.py`: 2 occurrences → specific TimeoutExpired, OSError handlers
|
|
22
|
+
- `data_fetcher.py`: 2 occurrences → proper exception types with logging
|
|
23
|
+
- `progress_display.py`: 1 occurrence → ImportError handling
|
|
24
|
+
- **Impact**: Prevents silent failures, allows Ctrl+C interruption
|
|
25
|
+
|
|
26
|
+
2. **Added Type Hints to Critical Paths** (HIGH)
|
|
27
|
+
- `GitDataFetcher.__init__`: Full parameter type annotations
|
|
28
|
+
- Helper functions: Return type annotations (fetch_branch_commits, get_diff_output)
|
|
29
|
+
- CLI helpers: format_option_help with proper types
|
|
30
|
+
- **Impact**: Better IDE support, early type error detection
|
|
31
|
+
|
|
32
|
+
3. **Enhanced Error Logging** (MEDIUM)
|
|
33
|
+
- Include repository paths in error messages
|
|
34
|
+
- Log cleanup failures at appropriate levels (debug/warning)
|
|
35
|
+
- Provide actionable debugging information
|
|
36
|
+
- **Impact**: Easier troubleshooting, better debugging experience
|
|
37
|
+
|
|
38
|
+
**Commits:**
|
|
39
|
+
- `bbfb375` - refactor: fix bare exception handlers and add type hints
|
|
40
|
+
|
|
41
|
+
**Testing:**
|
|
42
|
+
- ✅ 201/201 tests passing
|
|
43
|
+
- ✅ Black formatting applied
|
|
44
|
+
- ✅ No new linting issues
|
|
45
|
+
- ✅ Zero breaking changes
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Phase 2: Constants Extraction ✅ COMPLETED
|
|
50
|
+
|
|
51
|
+
**Objective**: Eliminate magic numbers and centralize configuration values
|
|
52
|
+
|
|
53
|
+
**Completed Items:**
|
|
54
|
+
1. **Created `src/gitflow_analytics/constants.py`** (NEW FILE)
|
|
55
|
+
- `Timeouts`: 11 timeout constants (GIT_FETCH=30, GIT_BRANCH_ITERATION=15, etc.)
|
|
56
|
+
- `BatchSizes`: 5 batch size constants (COMMIT_STORAGE=1000, TICKET_FETCH=50, etc.)
|
|
57
|
+
- `CacheTTL`: 2 TTL constants (ONE_WEEK_HOURS=168)
|
|
58
|
+
- `Thresholds`: 2 threshold constants (CACHE_HIT_RATE_GOOD=50)
|
|
59
|
+
- `Estimations`: 2 estimation constants
|
|
60
|
+
|
|
61
|
+
2. **Updated 3 Core Files**
|
|
62
|
+
- `data_fetcher.py`: 13 magic numbers replaced
|
|
63
|
+
- `git_timeout_wrapper.py`: 4 timeout values now use Timeouts class
|
|
64
|
+
- `cache.py`: 3 values replaced (TTL, batch size, threshold)
|
|
65
|
+
|
|
66
|
+
**Commits:**
|
|
67
|
+
- `f83a6bd` - refactor: extract magic numbers to centralized constants module
|
|
68
|
+
|
|
69
|
+
**Benefits:**
|
|
70
|
+
- ✅ All config values in one location
|
|
71
|
+
- ✅ Descriptive names explain purpose
|
|
72
|
+
- ✅ Easy global adjustments
|
|
73
|
+
- ✅ Type safety for all constants
|
|
74
|
+
|
|
75
|
+
**Testing:**
|
|
76
|
+
- ✅ All tests passing
|
|
77
|
+
- ✅ Constants import correctly
|
|
78
|
+
- ✅ No behavioral changes
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Phase 3: Type System Enhancement 🔄 IN PROGRESS
|
|
83
|
+
|
|
84
|
+
**Objective**: Add comprehensive type hints and create typed data structures
|
|
85
|
+
|
|
86
|
+
**Planned Items:**
|
|
87
|
+
|
|
88
|
+
1. **Create TypedDict for CommitData** (HIGH PRIORITY)
|
|
89
|
+
```python
|
|
90
|
+
from typing import TypedDict
|
|
91
|
+
from datetime import datetime
|
|
92
|
+
|
|
93
|
+
class CommitData(TypedDict, total=False):
|
|
94
|
+
"""Structure for commit data dictionaries."""
|
|
95
|
+
hash: str
|
|
96
|
+
commit_hash_short: str
|
|
97
|
+
message: str
|
|
98
|
+
author_name: str
|
|
99
|
+
author_email: str
|
|
100
|
+
timestamp: datetime
|
|
101
|
+
branch: str
|
|
102
|
+
project_key: str
|
|
103
|
+
repo_path: str
|
|
104
|
+
is_merge: bool
|
|
105
|
+
files_changed: list[str]
|
|
106
|
+
files_changed_count: int
|
|
107
|
+
lines_added: int
|
|
108
|
+
lines_deleted: int
|
|
109
|
+
ticket_references: list[str]
|
|
110
|
+
story_points: Optional[int]
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
2. **Add Type Hints to Cache Methods** (MEDIUM PRIORITY)
|
|
114
|
+
- `cache.py::get_cached_commit()` → `Optional[CachedCommit]`
|
|
115
|
+
- `cache.py::cache_commit()` → `None`
|
|
116
|
+
- `cache.py::get_cache_stats()` → `dict[str, Any]`
|
|
117
|
+
|
|
118
|
+
3. **Add Type Hints to Remaining Public APIs** (MEDIUM PRIORITY)
|
|
119
|
+
- Focus on public methods first
|
|
120
|
+
- Add return types to all `__init__` methods
|
|
121
|
+
- Use `from __future__ import annotations` for forward references
|
|
122
|
+
|
|
123
|
+
**Estimated Effort**: 2-3 days
|
|
124
|
+
**Risk Level**: LOW (additive changes only)
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Phase 4: Architecture Improvements 📋 PLANNED
|
|
129
|
+
|
|
130
|
+
**Objective**: Reduce complexity and improve code organization
|
|
131
|
+
|
|
132
|
+
**High Priority Items:**
|
|
133
|
+
|
|
134
|
+
1. **Split `cli.py` into Modules** (CRITICAL - DEFERRED)
|
|
135
|
+
- **Current**: 5,365 lines in single file
|
|
136
|
+
- **Target**: Modular structure with command modules
|
|
137
|
+
```
|
|
138
|
+
src/gitflow_analytics/cli/
|
|
139
|
+
__init__.py # Main CLI group
|
|
140
|
+
commands/
|
|
141
|
+
__init__.py
|
|
142
|
+
analyze_command.py # analyze subcommand
|
|
143
|
+
fetch_command.py # fetch subcommand
|
|
144
|
+
identity_commands.py # identity management
|
|
145
|
+
cache_commands.py # cache operations
|
|
146
|
+
training_commands.py # ML training
|
|
147
|
+
tui_command.py # TUI launcher
|
|
148
|
+
error_handlers.py # ImprovedErrorHandler class
|
|
149
|
+
formatters.py # RichHelpFormatter class
|
|
150
|
+
utils.py # Helper functions
|
|
151
|
+
```
|
|
152
|
+
- **Estimated Effort**: 5-8 days
|
|
153
|
+
- **Risk Level**: HIGH (requires comprehensive testing)
|
|
154
|
+
|
|
155
|
+
2. **Extract `analyze()` into AnalysisPipeline** (CRITICAL - DEFERRED)
|
|
156
|
+
- **Current**: 3,446-line mega-function with complexity 525
|
|
157
|
+
- **Target**: Pipeline with discrete stages
|
|
158
|
+
```python
|
|
159
|
+
class AnalysisPipeline:
|
|
160
|
+
def run(self, weeks, options):
|
|
161
|
+
self._validate_configuration()
|
|
162
|
+
self._authenticate_services()
|
|
163
|
+
if options.clear_cache:
|
|
164
|
+
self._clear_cache()
|
|
165
|
+
raw_data = self._fetch_data(weeks)
|
|
166
|
+
analysis_results = self._analyze_data(raw_data)
|
|
167
|
+
self._generate_reports(analysis_results, options)
|
|
168
|
+
```
|
|
169
|
+
- **Estimated Effort**: 5-8 days
|
|
170
|
+
- **Risk Level**: HIGH (core business logic)
|
|
171
|
+
|
|
172
|
+
3. **Consolidate Progress Reporting** (HIGH PRIORITY)
|
|
173
|
+
- **Current**: 3 different progress systems
|
|
174
|
+
- **Target**: Single unified `ProgressReporter` interface
|
|
175
|
+
- **Estimated Effort**: 1-2 days
|
|
176
|
+
- **Risk Level**: MEDIUM
|
|
177
|
+
|
|
178
|
+
**Medium Priority Items:**
|
|
179
|
+
|
|
180
|
+
4. **Simplify Glob Pattern Matching** (161 lines → use pathspec library)
|
|
181
|
+
5. **Centralize Environment Variables** (Use EnvironmentConfig dataclass)
|
|
182
|
+
6. **Fix Thread-Local Storage Pattern** (Use explicit context managers)
|
|
183
|
+
7. **Improve Cache Configuration Hash** (Deterministic serialization)
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Code Quality Metrics
|
|
188
|
+
|
|
189
|
+
### Current Status (as of 2025-10-06)
|
|
190
|
+
|
|
191
|
+
| Metric | Current | Target | Status |
|
|
192
|
+
|--------|---------|--------|--------|
|
|
193
|
+
| **Code Quality Grade** | B- | A- | 🟡 Improving |
|
|
194
|
+
| **Lines of Code** | 68,175 | <60,000 | 🔴 Needs work |
|
|
195
|
+
| **Largest File** | 5,365 (cli.py) | <2,500 | 🔴 Critical |
|
|
196
|
+
| **Bare Exceptions** | 0 | 0 | 🟢 Excellent |
|
|
197
|
+
| **High Complexity Functions** | 124 (8.1%) | <5% | 🟡 Improving |
|
|
198
|
+
| **Long Functions (>50 lines)** | 314 (20.5%) | <15% | 🟡 Improving |
|
|
199
|
+
| **Large Files (>1000 lines)** | 15 (11.4%) | <5% | 🔴 Needs work |
|
|
200
|
+
| **Functions with >5 params** | 61 (4.0%) | <3% | 🟡 Improving |
|
|
201
|
+
| **Large Classes (>500 lines)** | 33 (13.1%) | <10% | 🟡 Improving |
|
|
202
|
+
| **Type Hint Coverage** | ~50% | >90% | 🟡 Improving |
|
|
203
|
+
| **Test Coverage** | 30% | >80% | 🔴 Needs work |
|
|
204
|
+
|
|
205
|
+
### Complexity Distribution
|
|
206
|
+
|
|
207
|
+
**Top 5 Most Complex Functions:**
|
|
208
|
+
1. `cli.py::analyze()` - Complexity: 525 (Target: <10)
|
|
209
|
+
2. `data_fetcher.py::fetch_repository_data()` - Complexity: ~20
|
|
210
|
+
3. `cache.py::bulk_store_commits()` - Complexity: ~15
|
|
211
|
+
4. Multiple functions: 10-15 complexity range
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Critical Issues Remaining
|
|
216
|
+
|
|
217
|
+
### Priority 1: God Classes
|
|
218
|
+
|
|
219
|
+
1. **cli.py** (5,365 lines)
|
|
220
|
+
- Contains 19+ distinct functions
|
|
221
|
+
- Mixed concerns: commands, business logic, error handling
|
|
222
|
+
- Single `analyze()` function is 3,446 lines
|
|
223
|
+
- **Recommendation**: DEFER until Phase 4
|
|
224
|
+
|
|
225
|
+
2. **GitAnalysisCache** (1,672 lines in cache.py)
|
|
226
|
+
- Too many responsibilities
|
|
227
|
+
- **Recommendation**: Extract query builders, validators
|
|
228
|
+
|
|
229
|
+
3. **GitDataFetcher** (2,224 lines in data_fetcher.py)
|
|
230
|
+
- Complex fetch/store/analyze logic
|
|
231
|
+
- **Recommendation**: Extract separate classes for fetch/store
|
|
232
|
+
|
|
233
|
+
### Priority 2: Missing Abstractions
|
|
234
|
+
|
|
235
|
+
1. **No Service Layer**
|
|
236
|
+
- Business logic mixed with presentation
|
|
237
|
+
- **Recommendation**: Extract service objects
|
|
238
|
+
|
|
239
|
+
2. **No Repository Pattern**
|
|
240
|
+
- Direct database access everywhere
|
|
241
|
+
- **Recommendation**: Create repository classes
|
|
242
|
+
|
|
243
|
+
3. **No Domain Events**
|
|
244
|
+
- Tight coupling between modules
|
|
245
|
+
- **Recommendation**: Event-driven architecture for decoupling
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## Testing Strategy
|
|
250
|
+
|
|
251
|
+
### For Each Refactoring Phase:
|
|
252
|
+
|
|
253
|
+
1. **Characterization Tests**
|
|
254
|
+
- Add tests to lock in current behavior BEFORE changes
|
|
255
|
+
- Document expected behavior explicitly
|
|
256
|
+
|
|
257
|
+
2. **Mutation Testing**
|
|
258
|
+
- Verify test coverage is adequate
|
|
259
|
+
- Use `mutmut` or similar tools
|
|
260
|
+
|
|
261
|
+
3. **Integration Tests**
|
|
262
|
+
- Run full test suite after each phase
|
|
263
|
+
- Test with real EWTN dataset (97 repos)
|
|
264
|
+
|
|
265
|
+
4. **Performance Regression Testing**
|
|
266
|
+
- Benchmark cache operations
|
|
267
|
+
- Monitor analysis time for large repos
|
|
268
|
+
|
|
269
|
+
### Test Coverage Goals
|
|
270
|
+
|
|
271
|
+
| Component | Current | Target | Priority |
|
|
272
|
+
|-----------|---------|--------|----------|
|
|
273
|
+
| Core (cache, fetcher, analyzer) | 30% | 80% | HIGH |
|
|
274
|
+
| CLI | ~10% | 60% | MEDIUM |
|
|
275
|
+
| Integrations | 25% | 70% | HIGH |
|
|
276
|
+
| Reports | 35% | 70% | MEDIUM |
|
|
277
|
+
| Utils | 40% | 80% | LOW |
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Refactoring Principles
|
|
282
|
+
|
|
283
|
+
### Do's ✅
|
|
284
|
+
|
|
285
|
+
1. **Make Small, Incremental Changes**
|
|
286
|
+
- Each commit should be independently reviewable
|
|
287
|
+
- Each phase should be independently testable
|
|
288
|
+
|
|
289
|
+
2. **Test Before and After**
|
|
290
|
+
- Ensure all tests pass before starting
|
|
291
|
+
- Verify tests still pass after changes
|
|
292
|
+
|
|
293
|
+
3. **Maintain Backward Compatibility**
|
|
294
|
+
- Don't break public APIs
|
|
295
|
+
- Don't change database schemas without migrations
|
|
296
|
+
|
|
297
|
+
4. **Document Changes**
|
|
298
|
+
- Update docstrings with type hints
|
|
299
|
+
- Add comments explaining complex logic
|
|
300
|
+
- Update CHANGELOG.md
|
|
301
|
+
|
|
302
|
+
5. **Review Impact**
|
|
303
|
+
- Check for breaking changes
|
|
304
|
+
- Update dependent code
|
|
305
|
+
- Test edge cases
|
|
306
|
+
|
|
307
|
+
### Don'ts ❌
|
|
308
|
+
|
|
309
|
+
1. **Don't Mix Refactoring with Features**
|
|
310
|
+
- Refactoring commits should be pure refactorings
|
|
311
|
+
- Feature commits should be separate
|
|
312
|
+
|
|
313
|
+
2. **Don't Skip Tests**
|
|
314
|
+
- Every refactoring must maintain test coverage
|
|
315
|
+
- Add tests if coverage decreases
|
|
316
|
+
|
|
317
|
+
3. **Don't Rush Large Refactorings**
|
|
318
|
+
- High-risk changes need extensive testing
|
|
319
|
+
- Consider feature flags for gradual rollout
|
|
320
|
+
|
|
321
|
+
4. **Don't Ignore Performance**
|
|
322
|
+
- Benchmark before and after
|
|
323
|
+
- Watch for N+1 queries or memory leaks
|
|
324
|
+
|
|
325
|
+
5. **Don't Optimize Prematurely**
|
|
326
|
+
- Focus on correctness and maintainability first
|
|
327
|
+
- Optimize only when profiling shows bottlenecks
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Session History
|
|
332
|
+
|
|
333
|
+
### 2025-10-06: Initial Refactoring Session
|
|
334
|
+
|
|
335
|
+
**Completed:**
|
|
336
|
+
- ✅ Phase 1: Critical safety fixes (bare exceptions, type hints)
|
|
337
|
+
- ✅ Phase 2: Constants extraction
|
|
338
|
+
- ✅ Fixed remote branch analysis bug
|
|
339
|
+
- ✅ Added pre-flight git authentication
|
|
340
|
+
|
|
341
|
+
**Commits:**
|
|
342
|
+
1. `78e9c2d` - feat: add pre-flight git authentication and enhanced error reporting
|
|
343
|
+
2. `4625cc6` - style: apply Black formatting and auto-fix Ruff linting issues
|
|
344
|
+
3. `5ccca16` - fix: resolve remote branch analysis by preserving full branch references
|
|
345
|
+
4. `bbfb375` - refactor: fix bare exception handlers and add type hints
|
|
346
|
+
5. `f83a6bd` - refactor: extract magic numbers to centralized constants module
|
|
347
|
+
|
|
348
|
+
**Impact:**
|
|
349
|
+
- Code quality: C+ → B-
|
|
350
|
+
- Type coverage: ~40% → ~50% (critical paths)
|
|
351
|
+
- Magic numbers: Reduced by 20+
|
|
352
|
+
- Bare exceptions: 5 → 0
|
|
353
|
+
- Safety: Significantly improved
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
## Next Steps
|
|
358
|
+
|
|
359
|
+
### Immediate (This Week)
|
|
360
|
+
1. ✅ Complete Phase 2 constants extraction
|
|
361
|
+
2. 🔄 Start Phase 3 type system enhancement
|
|
362
|
+
3. 📋 Create TypedDict for CommitData
|
|
363
|
+
4. 📋 Add type hints to cache methods
|
|
364
|
+
|
|
365
|
+
### Short Term (This Month)
|
|
366
|
+
1. 📋 Complete Phase 3 type system
|
|
367
|
+
2. 📋 Consolidate progress reporting
|
|
368
|
+
3. 📋 Extract environment configuration
|
|
369
|
+
4. 📋 Improve glob pattern matching
|
|
370
|
+
|
|
371
|
+
### Long Term (Next Quarter)
|
|
372
|
+
1. 📋 Split cli.py into modules (Phase 4)
|
|
373
|
+
2. 📋 Extract analyze() mega-function
|
|
374
|
+
3. 📋 Implement service layer pattern
|
|
375
|
+
4. 📋 Increase test coverage to 80%
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Resources
|
|
380
|
+
|
|
381
|
+
### Tools Used
|
|
382
|
+
- **Black**: Code formatting
|
|
383
|
+
- **Ruff**: Linting and style checking
|
|
384
|
+
- **mypy**: Type checking
|
|
385
|
+
- **pytest**: Testing framework
|
|
386
|
+
- **Code Analyzer Agent**: Pattern detection
|
|
387
|
+
- **Python Engineer Agent**: Refactoring implementation
|
|
388
|
+
|
|
389
|
+
### References
|
|
390
|
+
- [Code Analysis Report](./code_analysis_report.md) - Comprehensive analysis findings
|
|
391
|
+
- [CONTRIBUTING.md](../CONTRIBUTING.md) - Development guidelines
|
|
392
|
+
- [STRUCTURE.md](./STRUCTURE.md) - Project structure documentation
|
|
393
|
+
|
|
394
|
+
### Related Issues
|
|
395
|
+
- Track refactoring progress via GitHub issues
|
|
396
|
+
- Link TODOs to specific issues (e.g., `TODO(#123): Extract this class`)
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Appendix: Common Refactoring Patterns
|
|
401
|
+
|
|
402
|
+
### Extract Method
|
|
403
|
+
```python
|
|
404
|
+
# Before
|
|
405
|
+
def long_function():
|
|
406
|
+
# 100 lines of code
|
|
407
|
+
x = complex_calculation()
|
|
408
|
+
# more code
|
|
409
|
+
|
|
410
|
+
# After
|
|
411
|
+
def long_function():
|
|
412
|
+
x = _calculate_value()
|
|
413
|
+
# rest of code
|
|
414
|
+
|
|
415
|
+
def _calculate_value():
|
|
416
|
+
return complex_calculation()
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Replace Magic Number with Constant
|
|
420
|
+
```python
|
|
421
|
+
# Before
|
|
422
|
+
timeout = 30
|
|
423
|
+
|
|
424
|
+
# After
|
|
425
|
+
from ..constants import Timeouts
|
|
426
|
+
timeout = Timeouts.GIT_FETCH
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Introduce Parameter Object
|
|
430
|
+
```python
|
|
431
|
+
# Before
|
|
432
|
+
def func(param1, param2, param3, param4, param5):
|
|
433
|
+
pass
|
|
434
|
+
|
|
435
|
+
# After
|
|
436
|
+
@dataclass
|
|
437
|
+
class FuncParams:
|
|
438
|
+
param1: str
|
|
439
|
+
param2: int
|
|
440
|
+
param3: bool
|
|
441
|
+
param4: Optional[str]
|
|
442
|
+
param5: list[str]
|
|
443
|
+
|
|
444
|
+
def func(params: FuncParams):
|
|
445
|
+
pass
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### Extract Class
|
|
449
|
+
```python
|
|
450
|
+
# Before
|
|
451
|
+
class GodClass:
|
|
452
|
+
def method1(self): pass
|
|
453
|
+
def method2(self): pass
|
|
454
|
+
def method3(self): pass
|
|
455
|
+
# 50+ more methods
|
|
456
|
+
|
|
457
|
+
# After
|
|
458
|
+
class GodClass:
|
|
459
|
+
def __init__(self):
|
|
460
|
+
self.feature1 = Feature1Service()
|
|
461
|
+
self.feature2 = Feature2Service()
|
|
462
|
+
|
|
463
|
+
class Feature1Service:
|
|
464
|
+
def method1(self): pass
|
|
465
|
+
def method2(self): pass
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
470
|
+
**End of Document**
|