Static analysis violation

fatmanur61fatmanur61 Posts: 76

Hi I run the recommeded rules in c++test. I take a several violation in code. I did not interpret one violation which says 'Value 42 is out of acceptable range' lower than 30'. What does the meaning of it? I did not understand violation. The sreen shot of violation is attached to question.


  • Bogdan CzwartkowskiBogdan Czwartkowski Posts: 130 admin
    edited April 2019

    Hi @fatmanur61 ,
    This is violation of METRIC.CC rule, which calculates McCabe Cyclomatic Complexity.
    It is important to note, that Parasoft metrics can work two-fold:

    • metric rules calculate actual metric value for code elements, e.g. functions, which then can be displayed and analyzed in DTP widgets and explorers,
    • metric rules can also be configured to report a violation, whenever the calculated value is outside of specified thresholds.

    The metric rules are best configured in Test Configuration area of the DTP. In brief:
    1. go to Test Configurations page of DTP (details are here:
    2. Expand list of test configurations for specific tool, C/C++test in this case. If the list of configurations is empty, you may want to create a new one, or import existing configuration from your desktop (see here for details:
    3. Select your test configuration and then go to Metrics tab, and locate the METRIC.CC rule (
    4. Under the rule list you will see tabs with Documentation and Parameters for the selected rule. In the parameters tab you can select whether particular metric rule will report static analysis violations at all, and if so, under which conditions specified by thresholds.

Sign In or Register to comment.