[ 
https://issues.apache.org/jira/browse/SOLR-14781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17185424#comment-17185424
 ] 

David Smiley edited comment on SOLR-14781 at 8/26/20, 7:48 PM:
---------------------------------------------------------------

I used IntelliJ's "Unused declaration" inspection configured just for classes. 
It took some time to run. I exported the results as an XML file to attach to 
this issue and share; there's a heavy HTML version I have too. It ran over the 
whole codebase; I propose in this issue ignoring the Lucene ones.

There are 201 in Solr. The analytics module accounts for 68 of them.  Many 
(perhaps half?) of the classes are in fact used, referenced via configuration 
files that are loaded dynamically. It seems IntelliJ didn't notice those.

One possible way to handle this is to outright remove them all then run tests. 
Tests will expose many to add back. Finally, share here a list of classes to 
propose to remove for peer review.

Just an example of one class that can be removed: 
{{org.apache.solr.util.SolrLogLayout}}.   This thing confused me and my 
colleagues today.  These removable files are receiving maintenance by us 
collectively despite being dead code.  Tech debt.


was (Author: dsmiley):
I used IntelliJ's "Unused declaration" inspection configured just for classes.  
It took some time to run.  I exported the results as an XML file to attach to 
this issue and share; there's a heavy HTML version I have too.  It ran over the 
whole codebase; I propose in this issue ignoring the Lucene ones.

Many (perhaps half?) of the classes are in fact used, referenced via 
configuration files that are loaded dynamically.  It seems IntelliJ didn't 
notice those.  Just an example:  {{org.apache.solr.util.SolrLogLayout}}.  There 
are 201 in Solr.  The analytics module accounts for 68 of them.

One possible way to handle this is to outright remove them all then run tests.  
Tests will expose many to add back.  Finally, share here a list of classes to 
propose to remove for peer review.

> Remove unused classes
> ---------------------
>
>                 Key: SOLR-14781
>                 URL: https://issues.apache.org/jira/browse/SOLR-14781
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Priority: Minor
>              Labels: newdev
>         Attachments: unused.xml
>
>
> There are a number of lingering classes in Solr that are not used anymore, 
> lingering after long-gone refactorings or who knows what.  They should be 
> removed, of course.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to