How to design a program which determines cyclomatic complexity-advice plz!

Hi there,
I've been asked to design a program to detect the cyclomatic complexity of a module read in from a text file. The program should then display whether or not the module is far too complex or not.
The problem I am having is as follows:
In what way should I test the complexity?
I could count the number of conditional statements and add 1. Possible problems here may be mis-counting(difference between do-while and while).
Any advice would be great,
Thanks in advance
Chris,

The difference between while and Do while is irrelevant. They are both while loops and can be counted by just counting the while part, the do can be ignored.
while (x<y){
xxxxxxxxxxx
do{
xxxxxxxxxxx
}while(x<y)

Similar Messages

  • How to design a program on paper.

    how to design a program on paper.
    I am planning to create a small program, I want to do some paper work before writing the first line of code, what do I do and how do I do ?
    should I learn UML and do it or any other thing ?
    my question is to experience programmers, what do you do before writing the code for any program ?

    Most projects do very little other than collect information, process the information, and store the information.
    1st - Identify what your project really is (project statement including well defined scope)
    2nd - Identify resources
    Data
    Users
    Equipment Needed
    Developers available for the project
    etc...
    3rd - Do a reality check against your resources
    4th - Aquire more resources as required or scale back project scope
    5th - Get buy off from interested parites on your project definition and scope.
    6th - loop back to 1 as need to attain a working definition and resources to complete the project.
    (Notice: no code has been written yet--nor even thought about)
    7th - Identify Data and Data Sources
    8th - Define appropriate distribution of functionality across Tiers
    9th - Assign teams for each or set phase of each for implementation purposes (according to project needs) Note: User Interfaces are always most complex -- assign your people accordingly.
    10th - Identify data and processes specific to tier
    11th - process flow models with data flow over lays
    12th - design objects to implement process and facilitate data flow
    13th - functionality review and buy off from clients
    14th - loop back to 10 as needed
    (Notice: no code yet)
    15th - <here it is> code here
    16th - debug (with code reviews)
    17th - integrate
    18th - debug (with code revies)
    19th - loop back to 15 as needed
    20th - alpha test (large integration)
    21st - debug (with code reviews)
    22nd - loop back to 20 as needed
    23rd - beta and user trials
    24th - user requested changes
    25th - debug (with code reviews)
    26th - loop back to 23 as needed
    27th - user buy off
    28th - project delivered
    29th - wrap up and archive of documentation
    30th - on going (life cycle) maintenance.
    There ya go, that is about what I go through when desiging a project--the coding is a very very small part in comparison to the rest. Coding come to approximately 20% of a project.

  • How to find a program, which is using "Z" variant

    Hi All,
    I know only on custom devloped variant name, say "ZTEST". I do not know, which program is using it. Entry is there in TVARV table.
    Please let me know, how can I find the program, which is using that variant.
    Thanking you,
    Chetan Shah

    Hi Chetan,
    The variants for a report will be stored in the table <b>VARI</b>.
    Give your variant name to the field VARI-VARIANT and it will give the report name in the field VARI-REPORT.
    If you have same variant for the other reports, then it will shows the list of reports which the same variant name.
    I am working on ECC 5.0 and able to see this table.
    Thanks,
    Vinay

  • How to debug a program which is running in background (Job)

    Hi,
    I have a program which can be run only in background. I have to debug that program. Could you please let me know, how can I do that?
    Thanks,
    Sandeep

    basic FAQ, please search before asking.
    Thread locked.
    Thomas

  • How to find a program which modifies the variant of a standard program?

    Hi,
    I have an issue where the variant values of the standard program RKEVEXT3 (Transaction : KEFC), is getting changed by a background job.I need to find the program which modifies the values of the variant.
    Any input on this will be helpful.
    Regards,
    Raj

    hi Raj,
    you can change variants with FM RS_VARIANT_CHANGE. I would suggest to run a where used list for this variant in your system.
    hope this helps
    ec

  • How can I compile program which uses packages?

    Hi,
    I'm building a program using JBuilder9. I can successfully run using that IDE, but after I try to run it manually (run class file which compiled from JBuilder) by typing "javac myMainClass" it cannot find serveral packages which I put those packages' folder on the same root directory of myMainClass. Thank you.

    Man, you should probably read the following:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    Anyways, the first thing to do is to determine the current value of CLASSPATH (that is a system variable and it depends on your OS how you change/get its value).
    Next thing is to determine WHAT you need to add:
    For each used package check if its (root directory/jar) is in your CLASSPATH. If not add it, e.g.
    - you have a package my.test.package in C:\temp\myJar.jar then add C:\temp\myJar.jar
    - you have a package my.test.package in C:\temp, i.e. your fs structure is C:\temp\my\test\package, then add C:\temp
    For beginners, it's usually a good idea to have your CLASSPATH contain a dot (".") ...

  • How to design a GUI which has n number of component are changing?

    Hello,
    I have a problem in designing a GUI. The Gui contain number of components which being changing on the frame depending on the action.
    For example:
    Initial frame contain only the combobox which has few data( let we take tennis, cricket, football..)
    If the user select one of this then the frame should add few more component like
    cricket should add 24 combobox for selection of the team and the member and the fields to show the information of the individual details.
    tennis: should remove the cricket related component and replaced by tennis related component. ....
    One more thing is
    If we select one of the content of the combo box then it should display the one more combo box.
    If we select one from this combo box then it should display one more this should be continue till the user select the end in the combo box.
    Please help in this part to complete the designing of the Gui. I want whether we can do add number of components dynamically in a single frame? If possible how?
    Thanks in advance
    Regards,
    kakolia

    Post Author: geckos
    CA Forum: General
    You need to find a commonality between the tables.  The date fields contain a "month" value that you could use. I don't know what the database source is but here is a suggestion in "psuedo SQL" to get you started. The NVL is an Oracle function that replaces a NULL instance with something, in this case a '0'. The "month" function extracts out the numeric month. Without modifying your database structure to add the common keys, you will have to create a "custom command" query when creating your datasource based on a query similar to the one below.
    SELECT    a.Mo,    (a.A - b.B) BalFROM    (    SELECT  NVL(SUM(Money),0) A,                  Month(Date) Mo    FROM  Sale    GROUP BY Month(Date)   ) a,   (   SELECT  NVL(SUM(Money),0) B,                  Month(Date) Mo   FROM  Buy   GROUP BY Month(Date)   ) bWHERE   a.Mo = b.Mo

  • How to design plug-in which extract information from file opened in illustrator

    Hi Everyone,
    I want to design a plug-in in adobe illustrator which could extract information from pdf file which is opened in illustrator.
    Can anyone give me direction from where could I start.??
    Thanks in advance.

    This is very difficult in any API because there are no tables in PDF.
    If the table is at a known exact location you would extract text from each known cell location
    If you have to discover tables you need to decide how to recognise them: perhaps by looking for drawn lines and analysing their relationship to see if they form a grid; then use the positions derived to get the text from the table.

  • How to design plug-in which extract information from file opened in illustrator in Illustrator

    Hi Everyone,
    I want to design a plug-in in adobe illustrator which could extract information from pdf file which is opened in illustrator.
    Can anyone give me direction from where could I start.??
    Thanks in advance.

    Moving this discussion to illustration community.

  • How To Make A Program Which When I Press A Button The Number Goes Up One?

    I have already made this:
    import java.awt.Container;
    import java.awt.LayoutManager;
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    public class Lab04 extends JFrame
    private Container content;
    private LayoutManager layout;
    private JLabel number, division, modulus, space;
    private JTextField text;
    private String string;
    private ActionListener listener;
    private char char1;
    private int x, Add1, Add2;
    private JButton bAdd;
    public Lab04()
    formatWindow();
    listener = new Handler();
    bAdd = createAndAddButton("+1");
    number = createAndAddLabel("Current Number: 0");
    division = createAndAddLabel(" n DIV 4 = 0");
    space = createAndAddLabel(" ");
    modulus = createAndAddLabel(" n MOD 4 = 0");
    public void formatWindow()
    content = getContentPane();
    layout = new FlowLayout();
    content.setLayout(layout);
    private JLabel createAndAddLabel(String s)
    JLabel temp = new JLabel();
    temp.setText(s);
    content.add(temp);
    return temp;
    private JTextField createAndAddTextField(int x)
    JTextField temp = new JTextField(x);
    temp.addActionListener(listener);
    content.add(temp);
    return temp;
    private JButton createAndAddButton(String s)
    JButton temp = new JButton();
    temp.setText(s);
    temp.addActionListener(listener);
    content.add(temp);
    return temp;
    private void process()
    int x = 0;
    Add1 = x +1;
    private void output()
    number.setText("Current Number: "+x+1);
    private class Handler implements ActionListener
    public void actionPerformed(ActionEvent e)
    process();
    output();
    public static void main(String[] args)
    //create graphics window
    Lab04 window = new Lab04();
    //configure graphics window
    window.setSize(200, 150);
    window.setLocation(300, 175);
    window.setTitle("Unit 3 Lab03: Filling Out Forms");
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //display graphics window
    window.setVisible(true);
    And all it does is it gives me the number 01, what should I do?

    public void process{
    int x = 0;
    Add1 = x +1;
    }just what is this supposed to do? every time you call it, it create a primitive x with value 0, and then makes Add1 equal to x+1. that will be 1 no matter how many times you call it.

  • How to create a program which can be installed as NT service?

    I wrote a server program using LW/CVI 5.5. I want to install it on NT/2000
    OS and running as NT/2000 services. I know SRVANY.EXE can do this, but I
    want to one step do this using INSTSRV.EXE or using install utility to modify
    registry keys.
    Thanks.

    Hi
    Thanks for your fast replies.. I have created a new material and was able to create inventory thru MB1C. But I was not able to generate a goods delivery(VL01N) and billing document(VF01)  for the sales order.
    Error: No schedule lines due for delivery up to the selected date
    Message no. VL248
    Diagnosis
    There are no schedule lines due for the given order item up to the date chosen.
    System Response
    The system does not create a delivery item for this order item.
    Procedure
    Check whether the order item to be delivered contains confirmed schedule lines.
    If this is the case, set the selection date further into the future if you still want to create a delivery for this item.
    Please suggest,
    Tanks,
    Suma
    Edited by: Suma B on Sep 23, 2008 3:55 PM

  • How to reach Java program which is run as individual process

    Hi There .
    My question is if I run a java program as individual process using Runtime , can I reach this process and change some variables up there, like set a boolean variable to false , or stopping running thread properly. whatever. till now I figure out two ways , either kill the PID of my program (if I want to stop it ), or touching a new file and when the program sense that the is been created he will take an action ,like exit or do the things that I want to do, I tried and I googled it but I ends up with nothing , what I understand it's like it's irreversible thing when it's run there is no way back. Thanks in Advance

    No you can't interact with a process you start as if it were just other Java code.
    What you can is interact with it in the same ways you can interact with any other process. For example through the process input and output stream. Or perhaps through Sockets.

  • Running the program which saves file in sap directory in background

    Hi guys,
    how to Run the program which saves file in sap directory in background? Thanks!

    Hi Mark,
    AL11 is a transaction that shows your application server something like an windows browser.
    If you want to store file in your application server then you can write a code which uploads the data in to a file on application server.And you can run your code in background also.
    Use function module :SAP_DATA_CONVERT_WRITE_FILE to write file on the application server.
    If you want to upload file manually then use TCODE :CG3Z.
    Hope this will you out.

  • How to get the program where the User exit is use

    Hi,
       Could anyone let me know how to get the program which is using the user exit
    EXIT_SAPLFMR4_002 .
    Thank you.
    Donny~

    You can do a where used on the functino module EXIT_SAPLFMR4_002 in SE37.
    In this case, you user exit is called from a function module FMRE_FI_BELEG_CHECK.  Which in my system, doesn't appear to be called directly. It could be called dynamically.
    Regards,
    RichHeilman

  • How to do job_submit on a program which calls a custom FM?

    Hi all,
    I am doing a job_open, job_submit and job_close to submit a FM in background.
    Now, how do I do a job_submit for a program which contains the FM that doing the real processing?
    Details:
    Program ZNSC_WRAP_RMD contains call function "YXAPY_REVIEW_MASTER_DATA'
    CALL FUNCTION 'YXAPY_REVIEW_MASTER_DATA'
        EXPORTING
          i_pay_area                        = ' '
        I_CHECK_OPTION                    =
        I_GUI_ENABLE                      = ' '
        I_PERNR                           =
       IMPORTING
        E_LOCK_EMP_TBL_ERROR              =
        E_TIME_RECON_TBL                  =
        E_UNAPPROVED_TIME_TBL_ERROR       =
        E_WAGE_TYPE_TBL                   =
        E_MISSING_INFO_TBL_ERROR          =
         E_RETURN                          = e_return
        tables
          t_return                          = t_return
    Any idea?

    A job running in the background can not and should not use the frontend resources example GUI.
    In your function module I see a parameter * I_GUI_ENABLE = ' '. Check it's usage and make sure GUI (and frontend processes) are disabled for the job to run in the back ground.
    Any direct or indirect use of classes or FM calls which require frontend cannot execute in background as a job.
    Regards,
    Aabhas

Maybe you are looking for

  • R9 290X Gaming BIOS Request

    S/N:602-V308-06SB1403010327 Current BIOS https://drive.google.com/file/d/0B_EoPeiOdlxPdUV3WEpFdktWaDg/edit?usp=sharing

  • LG 32" LCD Opinion

    Hey can I get some feedback on the 32LG30 TV.  I'm thinking about buying one.  I have the samsubf 32" LNa450 but I am not impressed by the tuner that is in the TV.  My converter box picks up more stations than the digital tuner in the tv, USING THE S

  • Fit to fill with 1 frame length subclips

    I have 93 single frame subclips that i need to fill 3 second length slugs with. when i use fit to fill it only fills the first frame of each slug but not the entire slug. Or how do I make the single frame subclips stretch to 3 second length clips

  • How to automatically update marked table

    Hi Friends, I am using Oracle SQL Developer and want to set the in Preferences menu that my actual selected and viewed database table is marked automatically in Connections/Tables menu. How can I set this function in Oracle SQL Developer. Br, Ugur

  • Extend idoc

    for extended idoc i added the extended segment to basic type and doen the code as per that but i would like to confirm one thing that for every extended idoc for process code we need to modify the existing FM like MASTERIDOC_CREATE_DEBMAS ,   for thi