Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Is there a tabular representation for code metric tests?

Ruediger_Plantiko
Active Contributor
0 Likes
898

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.

1 ACCEPTED SOLUTION
Read only

former_member184455
Active Participant
0 Likes
730

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

2 REPLIES 2
Read only

Former Member
0 Likes
730

About your thoughts on writing a report, a user was able to use FM SCI_INSPECT_LIST.

Read only

former_member184455
Active Participant
0 Likes
731

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