项目指标

pgBackRest 项目代码覆盖率指标与质量统计。

原始页面: https://pgbackrest.org/metric.html


代码覆盖率

pgBackRest 致力于对 /src 目录下的核心 C 代码实现完整的函数、分支和行覆盖。

函数覆盖率和行覆盖率均已达到 100%,无任何例外。

分支覆盖率排除了宏内部的分支和 assert() 调用。宏有专属的单元测试,因此无需在每处调用时都进行测试。assert 断言不要求完整的分支覆盖,因为它们测试的是应当始终为真的条件。

目录函数分支
build/common32/32 (100.00%)72/72 (100.00%)268/268 (100.00%)
build/config39/39 (100.00%)564/564 (100.00%)1142/1142 (100.00%)
build/error6/6 (100.00%)22/22 (100.00%)71/71 (100.00%)
build/help13/13 (100.00%)138/138 (100.00%)265/265 (100.00%)
build/postgres8/8 (100.00%)58/58 (100.00%)149/149 (100.00%)
command17/17 (100.00%)104/104 (100.00%)210/210 (100.00%)
command/annotate1/1 (100.00%)12/12 (100.00%)30/30 (100.00%)
command/archive14/14 (100.00%)98/98 (100.00%)189/189 (100.00%)
command/archive/get10/10 (100.00%)208/208 (100.00%)447/447 (100.00%)
command/archive/push12/12 (100.00%)142/142 (100.00%)359/359 (100.00%)
command/backup50/50 (100.00%)786/786 (100.00%)1640/1640 (100.00%)
command/check13/13 (100.00%)106/106 (100.00%)214/214 (100.00%)
command/control4/4 (100.00%)34/34 (100.00%)48/48 (100.00%)
command/expire11/11 (100.00%)274/274 (100.00%)392/392 (100.00%)
command/help8/8 (100.00%)178/178 (100.00%)283/283 (100.00%)
command/info16/16 (100.00%)430/430 (100.00%)748/748 (100.00%)
command/local1/1 (100.00%)4/4 (100.00%)
command/remote1/1 (100.00%)6/6 (100.00%)18/18 (100.00%)
command/repo9/9 (100.00%)110/110 (100.00%)195/195 (100.00%)
command/restore37/37 (100.00%)726/726 (100.00%)1350/1350 (100.00%)
command/server6/6 (100.00%)24/24 (100.00%)81/81 (100.00%)
command/stanza5/5 (100.00%)106/106 (100.00%)125/125 (100.00%)
command/verify22/22 (100.00%)366/366 (100.00%)733/733 (100.00%)
common146/146 (100.00%)624/624 (100.00%)1350/1350 (100.00%)
common/compress12/12 (100.00%)24/24 (100.00%)80/80 (100.00%)
common/compress/bz213/13 (100.00%)20/20 (100.00%)123/123 (100.00%)
common/compress/gz13/13 (100.00%)26/26 (100.00%)118/118 (100.00%)
common/compress/lz415/15 (100.00%)24/24 (100.00%)116/116 (100.00%)
common/compress/zst13/13 (100.00%)12/12 (100.00%)96/96 (100.00%)
common/crypto32/32 (100.00%)88/88 (100.00%)424/424 (100.00%)
common/error33/33 (100.00%)66/66 (100.00%)179/179 (100.00%)
common/io61/61 (100.00%)182/182 (100.00%)523/523 (100.00%)
common/io/filter31/31 (100.00%)92/92 (100.00%)276/276 (100.00%)
common/io/http58/58 (100.00%)292/292 (100.00%)685/685 (100.00%)
common/io/socket28/28 (100.00%)110/110 (100.00%)339/339 (100.00%)
common/io/tls37/37 (100.00%)122/122 (100.00%)409/409 (100.00%)
common/type335/335 (100.00%)922/922 (100.00%)3123/3123 (100.00%)
config93/93 (100.00%)1025/1026 (99.90%)1649/1649 (100.00%)
db23/23 (100.00%)94/94 (100.00%)301/301 (100.00%)
info48/48 (100.00%)240/240 (100.00%)712/712 (100.00%)
info/manifest10/10 (100.00%)132/132 (100.00%)303/303 (100.00%)
postgres36/36 (100.00%)140/140 (100.00%)336/336 (100.00%)
postgres/interface4/4 (100.00%)10/10 (100.00%)35/35 (100.00%)
protocol60/60 (100.00%)266/266 (100.00%)860/860 (100.00%)
storage68/68 (100.00%)298/298 (100.00%)754/754 (100.00%)
storage/azure26/26 (100.00%)164/164 (100.00%)487/487 (100.00%)
storage/cifs2/2 (100.00%)6/6 (100.00%)
storage/gcs34/34 (100.00%)176/176 (100.00%)574/574 (100.00%)
storage/posix29/29 (100.00%)165/166 (99.40%)328/328 (100.00%)
storage/remote40/40 (100.00%)128/128 (100.00%)568/568 (100.00%)
storage/s331/31 (100.00%)194/194 (100.00%)651/651 (100.00%)
storage/sftp39/39 (100.00%)408/408 (100.00%)762/762 (100.00%)
合计1705/1705 (100.00%)10608/10610 (99.98%)25128/25128 (100.00%)

/test/src/module 中的 C 单元测试模块同样实现了完整的函数覆盖率和行覆盖率,但不包含在上述报告中。