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

Complexity of a Program

Former Member
2,808

hii ,

i need to know that is there any tcode to find out complexity of a program ( simple, medium, complex) . i have more than 100 programs in my internal table i need to separate them complexity wise into simple , medium and complex...

I have small doubt Can we decide complexity based on program lines , based on number of function modules...etc...

thanks and regards.

Laxmi.

1 ACCEPTED SOLUTION
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,948

Program complexity has NOTHING to do with number of lines or number of FM used.

It purely depends on the logic , amount data being fetched from DB.

12 REPLIES 12
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,949

Program complexity has NOTHING to do with number of lines or number of FM used.

It purely depends on the logic , amount data being fetched from DB.

Read only

0 Likes
1,948

this is the sample estimantions for hrs basis

RICEFW Complexity FD_review TD TD_Review Build Code_Review UTP

Reports Low 2 8 1 24 1 12

Reports Medium 3 15 2 40 2 26

Reports High 4 20 3 60 4 29

Forms Low 2 8 1 24 1 12

Forms Medium 3 15 2 40 2 26

Forms High 4 20 3 60 4 29

Extensions Low 2 8 1 24 1 12

Extensions Medium 6 19 4 40 3 40

Extensions High 8 32 4 80 6 62

Interfaces Low 2 10 1 22 1 20

Interfaces Medium 3 28 2 72 3 36

Interfaces High 8 34 4 100 8 46

Conversions (LSMW) Low 2 11 2 24 1 24

Conversions (LSMW) Medium 3 15 2 40 2 26

Conversions (LSMW) High 4 20 3 60 4 29

Conversions (ABAP) Low 3 15 2 40 2 26

Conversions (ABAP) Medium 4 18 2 50 2 28

Conversions (ABAP) High 8 20 4 70 4 30

Read only

0 Likes
1,948

>

> Program complexity has NOTHING to do with number of lines or number of FM used.

> It purely depends on the logic , amount data being fetched from DB.

I agree. For example, any program that uses field symbols is likely to be more complex ie difficult to understand than one that does not, yet using field symbols can often reduce the number of lines of code drastically.

Read only

0 Likes
1,948

Hi Sandeep,

Thank you for your quick reply...

you said It purely depends on the logic , amount data being fetched from DB.

Is there any standard table which stores all these..because i have a requirement to fetch all custom objects (Reports, scripts,smartforms.....etc ) and rate their complexities..

Thanks & Regards,

Laxmi

Read only

0 Likes
1,948

Hi,,Kesava Reddy

Thank you for your reply...

How can we see all these Values..Is there any standard Table.

Thanks & regards,

laxmi.

Read only

0 Likes
1,948

I disagree with this opinion: In contrast to its difficulty, the complexity of a source code object heavily depends on the number of variables and statements. And this is directly related to the number of code lines.

Briefly spoken: While it is virtually impossible to create a "complex" source in one line, you won't find a lot development above 100.000 lines, that somebody would regard as "simple" or "non-complex".

The complexity of a given source code can easily be measured with common software metrics, such as Halstead or McCabe. The SAP Code Inspector provides these metrics to the user, in newer releases.

Read only

Former Member
0 Likes
1,948

thank you for your replies

Read only

0 Likes
1,948

I'm afraid this is a manual and tedious task, no matter how often you try to initiate a new thread on this topic. It can be semi-automated by e.g. scanning for certain language constructs e.g. CALL TRANSACTION ... USING ... with report RPR_ABAP_SOURCE_SCAN. I had to do it for 300+ programs during our upgrade.

Maybe SAP or other vendors offer tools or consultation, but these would come at a price, obviously.

Also, what's considered complex or not probably differs from company to company...

Thomas

Read only

Former Member
0 Likes
1,948

Hi,

Did you check this thread??

Read only

matt
Active Contributor
0 Likes
1,948

You've asked this question a second time. That question has been removed, as a duplicate, and so I've re-opened this one. Continue any discussion here

There are programs for calculating the cyclomatic complexity (one measure of complexity) of C and Java programs, which are open source. You could convert them to ABAP. E.g. http://eclipse-metrics.sourceforge.net/

matt

Read only

Former Member
0 Likes
1,948

Thank you for your replies..........

Read only

kiran_k8
Active Contributor
0 Likes
1,948

Lakshmi,

Complexity differs based on perception ie A Developer perspective will differ from a  Businss User perspective.

When you see it from the perspective of a Business User,then the availability of the program,kind of criticial functionality it is handling,repurcussions of unavailability/failure of this program resulting in loss of time and business are the parameters that actually defines the complexity of a program.

My two cents 🙂

K.Kiran.