butterknife icon indicating copy to clipboard operation
butterknife copied to clipboard

New Lint: Unused binding

Open JakeWharton opened this issue 9 years ago • 4 comments

When a @Bind* field is present but not used anywhere except by the generated view binding.

JakeWharton avatar Apr 03 '17 16:04 JakeWharton

PMD or Findbugs is sometimes able to detect such fields. Although it isn't really reliable.

vanniktech avatar Apr 03 '17 20:04 vanniktech

It's likely impossible to detect through normal static analysis since the field is referenced both on the constructor and unbinder methods and thus appears used.

JakeWharton avatar Apr 03 '17 20:04 JakeWharton

The concepts from here could be applied and used when implementing this check.

vanniktech avatar Aug 03 '17 15:08 vanniktech

Maybe @jrodbx is searching for a lint check to write for his talk next week...

JakeWharton avatar Sep 20 '17 20:09 JakeWharton