Merge pull request #2240 from DOCGroup/revert-2239-jwi-pi23
[ACE_TAO.git] / ACE / bin / ACE+TAO+CIAO+DAnCE.json
blob3e715a522bea13848b152bcdca6532542b441e97
1 // Policy used in Coverity tests.
2 //
3 // Generates UNCALLED defects for functions which are not called by any test.
4 // Generates INSUFFICIENT_COVERAGE defects for functions which do not have
5 // 100% line coverage.
6 // Generates INSUFFICIENT_FILE_COVERAGE defects for files which do not
7 // have 100% line coverage.
8 //
9 // The line immediately following a coverity[TA.COVERAGE] annotation
10 // (i.e. in source code comments) is ignored for coverage purposes.
11 // Lines with xnocover annotations are ignored for coverage purposes.
13   type: "Coverity test policy definition",
14   format_version: 1,
15   recent_date_cutoff: "2012-03-07", // 6.1.0
16   old_date_cutoff: "2010-12-14", // 6.0.0
17   rules: [
18     {
19       violation_name: "INSUFFICIENT_COVERAGE",
20       aggregation_granularity: "function",
21       minimum_line_coverage_pct: 100,
22       use_filters: [ "exclude_annotated_lines", "executed_code", "focus_on_my_source", "exclude_logging_code", "exclude_throw_statements", "exclude_error_handlers" ]
23     },
24   ],
25   define_filters: [
26     {
27       filter_name: "executed_code",
28       function_filters: [
29         { is_executed: true,
30           exclusion_reason: "unexecuted code",
31         }
32       ]
33     },
34     {
35       filter_name: "exclude_annotated_lines",
37       line_filters: [
38         { not: { or: [
39             { line_regex: "coverity\\[TA\\.COVERAGE\\]", line_offset: -1 },
40             { line_regex: "xnocover" },
41           ] },
42           exclusion_reason: "coverage annotation",
43         }
44       ]
45     },
46     {
47       filter_name: "exclude_logging_code",
49       line_filters: [
50         { not: { or: [
51             { line_regex: "ACE_DEBUG" },
52             { line_regex: "ACE_ERROR" },
53             { line_regex: "ACE_ERROR_RETURN" },
54             { line_regex: "ACELIB_DEBUG" },
55             { line_regex: "ACELIB_ERROR" },
56             { line_regex: "ACELIB_ERROR_RETURN" },
57             { line_regex: "TAOLIB_DEBUG" },
58             { line_regex: "TAOLIB_ERROR" },
59             { line_regex: "TAOLIB_ERROR_RETURN" },
60             { line_regex: "TAO_debug_level" },
61             { line_regex: "ORBSVCS_DEBUG" },
62             { line_regex: "ORBSVCS_ERROR" },
63             { line_regex: "ORBSVCS_ERROR_RETURN" },
64             { line_regex: "VDBG" },
65             { line_regex: "VDBG_LVL" },
66             { line_regex: "Transport_debug_level" },
67             { line_regex: "_tao_print_exception" },
68           ] },
69           exclusion_reason: "policy indicates no need to test logging code",
70         }
71       ]
72     },
73     {
74       filter_name: "exclude_throw_statements",
76       line_filters: [
77         { exclusion_reason: "on throw path",
78           not: {
79             contains_astnode: {
80               dominated_by_astnode: {
81                      expression_kind: "throw" ,
82               }
83             }
84           }
85         }
86       ]
87     },
88     {
89       filter_name: "exclude_error_handlers",
91       line_filters: [
92         { not: { line_regex: "return\\s+-1" },
93           exclusion_reason: "policy indicates no need to test error handlers",
94         }
95       ]
96     },
97     {
98       filter_name: "focus_on_my_source",
99       file_filters: [
100         {
101             exclusion_reason: "outside interesting source locations",
102             and: [
103               { or: [
104                 { file_name_regex: ".*/ACE/ace/.*" },
105                 { file_name_regex: ".*/DDS/dds/DCPS/.*" },
106                 { file_name_regex: ".*/TAO/tao/.*" },
107                 { file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Naming/.*" },
108                 { file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Notify/.*" },
109                 { file_name_regex: ".*/TAO/orbsvcs/orbsvcs/Event/.*" }
110               ] }
111             ]
112         }
113       ]
114     },
115   ]