项目指标

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

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


代码覆盖率

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

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

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

目录函数分支
build/common26/26 (100.00%)68/68 (100.00%)247/247 (100.00%)
build/config39/39 (100.00%)558/558 (100.00%)1160/1160 (100.00%)
build/error6/6 (100.00%)26/26 (100.00%)78/78 (100.00%)
build/help13/13 (100.00%)134/134 (100.00%)262/262 (100.00%)
build/postgres8/8 (100.00%)60/60 (100.00%)151/151 (100.00%)
command15/15 (100.00%)92/92 (100.00%)182/182 (100.00%)
command/annotate1/1 (100.00%)12/12 (100.00%)30/30 (100.00%)
command/archive15/15 (100.00%)104/104 (100.00%)200/200 (100.00%)
command/archive/get9/9 (100.00%)200/200 (100.00%)433/433 (100.00%)
command/archive/push12/12 (100.00%)130/130 (100.00%)348/348 (100.00%)
command/backup50/50 (100.00%)790/790 (100.00%)1643/1643 (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/expire10/10 (100.00%)256/256 (100.00%)373/373 (100.00%)
command/help8/8 (100.00%)178/178 (100.00%)283/283 (100.00%)
command/info15/15 (100.00%)412/412 (100.00%)709/709 (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%)205/205 (100.00%)
command/restore37/37 (100.00%)726/726 (100.00%)1350/1350 (100.00%)
command/server6/6 (100.00%)24/24 (100.00%)79/79 (100.00%)
command/stanza5/5 (100.00%)106/106 (100.00%)125/125 (100.00%)
command/verify22/22 (100.00%)356/356 (100.00%)721/721 (100.00%)
common145/145 (100.00%)614/614 (100.00%)1335/1335 (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%)62/62 (100.00%)178/178 (100.00%)
common/io60/60 (100.00%)180/180 (100.00%)513/513 (100.00%)
common/io/filter31/31 (100.00%)92/92 (100.00%)276/276 (100.00%)
common/io/http58/58 (100.00%)284/284 (100.00%)677/677 (100.00%)
common/io/socket28/28 (100.00%)110/110 (100.00%)337/337 (100.00%)
common/io/tls37/37 (100.00%)122/122 (100.00%)409/409 (100.00%)
common/type334/334 (100.00%)916/916 (100.00%)3107/3107 (100.00%)
config91/91 (100.00%)1001/1002 (99.90%)1612/1612 (100.00%)
db23/23 (100.00%)94/94 (100.00%)301/301 (100.00%)
info93/93 (100.00%)936/936 (100.00%)2030/2030 (100.00%)
postgres36/36 (100.00%)126/126 (100.00%)329/329 (100.00%)
postgres/interface4/4 (100.00%)10/10 (100.00%)35/35 (100.00%)
protocol60/60 (100.00%)264/264 (100.00%)858/858 (100.00%)
storage63/63 (100.00%)278/278 (100.00%)707/707 (100.00%)
storage/azure25/25 (100.00%)148/148 (100.00%)437/437 (100.00%)
storage/cifs2/2 (100.00%)6/6 (100.00%)
storage/gcs34/34 (100.00%)184/184 (100.00%)581/581 (100.00%)
storage/posix28/28 (100.00%)167/168 (99.40%)325/325 (100.00%)
storage/remote38/38 (100.00%)128/128 (100.00%)572/572 (100.00%)
storage/s330/30 (100.00%)194/194 (100.00%)625/625 (100.00%)
storage/sftp32/32 (100.00%)400/400 (100.00%)712/712 (100.00%)
合计1708/1708 (100.00%)10992/10994 (99.98%)25782/25782 (100.00%)

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