IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

webMethods Lines of Code Calculator

  • 1.  webMethods Lines of Code Calculator

    Posted Mon March 07, 2022 10:53 PM

    Problem Statement:

    A lot of times there is a need to calculate webMethods flow lines of code . So options for your

    1. Create a custom logic
    2. User ISCCR provided by Software AG team which has lots of advance features of static code analysis and detailed reports but would need you to have a license agreement.

    Possible Solutions

    The best solution would be to use ISCCR tool as its can easily plug into your CI/CD pipeline or use via Designer for creating your build gates.

    There we have another solution which is WxCodeLineCalculator which is an Integration Server Package which can give you the count of different flow steps in your flow service for your full package or for all your flow services on that particular Integration Server.

    What product/components do you use and which version/fix level?

    This can work with all version of webMethods 10.X plus the latest version 10.11.

    Are you using a free trial or a product with a customer license?

    Check with your account executives on the usage of this package.

    What are trying to achieve? Please describe in detail.

    The way the solution works is it checks for all flow xml and parses it to get the details of following in the flow xml:
    • If
    • Switch
    • Exit
    • Map
    • Repeat
    • Loop
    • Sequence Main
    • Sequence Try or new Try flow step
    • Sequence Catch or new Catch Flow step
    • Finally
    • Invoke Services
    • Transformers

    Do you get any error messages? Please provide a full error message screenshot and log file.

    In case of any issues the errors are suppressed only the flows which could be parsed are show in report.

    Have you installed latest fixes for the products

    Doesn’t get impacted by any other fixes

    How does the Solution Works

    image

    image


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: webMethods Lines of Code Calculator

    Posted Tue March 08, 2022 04:30 PM

    In the years that I’ve been doing wM IS development, this has not come up even once. I’d be curious to learn when this sort of “measure” would be useful.


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 3.  RE: webMethods Lines of Code Calculator

    Posted Tue March 08, 2022 05:23 PM

    As a total number this is rather useless, but measured per service this could be a metric for the code complexity. However, to be integrated into the build (CI) process, it should deliver the numbers in an automtically processible way (e.g. XML), and one also should have a tool capable of interpreting the data and somehow steering the build process.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: webMethods Lines of Code Calculator

    Posted Tue March 08, 2022 09:21 PM

    I beg to differ as its based on request from customers where they need to report this at enterprise level as similar reports are available with other programming languages .

    Making it part of of CI/CD shouldnt be a problem also and creating xmls of specific format shouldnt be a challenge


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: webMethods Lines of Code Calculator

    Posted Wed March 09, 2022 01:29 AM

    Hi @Shashank_Mitra1 ,

    I’m not sure if FLOW can be compared directly to other programming languages.

    I would be interested in the next steps after we have this data. If a particular flow service has 20 invokes , what next? Would we try to break the service into more manageable chunks ( I’m not saying I would or would not ), would just like to know how this data can be used.
    I do see how a measure like Cyclomatic complexity - Wikipedia maybe useful in aiding easy understanding though.

    -NP


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 6.  RE: webMethods Lines of Code Calculator

    Posted Wed March 09, 2022 01:51 AM

    any programming language will have CC basically cc says if your code has branches you need to have 1 plus the number of branches to ensure you have 100 % code coverage .

    Just an example say in your code you have branch ( i.e. nothing but if else) you will need to have at least 2 test cases right thats the same if you talk of if in java or other programming technology


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: webMethods Lines of Code Calculator

    Posted Wed March 09, 2022 11:57 AM

    Sure, people have asked for it. I’m wondering why. Reporting on it – okay, but what will be done with that report?

    SLOC can be used in many wrong ways and likely only a few useful ways. I’m interesting in learning who knows for sure any of the useful ways. :slight_smile:


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: webMethods Lines of Code Calculator

    Posted Sat March 19, 2022 03:51 AM

    customers and developers asked so just created :slight_smile:


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: webMethods Lines of Code Calculator

    Posted Tue March 08, 2022 09:17 PM

    Hello Reamon

    As we have had customers come asking for specially for this so shared the same

    Regards


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 10.  RE: webMethods Lines of Code Calculator

    Posted Wed March 16, 2022 02:31 PM

    Hi @Shashank_Mitra1. Seems its good to have tool as many times developers will be messing around the service by keep on adding logic to the same service and make it huge as the time passes. It won’t be realized until its impacting performance or too hard to manage. Especially young developers would dare to touch either because of its size or it is a business critical service.

    I can see that this can be used to review if loops are over used, to review unnecessary try catch blocks, to see if many invokes are used(if too many invokes are used then saving a service for any change would test the developers patience :stuck_out_tongue: ) etc. I would encourage to go for these kind of tools mostly for old projects and also in few cases in early development phase of project to have control over the quality of code and to make developer life easier.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 11.  RE: webMethods Lines of Code Calculator

    Posted Sat March 19, 2022 03:50 AM

    yap working on creating some utility which can split big code into simple chunks


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services