Line with more than one statement
Multiple statements on a line
Description
This defect occurs when, before
preprocessing starts, the analysis detects additional text after the
semicolon (;
) on a line. A defect is not raised for
comments, for
-loop definitions, braces, or
backslashes.
Risk
Use of one statement per line improves readability of the code. Since most statements in your code appear on a new line, use of multiple statements per line in a few cases within this arrangement can make code review difficult.
Fix
Write one statement per line.
If you do not want to fix the issue, add comments to your result or code to avoid another review. See:
Address Results in Polyspace User Interface Through Bug Fixes or Justifications if you review results in the Polyspace user interface.
Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access) if you review results in a web browser.
Annotate Code and Hide Known or Acceptable Results if you review results in an IDE.
Examples
Result Information
Group: Good practice |
Language: C | C++ |
Default: Off |
Command-Line Syntax: MORE_THAN_ONE_STATEMENT |
Impact: Low |
Version History
Introduced in R2013bSee Also
Topics
- Interpret Bug Finder Results in Polyspace Desktop User Interface
- Interpret Bug Finder Results in Polyspace Access Web Interface (Polyspace Access)
- Address Results in Polyspace User Interface Through Bug Fixes or Justifications
- Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access)