• Icon: Suggestion Suggestion
    • Resolution: Won't Fix
    • someday
    • Groovy
    • None
    • JDK 1.8u60
      Groovy 2.4.5
      Clover 4.0.0
      Run using Gradle plugin
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      The NCLOC metric doesn't seem to count groovy code as a NCLOC. I'm attaching a screenshot from our report that shows a groovy class but doesn't seem to consider any code in it as actual code.

            [CLOV-1805] Add NCLOC metric to Groovy code

            Related issue in Bamboo: BAM-14734

            Marek Parfianowicz added a comment - Related issue in Bamboo: BAM-14734

            It's documented here:

            ncLineCount

            The total number of non-comment lines.
            (info) When using Clover on Groovy source code, this column consistently reports '0' at the moment.

            and here:

            Number of Non-commented Lines of Code (NCLOC)

            (info) This information is currently not available with Clover reports on Groovy code.

            In addition to the above, I added a warning also on this page:

            NCLOC
            Non-Commented Lines Of Code. Lines of code that contain comments are not counted in this metric, leaving only the actual functioning code itself.

            Warning Clover currently does not calculate NCLOC for Groovy code (CLOV-1805).

            Marek Parfianowicz added a comment - It's documented here: https://confluence.atlassian.com/display/CLOVER/clover-report#clover-report-Columns ncLineCount The total number of non-comment lines. (info) When using Clover on Groovy source code, this column consistently reports '0' at the moment. and here: https://confluence.atlassian.com/display/CLOVER/'Current'+Report Number of Non-commented Lines of Code (NCLOC) (info) This information is currently not available with Clover reports on Groovy code. In addition to the above, I added a warning also on this page: https://confluence.atlassian.com/display/CLOVER/About+Clover+code+metrics NCLOC Non-Commented Lines Of Code. Lines of code that contain comments are not counted in this metric, leaving only the actual functioning code itself. Warning Clover currently does not calculate NCLOC for Groovy code ( CLOV-1805 ).

            JoeA added a comment -

            Thanks for the feedback. Since it really isn't easy to support this feature maybe add a warning or something to the metrics explaining that this isn't supported for Groovy? Or possible I missed this. We are slowly converting our application from Java to Groovy and I didn't realize this metric wasn't meaningful anymore until a lot of the code was converted and the metrics started getting really skewed.

            JoeA added a comment - Thanks for the feedback. Since it really isn't easy to support this feature maybe add a warning or something to the metrics explaining that this isn't supported for Groovy? Or possible I missed this. We are slowly converting our application from Java to Groovy and I didn't realize this metric wasn't meaningful anymore until a lot of the code was converted and the metrics started getting really skewed.

            Thank you for your report, unfortunately this metric is not being calculated for Groovy code because Clover instruments Groovy on AST tree level. At that point information about comments is lost. There may be a way to hook in Groovy compilation at earlier phases and calculate this metric, but at this point I'm not sure if it's possible.

            I've modified this issue to improvement to add NCLOC to Groovy code, you can track its progress, but taking into consideration our current road map I don't think we're going to address that in foreseeable future. You should get mail notification from JIRA system in case of any updates.

            Cheers,
            Grzegorz Lewandowski

            Grzegorz Lewandowski added a comment - Thank you for your report, unfortunately this metric is not being calculated for Groovy code because Clover instruments Groovy on AST tree level. At that point information about comments is lost. There may be a way to hook in Groovy compilation at earlier phases and calculate this metric, but at this point I'm not sure if it's possible. I've modified this issue to improvement to add NCLOC to Groovy code, you can track its progress, but taking into consideration our current road map I don't think we're going to address that in foreseeable future. You should get mail notification from JIRA system in case of any updates. Cheers, Grzegorz Lewandowski

              Unassigned Unassigned
              a86e82895aec JoeA
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: