Skip to content

fix(analyzer): enhance StaticPaths method for post-analyzers #8905

@knqyf263

Description

@knqyf263

Problem

The current implementation of the StaticPaths method in the analyzer group doesn't properly handle post-analyzers that implement the StaticPathAnalyzer interface. This can lead to inefficient file system traversal when post-analyzers could provide static paths.

Current Behavior

  • Post-analyzers are not considered when determining static paths
  • Even if all post-analyzers implement StaticPathAnalyzer, the method returns false for allStatic
  • This forces unnecessary file system traversal

Expected Behavior

  • Post-analyzers that implement StaticPathAnalyzer should be considered when determining static paths
  • If all enabled analyzers (including post-analyzers) implement StaticPathAnalyzer, allStatic should be true
  • This would allow for more efficient file system traversal

Steps to Reproduce

  1. Create a post-analyzer that implements StaticPathAnalyzer
  2. Enable the post-analyzer
  3. Call StaticPaths on the analyzer group
  4. Observe that the post-analyzer's static paths are not included

Impact

  • Unnecessary file system traversal
  • Reduced performance
  • Inconsistent behavior between analyzers and post-analyzers

Proposed Solution

  1. Modify the StaticPaths method to consider both analyzers and post-analyzers
  2. Update the logic to check if all enabled analyzers (including post-analyzers) implement StaticPathAnalyzer
  3. Include static paths from post-analyzers in the returned paths

Related PRs

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions