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.

how to customize METRICS-39 ?

ajcurtis
ajcurtis Posts: 11

I am trying to create a version of METRICS-39 with a different threshold. I have duplicated the rule and modified the RULEMAP. However when I open the rule in the wizard there doesn't appear to be a way to modify the threshold like other rules.

what am I missing?

Comments

  • mstaron
    mstaron Posts: 35

    METRICS-39 is a cross rule. It means that it contains additional METRICS-39_TXT.rule in 'ext' subdirectory. You can change a threshold in python method 'result' in METRICS-39_TXT.rule.

  • ajcurtis
    ajcurtis Posts: 11

    Is there a special tool for opening this file? The file isn't editable with a text editor.

  • mstaron
    mstaron Posts: 35

    Yes, rules can be modified using 'RuleWizard'. See "Customizing and Creating Rules with RuleWizard" in C++test documentation.

  • ajcurtis
    ajcurtis Posts: 11

    I can not modify this metric. I have modified others. This is what I see when opening the duplication METRICS-39 in the RuleWizard

  • mstaron
    mstaron Posts: 35

    You should modify the METRICS-39_TXT.rule rule. Open it directly in the Rule Wizard (File-> Open) from the "dir/ext" directory, where "dir" is the directory where the duplicated METRICS-39 rule is saved (by default it is workspace.metadata.plugins\com.parasoft.xtest.staticanalyzer.eclipse.core.cpp\urules\ext ).
    It looks like:

    At the end of this rule is the "result" Python method. You can modify the threshold in the "if (VOCF> 4.0)" condition.