2013 Jul 11 9:36 AM
Hi,
I am doing some tests with all those nice code quality metrics built in in the code inspector. By design of the code inspector, I get a hierarchical (or tabular) list of messages for code objects differing somehow from an expected "norm".
This makes it difficult to evaluate if I do an evaluation over all custom code, since the log will contain thousands of messages. If this is the only way of getting an output from the code metric classes, a tedious post processing is required: Either I'll have to extract the numbers I am interested in with pattern search from the textual output, or I have to look for the database tables containing the results, extracting the right message variables which contain the metric.
What I am looking for is not messages but a tabular result representation, which for each code object simply lists the code quality numbers - in an ALV grid or something similar:
ex. stmts Halstead metric cyclometric complexity nesting depth Halstead's volume ...
...
Method ZCL_TEST->DO 53 102 200 4 2'011
Method ZCL_TEST->PUT 10 11 12 3 2'012
...
Does anyone know of such a tool? I have sen that for each test there is a class, like CL_CI_TEST_METRIC_NOES, which actually computes the metric. Is there some other framework making use of these classes? Or is SCI the only way to access them? (Meaning that I am damned to eat the "message-style" output of SCI).
Regards,
Rüdiger
P.S.: Switching the radiobutton from "Show Messages" to "Show Metric" is no solution. I still get messages as result (1000s of info messages, instead of warnings for only those code objects which pass the thresholds).
P.P.S.: I only see the way to write a report extracting the data from database table SCIREST_PS and putting them into the desired form. But maybe somebody has a solution for this already.
2013 Jul 11 10:28 AM
Hi Rüdiger,
There are several metrics in the Code Inspector and some of them are able to produce a tabular output - unfortunately not all of them.
If you take the 'Procedural Metrics' (CL_CI_TEST_METRIC_PROC), this one will give you one single entry in the Code Inspector result tree if you have selected 'Show metrics' as parameter for the check. When double-clicking the entry, a list as you wished will be displayed.
The same holds true for
* Comment Language Metrics
* OO Size Metrics
* ABAP webdynpro Metrics
The mentioned 'Number of Executable Statements Metrics' (CL_CI_TEST_METRIC_NOES) on the other hand, has no tabular display. With a trick you could achieve it: switch to 'Results table' of the Code Inspector result and then change the layout to display all results parameters. Two of these parameters contain the check's KPIs.
Best Regards, Randolf
Hi Rüdiger,
There are several metrics in the Code Inspector and some of them are able to produce a tabular output - unfortunately not all of them.
If you take the 'Procedural Metrics' (CL_CI_TEST_METRIC_PROC), this one will give you one single entry in the Code Inspector result tree if you have selected 'Show metrics' as parameter for the check. When double-clicking the entry, a list as you wished will be displayed.
The same holds true for
* Comment Language Metrics
* OO Size Metrics
* ABAP webdynpro Metrics
The mentioned 'Number of Executable Statements Metrics' (CL_CI_TEST_METRIC_NOES) on the other hand, has no tabular display. With a trick you could achieve it: switch to 'Results table' of the Code Inspector result and then change the layout to display all results parameters. Two of these parameters contain the check's KPIs.
Best Regards, Randolf
2013 Jul 11 10:27 AM
About your thoughts on writing a report, a user was able to use FM SCI_INSPECT_LIST.
2013 Jul 11 10:28 AM
Hi Rüdiger,
There are several metrics in the Code Inspector and some of them are able to produce a tabular output - unfortunately not all of them.
If you take the 'Procedural Metrics' (CL_CI_TEST_METRIC_PROC), this one will give you one single entry in the Code Inspector result tree if you have selected 'Show metrics' as parameter for the check. When double-clicking the entry, a list as you wished will be displayed.
The same holds true for
* Comment Language Metrics
* OO Size Metrics
* ABAP webdynpro Metrics
The mentioned 'Number of Executable Statements Metrics' (CL_CI_TEST_METRIC_NOES) on the other hand, has no tabular display. With a trick you could achieve it: switch to 'Results table' of the Code Inspector result and then change the layout to display all results parameters. Two of these parameters contain the check's KPIs.
Best Regards, Randolf
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |