Project: clover
Issue CLOV-1785: Extend database format to handle statements and methods in a file
Allow better modelling of file-level statements and methods so that we can better support languages like Ruby which support top-level scripting constructs. Example: {code:java} session.enterFile(..); session.enterMethod(...); // top-level-method, not inside a class ... // some statements ... session.exitMethod(); ... session.addStatement(...); // top-level-statement, not inside a class or a method ... session.exitFile(); {code} Some preparation have been already done for Java 8 (Clover 3.2). Things to be checked: * how our code calculates the start/end line/col range for a statement/method outside a class * how it calculates code metrics for a file having top-level statements/methods * how it handles exclusion filters (statement/method regexp) * how it handles nested entities (method-in-method etc) Things to be implemented: * take into account these top-level statements/methods in reporting ** show in XML / HTML / PDF / JSON ** render lines ** show in tables etc Out of scope: * test optimization Note: Looking at how Clojure is written, for any Clojure file there would only ever be one FileInfo containing lots of StatementInfos and MethodInfos but no ClassInfos.
Story points: 3