0% found this document useful (0 votes)
83 views

Polyspace Code Verification: Coding Standards Report For Project: Polyspace

The document summarizes violations of custom coding rules for the project "polyspace" as analyzed by Polyspace. 18 violations across 8 rules were found in a single C file. The violations included issues with file names, macros, struct tags, and naming conventions for global functions and parameters. Appendix sections provide details on the analysis settings and definitions of terms.

Uploaded by

Loc Huynh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views

Polyspace Code Verification: Coding Standards Report For Project: Polyspace

The document summarizes violations of custom coding rules for the project "polyspace" as analyzed by Polyspace. 18 violations across 8 rules were found in a single C file. The violations included issues with file names, macros, struct tags, and naming conventions for global functions and parameters. Appendix sections provide details on the analysis settings and definitions of terms.

Uploaded by

Loc Huynh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Polyspace Code Verification

Coding Standards Report for Project: polyspace


Report Author: ctreille
Polyspace Code Verification: Coding Standards Report for Project: polyspace
by Report Author: ctreille

Published 05-May-2020 15:54:22


Verification Author(s): Polyspace
Polyspace Version(s): Polyspace Code Prover Server 10.3 (R2020b Prerelease)
Project Version(s): 1.0

Result Folder(s):
/mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/code-prover-server-results/reporting/template-codingstandards/OR-414-6-codingsta
ndards_1
Table of Contents
Chapter 1. Custom Coding Rules ............................................................................................................................................................................................................... 1
Custom Coding Rules Summary - Violations by File ........................................................................................................................................................................ 1
Custom Coding Rules Summary - Violations by Rule ...................................................................................................................................................................... 1
Custom Coding Rules Summary for all Files ..................................................................................................................................................................................... 2
Custom Coding Rules Summary for Enabled Rules ......................................................................................................................................................................... 2
Custom Coding Rules Violations ........................................................................................................................................................................................................ 3
Chapter 2. Appendix 1 - Configuration Settings ...................................................................................................................................................................................... 6
Polyspace Settings ............................................................................................................................................................................................................................... 6
Analysis Assumptions ................................................................................................................................................................................................................. 6
Coding Standard Configuration ......................................................................................................................................................................................................... 7
Chapter 3. Appendix 2 - Definitions ........................................................................................................................................................................................................... 9
................................................................................................................................................................................................................................................................. 9

i
Chapter 1. Custom Coding Rules
Custom Coding Rules Summary - Violations by File

Custom Coding Rules Summary - Violations by Rule

1
Custom Coding Rules Summary for all Files
File Total
/mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/reporting/template-codingstandards/OR-414-6-codingstandar 18
ds_1.c
Total 18

Custom Coding Rules Summary for Enabled Rules


Rule Description Pattern Total
1.1 All source file names must follow the specified pattern. Geck_C.*.c 1
1.2 All source folder names must follow the specified pattern. .*sources 1
2.1 All macros must follow the specified pattern. MACRO_[A-Z0-9_]* 1
2.2 All macro parameters must follow the specified pattern. _mp_.* 1
3.1 All integer types must follow the specified pattern. .*_s 0
3.2 All float types must follow the specified pattern. .*_f 0
3.3 All pointer types must follow the specified pattern. .*_p 0
3.4 All array types must follow the specified pattern. .*_a 0
3.5 All function pointer types must follow the specified pattern. .*_fp 0
4.1 All struct tags must follow the specified pattern. _s_.* 1
4.2 All struct type must follow the specified pattern. s_.* 0
4.3 All struct fields must follow the specified pattern. f_.* 0
4.4 All struct bit fields must follow the specified pattern. bf_.* 0
5.1 All class names must follow the specified pattern. c_.* 0
5.2 All class types must follow the specified pattern. c_.*_t 0
5.3 All data members must follow the specified pattern. m_.* 0
5.4 All function members must follow the specified pattern. fm_.* 0
5.5 All static data members must follow the specified pattern. sm_.* 0
5.6 All static function members must follow the specified pattern. sf_.* 0
5.7 All bitfield members must follow the specified pattern. bm_.* 0
Total 18

2
Rule Description Pattern Total
6.1 All enumeration tags must follow the specified pattern. _e_.* 0
6.2 All enumeration types must follow the specified pattern. e_.* 0
6.3 All enumeration constants must follow the specified pattern. E_[A-Z_]+ 0
7.1 All global functions must follow the specified pattern. gf_.* 4
7.2 All static functions must follow the specified pattern. sf_.* 0
7.3 All function parameters must follow the specified pattern. .*_p 2
8.1 All global constants must follow the specified pattern. G_[A-Z][A-Z0-9_]* 0
8.2 All static constants must follow the specified pattern. S_[A-Z][A-Z0-9_]* 0
8.3 All local constants must follow the specified pattern. L_[A-Z][A-Z0-9_]* 0
8.4 All static local constants must follow the specified pattern. SL_[A-Z][A-Z0-9_]* 0
9.1 All global variables must follow the specified pattern. gv_[a-z][a-z0-9_]* 0
9.2 All static variables must follow the specified pattern. sv_[a-z][a-z0-9_]* 0
9.3 All local variables must follow the specified pattern. lv_[a-z][a-z0-9_]* 7
9.4 All static local variables must follow the specified pattern. slv_[a-z][a-z0-9_]* 0
10.1 All namespaces must follow the specified pattern. nm_.* 0
11.1 All class templates must follow the specified pattern. Tmp_.* 0
11.2 All class template parameters must follow the specified pattern. T_.* 0
12.1 All function templates must follow the specified pattern. F_.* 0
12.2 All function template parameters must follow the specified pattern. FT_.* 0
12.3 All function template members must follow the specified pattern. FM_.* 0
Total 18

Custom Coding Rules Violations


Table 1.1. /mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/reporting/template-codi
ngstandards/OR-414-6-codingstandards_1.c
ID Rule Message Function Line Col Jus Severity Status Comment
1 1.2 All source folder names must follow the specified pattern. File Scope 1 0 No Unset Unreviewed
files dirname
The source dir name '/ma
thworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/m

3
ID Rule Message Function Line Col Jus Severity Status Comment
atlab/toolbox/qualkits/iec/codeprover/tests/reporting/temp
late-codingstandards' does not match the specified pattern
.
2 1.1 All source file names must follow the specified pattern. File Scope 1 0 No Unset Unreviewed
files basename
The source file name 'OR-414-6-codingstandards_1.c' does
not match the specified pattern.
3 2.1 All macros must follow the specified pattern. File Scope 4 9 No Unset Unreviewed
macros
The macro 'offsetof' does not match the specified pattern.
4 2.2 All macro parameters must follow the specified pattern. File Scope 4 9 No Unset Unreviewed
macro parameters
The macro parameter 'type' does not match the specified
pattern.
macro parameters
The macro parameter 'field' does not match the specified
pattern.
5 7.1 All global functions must follow the specified pattern. File Scope 7 4 No Unset Unreviewed
global functions
The global function 'foo1' does not match the specified pat
tern.
10 4.1 All struct tags must follow the specified pattern. foo1() 8 11 No Unset Unreviewed
struct tag names
The struct tag 'new_stc_2' does not match the specified pat
tern.
11 9.3 All local variables must follow the specified pattern. foo1() 8 22 No Unset Unreviewed
local variables
The local variable 'ptr_str_1' does not match the specified
pattern.
12 9.3 All local variables must follow the specified pattern. foo1() 10 25 No Unset Unreviewed
local variables
The local variable 'ptr_union_2_2_1' does not match the
specified pattern.
13 7.1 All global functions must follow the specified pattern. File Scope 15 4 No Unset Unreviewed
global functions
The global function 'foo' does not match the specified patt
ern.
7 7.1 All global functions must follow the specified pattern. File Scope 19 4 No Unset Unreviewed
global functions
The global function 'bar' does not match the specified patt
ern.

4
ID Rule Message Function Line Col Jus Severity Status Comment
14 9.3 All local variables must follow the specified pattern. bar() 20 17 No Unset Unreviewed
local variables
The local variable 'rd' does not match the specified patter
n.
8 7.1 All global functions must follow the specified pattern. File Scope 27 5 No Unset Unreviewed
global functions
The global function 'func' does not match the specified pat
tern.
16 7.3 All function parameters must follow the specified pattern. main() 35 13 No Unset Unreviewed
function parameters
The function parameter 'argc' does not match the specifie
d pattern.
17 7.3 All function parameters must follow the specified pattern. main() 35 25 No Unset Unreviewed
function parameters
The function parameter 'argv' does not match the specifie
d pattern.
6 9.3 All local variables must follow the specified pattern. main() 38 8 No Unset Unreviewed
local variables
The local variable 'a' does not match the specified pattern.
18 9.3 All local variables must follow the specified pattern. main() 39 8 No Unset Unreviewed
local variables
The local variable 'b' does not match the specified pattern.
15 9.3 All local variables must follow the specified pattern. main() 40 9 No Unset Unreviewed
local variables
The local variable 'ptr' does not match the specified patter
n.
9 9.3 All local variables must follow the specified pattern. main() 41 10 No Unset Unreviewed
local variables
The local variable 'p' does not match the specified pattern.

5
Chapter 2. Appendix 1 - Configuration Settings
Polyspace Settings
Option Value
-author Polyspace
-compiler generic
-custom-rules /mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/reporting/custom_rules.txt
-date 05/05/2020
-I /mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/options-api/lib
-lang C
-O2 -O2
-prog polyspace
-results-dir /mathworks/devel/sbs/31/ctreille.Bpolyspace_integ.j1378116/matlab/toolbox/qualkits/iec/codeprover/tests/code-prover-server-results/reporting/templa
te-codingstandards/OR-414-6-codingstandards_1
-target i386
-to pass2
-verif-version 1.0

Analysis Assumptions
Assumption Issuer
External arrays of unspecified size can be safely accessed at any index Product
Nonfinite floats (infinities and NaNs) are not considered Product
Computations involving unsigned integers do not overflow Product
Results of floating-point arithmetic are rounded following the IEE754 rule: round to nearest, ties to even Product
Structure fields are not volatile unless the entire structure is volatile-qualified Product
Stack pointers can be safely dereferenced even outside the pointed variable's scope Product
External pointers cannot be null. They point to allocated data of sufficient size for safe dereference Product

6
Assumption Issuer
Absolute addresses can be safely dereferenced Product

Coding Standard Configuration


Table 2.1. Custom Coding Rules Configuration
Rule Description Convention Pattern Comment Enabled
1.1 All source file names must follow the specified pattern. files basename Geck_C.*.c - yes
1.2 All source folder names must follow the specified pattern. files dirname .*sources - yes
1.3 All include file names must follow the specified pattern. - - - no
1.4 All include folder names must follow the specified pattern. - - - no
2.1 All macros must follow the specified pattern. macros MACRO_[A-Z0-9_]* - yes
2.2 All macro parameters must follow the specified pattern. macro parameters _mp_.* - yes
3.1 All integer types must follow the specified pattern. integer type names .*_s - yes
3.2 All float types must follow the specified pattern. float type names .*_f - yes
3.3 All pointer types must follow the specified pattern. pointer type names .*_p - yes
3.4 All array types must follow the specified pattern. array type names .*_a - yes
3.5 All function pointer types must follow the specified pattern. function pointer type nam .*_fp - yes
es
4.1 All struct tags must follow the specified pattern. struct tag names _s_.* - yes
4.2 All struct type must follow the specified pattern. struct type names s_.* - yes
4.3 All struct fields must follow the specified pattern. struct fields f_.* - yes
4.4 All struct bit fields must follow the specified pattern. struct bit fields bf_.* - yes
5.1 All class names must follow the specified pattern. class names c_.* C++ yes
5.2 All class types must follow the specified pattern. class type names c_.*_t C++ yes
5.3 All data members must follow the specified pattern. data members m_.* C++ yes
5.4 All function members must follow the specified pattern. function members fm_.* C++ yes
5.5 All static data members must follow the specified pattern. static data members sm_.* C++ yes
5.6 All static function members must follow the specified pattern. static function members sf_.* C++ yes
5.7 All bitfield members must follow the specified pattern. bitfield members bm_.* C++ yes
6.1 All enumeration tags must follow the specified pattern. enumeration tag names _e_.* - yes

7
Rule Description Convention Pattern Comment Enabled
6.2 All enumeration types must follow the specified pattern. enumeration type names e_.* - yes
6.3 All enumeration constants must follow the specified pattern. enumeration constants E_[A-Z_]+ - yes
7.1 All global functions must follow the specified pattern. global functions gf_.* - yes
7.2 All static functions must follow the specified pattern. static functions sf_.* - yes
7.3 All function parameters must follow the specified pattern. function parameters .*_p - yes
8.1 All global constants must follow the specified pattern. global constants G_[A-Z][A-Z0-9_]* - yes
8.2 All static constants must follow the specified pattern. static constants S_[A-Z][A-Z0-9_]* - yes
8.3 All local constants must follow the specified pattern. local constants L_[A-Z][A-Z0-9_]* - yes
8.4 All static local constants must follow the specified pattern. static local constants SL_[A-Z][A-Z0-9_]* - yes
9.1 All global variables must follow the specified pattern. global variables gv_[a-z][a-z0-9_]* - yes
9.2 All static variables must follow the specified pattern. static variables sv_[a-z][a-z0-9_]* - yes
9.3 All local variables must follow the specified pattern. local variables lv_[a-z][a-z0-9_]* - yes
9.4 All static local variables must follow the specified pattern. static local variables slv_[a-z][a-z0-9_]* - yes
10.1 All namespaces must follow the specified pattern. namespaces nm_.* C++ yes
11.1 All class templates must follow the specified pattern. class templates Tmp_.* C++ yes
11.2 All class template parameters must follow the specified pattern. class template parameters T_.* C++ yes
12.1 All function templates must follow the specified pattern. function templates F_.* C++ yes
12.2 All function template parameters must follow the specified pattern. function template parame FT_.* C++ yes
ters
12.3 All function template members must follow the specified pattern. function template membe FM_.* C++ yes
rs
20.1 Source line length must not exceed specified number of characters. - - - no

8
Chapter 3. Appendix 2 - Definitions

Table 3.1. Abbreviations


Abbreviation Definition
Col Column
Jus Justified
SQO Software Quality Objectives
NA Not Available

You might also like