Skip to content
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

how to handle AR model classes with no methods #302

Closed
danmayer opened this issue Jul 21, 2019 · 3 comments
Closed

how to handle AR model classes with no methods #302

danmayer opened this issue Jul 21, 2019 · 3 comments

Comments

@danmayer
Copy link
Owner

danmayer commented Jul 21, 2019

They have no methods, as a pure pass through to the DB... so they have 100% coverage based on being loaded... how can we tell if they are in use or not?

Example from @kbaum

I think we need a strategy for finding unused classes that get 100% coverage because of eager loading.

image (1)

@danmayer
Copy link
Owner Author

The best idea I have for this is looking for callers via grep or static analysis... which gets a bit outside of Coverband's primary expertise.

@danmayer
Copy link
Owner Author

Still probably beyond what we want to do in Coverband, but we could subscript to this notification event.

https://guides.rubyonrails.org/active_support_instrumentation.html#instantiation-active-record

Then we could record last time instantiated, similar to how the view tracker works and records when views are used.

@danmayer
Copy link
Owner Author

We now display things differently for files that have no runtime coverage and wouldn't expect to... It think this is good to close out

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

No branches or pull requests

1 participant