Submit and vote on feature ideas.

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.

Defining custom metrics for C/C++ [Halstead and others]

We are migrating from version 9 to 10 of C/C++. One of the things we wanted to do was run more metrics on code. Discovered a short blog on how to export, modify and then import the properties file. In our case we want to try out Halstead metrics and any of the other metrics available for C/C++. When we do the export we see the Halstead metrics for DotNet but not for C/C++. Attempted several configurations but no success. So I will list the questions followed by a textual example of the properties file.
**
Are the loading/saving of metrics configurable in version v10+ only or v9 as well ?
[ A CHART FOR WHICH F(X) ARE SUPPORTED IN EACH RELEASE WOULD BE GREAT ]

The Hastead metrics definitions are exported in the configuration for dotnet but not for C++, are these supported in C++ ?

Are there examples of setting up the configuration file for each metric ?

Are there examples of setting the range values for each metrics MAX/MIN ?

Examples-Questions follow:
1)
//tried this as a test - no luck
METRIC.HDIFM.ThresholdEnabled=true
METRIC.HDIFM.Threshold=1 10

2)
//added below as a test - no luck
com.parasoft.xtest.checker.metrics.enable.metric.cpp.CYCLOMATIC_COMPLEXITY=true

//although these are exported in the same file as dotnet options, we tried them with .cpp in the configuration name but no luck.
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.CYCLOMATIC_COMPLEXITY=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.EFFECTIVE_CODE_LINES_METHOD=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.INHERITANCE_DEPTH=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.LACK_OF_COHESION=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.MAINTAINABILITY_INDEX=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NESTED_BLOCKS_DEPTH=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_CLASS_COUPLING=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_CLASSES=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_CODE_LINES_IN_METHOD=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_INSTANCE_METHODS=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_INTERFACES=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_LINES_IN_METHOD=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_METHOD_PARAMETERS=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_NAMESPACES=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_STATIC_METHODS=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_TYPE_INSTANCE_FIELDS=true
com.parasoft.xtest.checker.metrics.enable.metric.dotnet.NUM_OF_TYPE_STATIC_FIELDS=true
com.parasoft.xtest.checker.metrics.enabled=true

~~~~

Comments