Main Content

Check JSF AV C++ rules (-jsf-coding-rules)

(Removed) Check for violations of JSF C++ rules

Using Code Prover to check for violations of JSF® C++ rules is no longer supported. Use Check JSF AV C++ rules (-jsf-coding-rules) in Bug Finder instead. For more information, see Version History.

Description

Specify whether to check for violation of JSF AV C++ rules (JSF++:2005). Each value of the option corresponds to a subset of rules to check.

Set Option

User interface (desktop products only): In your project configuration, the option is on the Coding Standards & Code Metrics node. See Dependency for other options that you must also enable.

Command line and options file: Use the option -jsf-coding-rules. See Command-Line Information.

Why Use This Option

Use this option to specify the subset of JSF C++ rules to check for.

After analysis, the Results List pane lists the coding standard violations. On the Source pane, for every coding rule violation, Polyspace® assigns a symbol to the keyword or identifier relevant to the violation.

Settings

Default: shall-rules

shall-rules

Check all Shall rules. Shall rules are mandatory requirements and require verification.

shall-will-rules

Check all Shall and Will rules. Will rules are intended to be mandatory requirements but do not require verification.

all-rules

Check all Shall, Will, and Should rules. Should rules are advisory rules.

from-file

Specify an XML file where you configure a custom selection of checkers for this coding standard. To create a configuration file, click , then select the rules and recommendations you want to check for this coding standard from the right pane of the Checkers selection window. Save the file.

To use or update an existing configuration file, in the Checkers selection window, enter the full path to the file in the field provided or click Browse.

If you set the option to from-file, enable Set checkers by file (-checkers-selection-file).

Tips

  • If your project uses a setting other than generic for Compiler (-compiler), some rules might not be completely checked. For example, AV Rule 8: “All code shall conform to ISO/IEC 14882:2002(E) standard C++.”

Dependency

This option is available only if you set Source code language (-lang) to CPP or C-CPP.

For projects with mixed C and C++ code, the JSF C++ checker analyzes only .cpp files.

Command-Line Information

Parameter: -jsf-coding-rules
Value: shall-rules | shall-will-rules | all-rules | from-file
Example (Bug Finder): polyspace-bug-finder -sources file_name -jsf-coding-rules all-rules
Example (Code Prover): polyspace-code-prover -sources file_name -jsf-coding-rules all-rules
Example (Bug Finder Server): polyspace-bug-finder-server -sources file_name -jsf-coding-rules all-rules
Example (Code Prover Server): polyspace-code-prover-server -sources file_name -jsf-coding-rules all-rules

Version History

expand all

R2024a: Removed from Code Prover

If you use the option -jsf-coding-rules in a Code Prover analysis, Polyspace issues a warning and ignores the option. The workflow for checking coding rule violation has been removed from Code Prover. To check for coding rule violations, use Bug Finder. For instance, at the command line, replace this command:

polyspace-code-prover -sources file_name -jsf-coding-rules all-rules
with this command:
polyspace-bug-finder -sources file_name -jsf-coding-rules all-rules
See Migrate Code Prover Workflows for Checking Coding Standards and Code Metrics to Bug Finder.