Skip to content

Analyze test classes optionally if the user wants to #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rahlk opened this issue Feb 19, 2025 · 0 comments · Fixed by #126
Closed

Analyze test classes optionally if the user wants to #125

rahlk opened this issue Feb 19, 2025 · 0 comments · Fixed by #126
Assignees
Labels
enhancement New feature or request kind/feature Feature

Comments

@rahlk
Copy link
Collaborator

rahlk commented Feb 19, 2025

Is your feature request related to a problem? Please describe.

Currently, the codeanalyzer-java does not account for test classes (src/test/java/) when analyzing a Maven project. This leads to missing information from unit tests, which can be essential for understanding dependencies, call graphs, and other structural insights in a codebase.

Describe the solution you’d like

The tool should recognize and process test classes located in src/test/java/, ensuring they are included in relevant analyses. Specifically, it should:

  • Detect test classes and compile them if necessary.
  • Include test-related call sites and dependencies in the analysis.
  • Maintain a distinction between main source files (target/classes/) and test files (target/test-classes/).

Add a new flag --include-test-classes that optionally enable mvn test-compile instead of mvn compile (or the gradle alternative)

Describe alternatives you’ve considered

  • Manually copying test classes to the main source directory before running the tool (not ideal).
  • Running a separate analysis phase for test files.
  • Using custom workarounds to merge test and main class data post-analysis.

Additional context

Handling test classes is crucial for tools that analyze code structure, call graphs, and dependencies since test cases often contain critical references to core logic. Support for this feature would improve the completeness of the analysis.

@rahlk rahlk added enhancement New feature or request kind/feature Feature labels Feb 19, 2025
@rahlk rahlk self-assigned this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/feature Feature
Projects
None yet
1 participant