http://www.nabble.com/file/p13398037/tika-analysis.zip tika-analysis.zip
Hi, all. As a general way to improve code quality and eliminate bugs before we find them, I let Intellij Idea analyze the source code to see what it would find. I'm attaching a zip file of an HTML export of its report (see above). Most of the things it found are minor, but many are (IMHO) worth the short time it takes to fix them. (Would you like me to fix things when I see them, or just let you know if I find anything important? Or maybe mark them with a FIXME? I realize that some of the reported problems are not really problems.) Here are some things it found: * MimeTypes.getMinLength() always returns 1024. There is also a member variable 'minLength', that is set in the code, but never read. Can we remove either the 1024 or the member variable? * MimeTypes.readMimeInfo() creates a 'types' array and returns it, but never adds anything to it. This method should probably be changed to void, because it never varies and its own caller does nothing with its return value. * Similarly, XMLParser.getAllDocuments() creates and returns a List, but that List is not used by its caller. * a use of if(true) in PowerPointExtractor. * private and static methods declared final - Final is redundant in these cases, and possibly misleading. * 'declaration can be weaker' private instead of public, etc. - 48 items * Declaration has problems in Javadoc references (7). This is not the absence of Javadoc. It is the inclusion of parameters in the Javadoc that do not exist in the method signature. * JDK 5 Migration (18) - opportunities for more concise (Java 5) syntax exist. * Method Metrics - methods too long, too complex, and too nested. I'm not volunteering to touch these, because these refactorings are better done by original authors (if done at all). * a redundant String creation (new String(somethingThatReturnsAString())). * serializable class without serialVersionUid * redundant type cast Regards, Keith -- View this message in context: http://www.nabble.com/Intellij-Idea-Inspections-Results-tf4687932.html#a13398037 Sent from the Apache Tika - Development mailing list archive at Nabble.com.
