4 -- Copyright (c) 2002-2009, Sebastian Bergmann <sb@sebastian-bergmann.de>.
5 -- All rights reserved.
7 -- Redistribution and use in source and binary forms, with or without
8 -- modification, are permitted provided that the following conditions
11 -- * Redistributions of source code must retain the above copyright
12 -- notice, this list of conditions and the following disclaimer.
14 -- * Redistributions in binary form must reproduce the above copyright
15 -- notice, this list of conditions and the following disclaimer in
16 -- the documentation and/or other materials provided with the
19 -- * Neither the name of Sebastian Bergmann nor the names of his
20 -- contributors may be used to endorse or promote products derived
21 -- from this software without specific prior written permission.
23 -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 -- FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 -- COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 -- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 -- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 -- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 -- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 -- POSSIBILITY OF SUCH DAMAGE.
39 CREATE TABLE IF NOT EXISTS run(
40 run_id INTEGER PRIMARY KEY AUTOINCREMENT,
44 completed INTEGER DEFAULT 0
47 CREATE TABLE IF NOT EXISTS test(
49 test_id INTEGER PRIMARY KEY AUTOINCREMENT,
51 test_result INTEGER DEFAULT 0,
52 test_message TEXT DEFAULT "",
53 test_execution_time REAL DEFAULT 0,
54 code_method_id INTEGER,
58 node_is_leaf INTEGER DEFAULT 0
61 CREATE INDEX IF NOT EXISTS test_run_id ON test (run_id);
62 CREATE INDEX IF NOT EXISTS test_result ON test (test_result);
63 CREATE INDEX IF NOT EXISTS test_code_method_id ON test (code_method_id);
64 CREATE INDEX IF NOT EXISTS test_node_root ON test (node_root);
65 CREATE INDEX IF NOT EXISTS test_node_left ON test (node_left);
66 CREATE INDEX IF NOT EXISTS test_node_right ON test (node_right);
68 CREATE TABLE IF NOT EXISTS code_file(
69 code_file_id INTEGER PRIMARY KEY AUTOINCREMENT,
75 CREATE TABLE IF NOT EXISTS code_function(
77 code_function_id INTEGER PRIMARY KEY AUTOINCREMENT,
78 code_function_name TEXT,
79 code_function_start_line INTEGER,
80 code_function_end_line INTEGER
83 CREATE INDEX IF NOT EXISTS code_file_id ON code_function (code_file_id);
85 CREATE TABLE IF NOT EXISTS code_class(
87 code_class_id INTEGER PRIMARY KEY AUTOINCREMENT,
88 code_class_parent_id INTEGER,
90 code_class_start_line INTEGER,
91 code_class_end_line INTEGER
94 CREATE INDEX IF NOT EXISTS code_file_id ON code_class (code_file_id);
96 CREATE TABLE IF NOT EXISTS code_method(
97 code_class_id INTEGER,
98 code_method_id INTEGER PRIMARY KEY AUTOINCREMENT,
99 code_method_name TEXT,
100 code_method_start_line INTEGER,
101 code_method_end_line INTEGER
104 CREATE INDEX IF NOT EXISTS code_class_id ON code_method (code_class_id);
106 CREATE TABLE IF NOT EXISTS code_line(
107 code_file_id INTEGER,
108 code_line_id INTEGER PRIMARY KEY AUTOINCREMENT,
109 code_line_number INTEGER,
111 code_line_covered INTEGER
114 CREATE INDEX IF NOT EXISTS code_line_code_file_id ON code_line (code_file_id);
116 CREATE TABLE IF NOT EXISTS code_coverage(
121 CREATE UNIQUE INDEX IF NOT EXISTS code_coverage_test_id_code_line_id ON code_coverage (test_id, code_line_id);
123 CREATE TABLE IF NOT EXISTS metrics_project(
125 metrics_project_cls INTEGER,
126 metrics_project_clsa INTEGER,
127 metrics_project_clsc INTEGER,
128 metrics_project_roots INTEGER,
129 metrics_project_leafs INTEGER,
130 metrics_project_interfs INTEGER,
131 metrics_project_maxdit INTEGER
134 CREATE INDEX IF NOT EXISTS run_id ON metrics_project (run_id);
136 CREATE TABLE IF NOT EXISTS metrics_file(
138 code_file_id INTEGER,
139 metrics_file_coverage REAL,
140 metrics_file_loc INTEGER,
141 metrics_file_cloc INTEGER,
142 metrics_file_ncloc INTEGER,
143 metrics_file_loc_executable INTEGER,
144 metrics_file_loc_executed INTEGER
147 CREATE INDEX IF NOT EXISTS run_id ON metrics_file (run_id);
148 CREATE INDEX IF NOT EXISTS code_file_id ON metrics_file (code_file_id);
150 CREATE TABLE IF NOT EXISTS metrics_function(
152 code_function_id INTEGER,
153 metrics_function_coverage REAL,
154 metrics_function_loc INTEGER,
155 metrics_function_loc_executable INTEGER,
156 metrics_function_loc_executed INTEGER,
157 metrics_function_ccn INTEGER,
158 metrics_function_crap REAL,
159 metrics_function_npath INTEGER
162 CREATE INDEX IF NOT EXISTS run_id ON metrics_function (run_id);
163 CREATE INDEX IF NOT EXISTS code_function_id ON metrics_function (code_function_id);
165 CREATE TABLE IF NOT EXISTS metrics_class(
167 code_class_id INTEGER,
168 metrics_class_coverage REAL,
169 metrics_class_loc INTEGER,
170 metrics_class_loc_executable INTEGER,
171 metrics_class_loc_executed INTEGER,
172 metrics_class_aif REAL,
173 metrics_class_ahf REAL,
174 metrics_class_cis INTEGER,
175 metrics_class_csz INTEGER,
176 metrics_class_dit INTEGER,
177 metrics_class_impl INTEGER,
178 metrics_class_mif REAL,
179 metrics_class_mhf REAL,
180 metrics_class_noc INTEGER,
181 metrics_class_pf REAL,
182 metrics_class_vars INTEGER,
183 metrics_class_varsnp INTEGER,
184 metrics_class_varsi INTEGER,
185 metrics_class_wmc INTEGER,
186 metrics_class_wmcnp INTEGER,
187 metrics_class_wmci INTEGER
190 CREATE INDEX IF NOT EXISTS run_id ON metrics_class (run_id);
191 CREATE INDEX IF NOT EXISTS code_class_id ON metrics_class (code_class_id);
193 CREATE TABLE IF NOT EXISTS metrics_method(
195 code_method_id INTEGER,
196 metrics_method_coverage REAL,
197 metrics_method_loc INTEGER,
198 metrics_method_loc_executable INTEGER,
199 metrics_method_loc_executed INTEGER,
200 metrics_method_ccn INTEGER,
201 metrics_method_crap REAL,
202 metrics_method_npath INTEGER
205 CREATE INDEX IF NOT EXISTS run_id ON metrics_method (run_id);
206 CREATE INDEX IF NOT EXISTS code_method_id ON metrics_method (code_method_id);