Skip to content

Detect ExtentReports usage in Java source - #39

Merged
shossain786 merged 3 commits into
seleniumboot:mainfrom
Jennydou517:issue-37-extentreports
Nov 25, 2026
Merged

shossain786 merged 3 commits into
seleniumboot:mainfrom
Jennydou517:issue-37-extentreports

Conversation

@Jennydou517

Copy link
Copy Markdown
Contributor

Closes #37.

  1. Add MIG-018 to flag declarations and object creation for ExtentReports, ExtentTest, and ExtentSparkReporter for manual migration.
  2. Give the rule a readable label and report each type once per line.
  3. Skip same-named types when a fully qualified name or explicit import identifies them as coming from another package.
  4. Test matching code, unrelated code, and same-named types from other packages.

All 72 tests passed with mvn test.

@shossain786 shossain786 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jennydou517, this is solid work. I checked out the branch: mvn clean verify passes, and the new tests fail on main and pass with your change. Handling same-named types from other packages was a nice extra.

One change before merge:

  • README: please add a MIG-018 row to the rule table (after MIG-017, around line 245), e.g. | MIG-018 | ExtentReports usage (\ExtentReports`, `ExtentTest`, `ExtentSparkReporter`) | Manual review; Selenium Boot generates an HTML report |`.

Optional, fine as a follow-up:

  • ThreadLocal<ExtentTest> (a common Extent pattern) isn't flagged, because types inside generic arguments are skipped.
  • With a wildcard import from another package (import example.*;), a same-named type would still match.

CI is green too.

@shossain786 shossain786 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Jennydou517, the README row is in and mvn clean verify passes. Merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect ExtentReports usage in code (MIG-018)

2 participants