Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 2136

Cyclomatic complexity in ABAP

$
0
0

Introduction:-


The cyclomatic complexity measures the complexity of a program and is based on the control flow graph. It is a count for the number of linearly independent paths through the source code. It was developed by Thomas J. McCabe, Sr. in 1976.


The CC goes through a coding block and counts every time,  the control flow has a new path at a specific decision point. A new path will be created due to a "IF", "ELSE", "CASE" and so on.

 

Ideally, the CC should be between 7 and 15 at each coding block.


1. How to configure CCN

 

  1.1 Open any program using Tcode “SE38”. Go to program->check->Code Inspector

                   

               cyclo1.png

 

  1.2. Click on Utility->Default Check Variant->Maintain

                    Cyclo2.png

 

1.3 Select procedural metrics in selection screen. Click on green arrow button in front “procedural metrics”

 

                     cyclo3.png

  1.4 Select Show Metrics option. Change in “Scope and rule for metrics section as per your need”. Click on Ok     button.

 

                     cyclo4.png

 
  

 

 

2. How to check CCN

 

  2.1 Open  program using Tcode “SE38”. Go to program->check->Code Inspector

 

                cyclo5.png

  2.2  Go to “Procedural Metrics “ section. Double click on the detail line as per below screen shot

 

                     cyclo6.png

 

          

  2 .3  Cyclomatic complexity number should be displayed as output.

 

                    cyclo8.png


Viewing all articles
Browse latest Browse all 2136

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>