{
  "item_type": "subsection",
  "chapter_id": "scoring-strategies",
  "subsection_id": "file-level-scoring",
  "subsection_title": "File-Level Scoring",
  "subsection_file": "book/src/scoring-strategies/file-level.md",
  "feature_mappings": [
    "risk_assessment.prioritization",
    "god_object_detection",
    "coverage_integration"
  ],
  "drift_detected": true,
  "severity": "high",
  "quality_assessment": "Subsection file does not exist. Content is currently embedded in main scoring-strategies.md. God object multiplier formula in documentation differs from implementation.",
  "issues": [
    {
      "type": "missing_content",
      "severity": "high",
      "section": "Subsection Structure",
      "description": "The file 'book/src/scoring-strategies/file-level.md' does not exist. The scoring-strategies/ directory does not exist. File-level scoring content (approximately 200 lines) is embedded within the main book/src/scoring-strategies.md file (lines 13-211).",
      "feature_reference": "risk_assessment.prioritization",
      "fix_suggestion": "Create the scoring-strategies/ directory and extract the file-level scoring section from scoring-strategies.md into a dedicated file-level.md subsection. This requires migrating the chapter from single-file to multi-subsection structure.",
      "source_reference": "book/src/scoring-strategies.md:13-211"
    },
    {
      "type": "outdated_information",
      "severity": "medium",
      "section": "God Object Multiplier Formula",
      "description": "Documentation states god object multiplier is '2.0 + god_object_score' but implementation uses '1.0 + (god_object_score / 50.0)' which maps score 0-100 to multiplier 1.0-3.0x.",
      "current_content": "GodObject = 2.0 + god_object_score if detected",
      "should_be": "GodObject = 1.0 + (god_object_score / 50.0), mapping score 0-100 to multiplier 1.0x-3.0x",
      "fix_suggestion": "Update documentation to reflect the actual formula: god_object_multiplier = 1.0 + (god_object_score / 50.0). The implementation comment at lines 282-284 explains the rationale: 'Score 0-100 maps to multiplier 1.0x-3.0x (not 2x-102x!) This aligns with contextual risk cap (max 3x) for consistent scoring'",
      "source_reference": "src/priority/file_metrics.rs:282-293"
    },
    {
      "type": "broken_links",
      "severity": "medium",
      "section": "Cross-References",
      "description": "Found 1 broken internal link in scoring-strategies.md",
      "broken_links": [
        {
          "link_text": "Data Flow Analysis",
          "target_path": "./data-flow-analysis.md",
          "expected_file": "book/src/data-flow-analysis.md",
          "found": false,
          "suggestion": "Either create the data-flow-analysis.md file to document this feature, or remove the link if the feature is not yet documented. The data flow scoring section references this file at line 1867."
        }
      ],
      "fix_suggestion": "Create data-flow-analysis.md or remove the broken link reference from the 'See Also' section"
    }
  ],
  "positive_aspects": [
    "File-level scoring formula accurately documented in main scoring-strategies.md",
    "Aggregation methods (weighted_sum, sum, logarithmic_sum, max_plus_average) correctly documented with formulas",
    "Size, complexity, coverage, and density factor formulas match implementation",
    "CLI examples are current and functional (--aggregate-only, --top, --format)",
    "Configuration examples correctly show .debtmap.toml format",
    "Coverage factor formula correctly documented with range 1.0-3.0"
  ],
  "improvement_suggestions": [
    "Migrate scoring-strategies.md to multi-subsection structure with file-level.md, function-level.md, and other subsections",
    "Add code references showing where each scoring factor is calculated (src/priority/file_metrics.rs)",
    "Document the FileScoreFactors struct which provides transparency into score breakdown",
    "Add example of using get_score_factors() method for debugging score calculations",
    "Document file context adjustments (test files 80% reduction, generated files 90% reduction) from file_context_scoring.rs",
    "Add coupling and instability metrics documentation from spec 201"
  ],
  "cross_references": [
    "function-level-scoring",
    "rebalanced-scoring",
    "configuration"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T09:00:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "File aggregation",
      "Aggregation methods",
      "God object detection",
      "Architectural scoring"
    ],
    "validation_focus": "Check file-level scoring formula and aggregation methods",
    "implementation_files_reviewed": [
      "src/priority/file_metrics.rs",
      "src/priority/scoring/file_context_scoring.rs",
      "tests/file_level_scoring_integration_test.rs"
    ]
  }
}
