Remove duplicate code

Introduce a ConfiguredItem helper method which wraps exceptions
and a new check_size method on TokenizedVersion. Then reuse these
methods in place of duplicate code.

Add a Groovy utility method to find all Groovy files.

[#56447064]
Merge 56447064-code-climate to master

[#56447064]