Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Adding new Metrics

LegacyForum Posts: 1,664 ✭✭
edited December 2016 in Jtest
Where should I add new metrics
I do not quite understand how the mark up should be developed to add a new metric. Where should I save the implemented class? Could some one tell me how I should go about adding a new metric? Thank you


  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭

    Could you send more information on what you would like to do with metrics? Are you trying to create a rule similar to the available metrics rules? Or, do you want to enable metrics reporting in Jtest?

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    I want to know how to create a new metric rule like the metric rules available.
    I know how to enable the metrics and get the metrics report.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    You can create simple metric type rules using RuleWizard.

    For example, to create a rule that checks if a method has more than 2 return statements do the following:
    1. Open RuleWizard (right-click in the standards tab of the Jtest configurations window)
    2. Create the method node:
      a. Select File > New b. Check By Node in Rule Creation c. Select Declarations > Method > Ok
    3. Now finish building the graphical representation of the rule (see the attachment)
    4. To complete the rule you will need to specify rule properties and save it to the jrules folder.

    For more information about rule nodes
    and creating user-defined rules in general, refer to the User's Guide in Jtest and the RuleWizard documentation (see Help).

    Please contact support through email if you need help creating a specific rule.