Open pkuczynski opened 7 years ago
@pkuczynski I've fixed about half of the warnings in my findbugs-fixes
branch: https://github.com/jenkinsci/rubymetrics-plugin/compare/6ca45e100d9018ad512876e3393104e240d34959...2fb3781a1cdeed2232d50f2e884bc9aa916a6bb2
The remaining warnings involve the following:
DM_DEFAULT_ENCODING
: There a number of places that are receiving byte-level output from rake
commands that aren't parsing them with a character set. It's unclear which character set should be used here. I may be safe to just assume they're UTF-8BX_UNBOXING_IMMEDIATELY_REBOXED
, DM_BOXED_PRIMITIVE_FOR_PARSING
: The RcovAbstractResult
is storing a number of metrics as strings and then repeatedly parsing and unparsing them to calculate derived Integer
and Float
valuesSE_BAD_FIELD
: RcovFileDetail
and SaikuroFileDetail
are marked as Serializable
, but they have non-Serializable
fields. It seems to me that these classes should not be Serializable
since they are only instantiated on the Jenkins master from build actions and don't need to travel across the wire. There are also no fields of these typesOne thing that's probably worth mentioning is that I removed a number of method of the form: public T parse(InputStream input) throws IOException
I doubt that anyone is relying on these methods being public
, but we could probably add them back.
@md5 thanks for your efforts! When it comes to the remaining issues, I have no clue how to fix them and I will happily follow your suggestions...
DM_DEFAULT_ENCODING
- I guess we can assume UTF-8BX_UNBOXING_IMMEDIATELY_REBOXED
- shall we convert the values on the RcovAbstractResult
level? Or what are the other options?SE_BAD_FIELD
- I guess we can make them no Serializable
then...@pkuczynski I think assuming UTF-8 and removing the Serializable
from the file detail classes is probably safe, but I need to do a bit more research. Not sure when I'll get the time.
As for the stuff in RcovAbstractResult
, I think it would be best to have it internally store numeric values and to format them on display, but the thing I'm worried about is whether these objects are serialized as part of completed builds. If so, then simply changing the fields is not an option since we would need to handle old builds that were persisted with the String
values. I suspect these objects are part of the persisted build, but I haven't looked closely enough to say for sure.
After upgrading to newer parent pom as suggested in the troubleshooting section of Hosting Plugins on Jenkins wiki: https://wiki.jenkins-ci.org/display/JENKINS/Hosting+Plugins#HostingPlugins-Workingaroundcommonissues
Over 30 issues are being reported by FindBugs which fails the build. This should be fixed before any other work continues...
For the time being I disabled FindBugs in pom.xml:
Any volunteers willing to help fixing those issues?