{
  "item_type": "subsection",
  "chapter_id": "analysis-guide",
  "subsection_id": "advanced-features",
  "subsection_title": "Advanced Features",
  "subsection_file": "book/src/analysis-guide/advanced-features.md",
  "feature_mappings": [
    "functional_analysis.purity_detection",
    "call_graph_analysis.data_flow",
    "complexity_analysis.entropy"
  ],
  "drift_detected": true,
  "severity": "medium",
  "quality_assessment": "Good documentation with comprehensive coverage, but contains outdated information about purity classification levels that no longer matches implementation.",
  "issues": [
    {
      "type": "outdated_information",
      "severity": "medium",
      "section": "Purity Detection > Three-level purity classification",
      "description": "Documentation describes three-level purity classification (Pure, ProbablyPure, Impure), but the actual PurityLevel enum in src/core/mod.rs has four levels: StrictlyPure, LocallyPure, ReadOnly, and Impure",
      "current_content": "Three-level purity classification: Pure, ProbablyPure, Impure (line 21-26)",
      "should_be": "Four-level purity classification: StrictlyPure (no mutations), LocallyPure (local mutations only), ReadOnly (reads external state), Impure (modifies external state)",
      "fix_suggestion": "Update the purity classification section to document all four levels with their correct names and descriptions from src/core/mod.rs:49-62",
      "source_reference": "src/core/mod.rs:49-62"
    },
    {
      "type": "incorrect_source_reference",
      "severity": "low",
      "section": "Purity Detection",
      "description": "Documentation references 'src/core/mod.rs:91' for purity_level, but the PurityLevel enum is defined at line 49",
      "current_content": "This three-level classification (available in src/core/mod.rs:91)",
      "should_be": "PurityLevel enum is at src/core/mod.rs:49-62",
      "fix_suggestion": "Update source reference to correct line number",
      "source_reference": "src/core/mod.rs:49"
    },
    {
      "type": "missing_content",
      "severity": "low",
      "section": "Data Flow Analysis > Data Transformation Patterns",
      "description": "Documentation shows a TransformationType enum with (Map, Filter, Reduce, FlatMap, Unknown), but actual implementation in src/organization/data_flow_analyzer.rs has different variants: Direct, Aggregation, Decomposition, Enrichment, Expansion",
      "current_content": "TransformationType { Map, Filter, Reduce, FlatMap, Unknown }",
      "should_be": "TransformationType { Direct, Aggregation, Decomposition, Enrichment, Expansion }",
      "fix_suggestion": "Update TransformationType enum documentation to match actual implementation, or clarify that the DataFlowGraph.data_transformations uses String for transformation_type",
      "source_reference": "src/organization/data_flow_analyzer.rs:35-46 and src/data_flow/mod.rs:149"
    },
    {
      "type": "missing_content",
      "severity": "low",
      "section": "Data Flow Analysis > Variable Dependency Tracking",
      "description": "Documentation mentions 'Mutable vs immutable references' tracking, but variable_deps in DataFlowGraph only stores variable names as HashSet<String>",
      "current_content": "variable_dependencies: HashMap<String, HashSet<String>> - tracks variable names only",
      "should_be": "Either remove claim about mutability tracking or enhance implementation",
      "fix_suggestion": "Clarify that variable tracking captures names only, not mutability information",
      "source_reference": "src/data_flow/mod.rs:119"
    }
  ],
  "positive_aspects": [
    "Comprehensive documentation of purity detection concepts and benefits",
    "Excellent DataFlowGraph documentation with call graph, variable dependencies, and I/O tracking",
    "Clear entropy-based complexity analysis with Shannon entropy formula",
    "Detailed entropy cache statistics and performance metrics",
    "Well-documented coverage integration with LCOV support",
    "Context-aware analysis patterns are accurately described",
    "Good integration explanation with unified scoring system",
    "ModificationImpact analysis is well documented with risk levels"
  ],
  "improvement_suggestions": [
    "Update purity classification to document all four levels (StrictlyPure, LocallyPure, ReadOnly, Impure)",
    "Correct source code reference for PurityLevel from line 91 to line 49",
    "Clarify TransformationType enum - note that there are two different enums in the codebase",
    "Clarify that variable dependency tracking captures names only, not mutability",
    "Consider adding cross-references to complexity-metrics.md for entropy details",
    "Add examples of how four-level purity classification affects scoring"
  ],
  "cross_references": [
    "complexity-metrics",
    "risk-scoring",
    "interpreting-results"
  ],
  "metadata": {
    "analyzed_at": "2025-12-27T08:30:00Z",
    "feature_inventory": ".prodigy/book-analysis/features.json",
    "topics_covered": [
      "Purity detection",
      "Data flow analysis",
      "Entropy caching",
      "Context-aware analysis",
      "Coverage integration",
      "Modification impact analysis"
    ],
    "validation_focus": "Ensure advanced features are fully documented",
    "internal_links_checked": 0,
    "broken_links_found": 0
  }
}
