State of the Repo Report, October 2019
Introduction
For all fans of statistics – enjoy! 🤓
826 authors (+18) have contributed to the project (merged contributions). Thank you! ❤️
The repo contains 511 017 (+17 105) lines of text and 1 795 (+16) files.
21 791 (+365) commits have been made of which 4 361 (+148) are merge commits.
There are currently 282 (-7) open pull requests from in total 82 (-9) contributors.
If all open pull requests were merged the project line count would grow by roughly 11 percent.
The total set of open pull requests adds 85 836 lines, removes 28 581 lines and touches 2 541 distinct files.
The "median open pull request" adds 64 lines, removes 18 lines and touches 5 files.
Previous edition: State of the Repo, September 2019
Static analysis report
This is the monthly static analysis snapshot for the source tree be504692.
Note: Before submitting any pull requests to Bitcoin Core, please read CONTRIBUTING.md. In particular the section on refactoring, as it likely applies to changes generated with these tools:
Trivial pull requests or pull requests that refactor the code with no clear benefits may be immediately closed by the maintainers to reduce unnecessary workload on reviewing.
Disclaimer: These results have not been confirmed, and may be improbable or flat out invalid, but it's worth having a list of these somewhere and keep track of changes over time. The results may be subject to a large number of false positives and false negatives. The results are not necessarily complete. Please report if you see any spurious results that you think could be filtered out automatically in the next edition to reduce noise. This report is currently in beta: feedback welcome.
Functions that are both unused and untested
<details> <summary>8 instances (+0)</summary>
bitcoinconsensus_version
BlockFilter::BlockFilter(BlockFilterType, uint256 const&, std::vector<unsigned char>)
CBlock::ToString() const
CBloomFilter::reset(unsigned int)
CClientUIInterface::LoadWallet(std::unique_ptr<interfaces::Wallet>&)
PartiallySignedTransaction::IsNull() const
PSBTInput::IsNull() const
PSBTOutput::IsNull() const
</details>
Functions that are unused outside of the testing code
<details> <summary>15 instances (+0)</summary>
base_blob<160u>::SetHex(std::string const&)
base_blob<160u>::ToString() const
base_uint<256u>::base_uint(std::string const&)
base_uint<256u>::ToString() const
bitcoinconsensus_verify_script
bitcoinconsensus_verify_script_with_amount
BlockFilter::BlockFilter(BlockFilterType, CBlock const&, CBlockUndo const&)
BlockFilter::ComputeHeader(uint256 const&) const
CBloomFilter::CBloomFilter(unsigned int, double, unsigned int, unsigned char)
CBloomFilter::insert(uint256 const&)
CKey::Negate()
DecodeBase58(std::string const&, std::vector<unsigned char>&)
GCSFilter::MatchAny(std::unordered_set<std::vector<unsigned char>, ByteVectorHash, std::equal_to<std::vector<unsigned char>>, std::allocator<std::vector<unsigned char>>> const&) const
GCSFilter::Match(std::vector<unsigned char> const&) const
SignSignature(SigningProvider const&, CTransaction const&, CMutableTransaction&, unsigned int, int)
</details>
Clang warnings
<details> <summary>29 instances (+0)</summary>
core_write.cpp:100:15: warning: result of comparison of 0 <= unsigned enum expression is always true [-Wtautological-unsigned-enum-zero-compare]
dbwrapper.cpp:45:50: warning: format string is not a string literal [-Wformat-nonliteral]
index/blockfilterindex.cpp:55:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function]
index/blockfilterindex.cpp:81:5: warning: unused function template 'Unserialize' [-Wunused-template]
init.cpp:936:5: warning: loop will run at most once (loop increment never executed) [-Wunreachable-code-loop-increment]
policy/fees.cpp:314:30: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
policy/fees.cpp:741:45: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
policy/fees.cpp:748:47: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
policy/fees.cpp:847:32: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
random.cpp:150:12: warning: variable 'r1' may be uninitialized when used here [-Wconditional-uninitialized]
rpc/mining.cpp:245:70: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
rpc/mining.cpp:666:7: warning: 'submitblock_StateCatcher' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
rpc/mining.cpp:937:36: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function]
script/interpreter.cpp:343:28: warning: result of comparison of 0 <= unsigned enum expression is always true [-Wtautological-unsigned-enum-zero-compare]
script/script.h:449:20: warning: result of comparison of unsigned enum expression < 0 is always false [-Wtautological-unsigned-enum-zero-compare]
script/script.h:449:34: warning: result of comparison 'opcodetype' > 255 is always false [-Wtautological-type-limit-compare]
txdb.h:71:5: warning: '~CCoinsViewDBCursor' overrides a destructor but is not marked 'override' [-Winconsistent-missing-destructor-override]
txmempool.cpp:984:64: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
txmempool.h:220:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
txmempool.h:258:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
txmempool.h:293:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
util/strencodings.cpp:304:11: warning: result of comparison 'long long' >= -9223372036854775808 is always true [-Wtautological-type-limit-compare]
util/strencodings.cpp:305:11: warning: result of comparison 'long long' <= 9223372036854775807 is always true [-Wtautological-type-limit-compare]
util/strencodings.cpp:338:11: warning: result of comparison 'unsigned long long' <= 18446744073709551615 is always true [-Wtautological-type-limit-compare]
validation.cpp:1806:7: warning: 'WarningBitsConditionChecker' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
versionbits.cpp:166:7: warning: '(anonymous namespace)::VersionBitsConditionChecker' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
versionbits.h:55:7: warning: 'AbstractThresholdConditionChecker' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
wallet/wallet.h:936:5: warning: '~CWallet' overrides a destructor but is not marked 'override' [-Winconsistent-missing-destructor-override]
</details>
Clang static analyzer warnings
<details> <summary>6 instances (+0)</summary>
chain.h:417:24: warning: Access to field 'nHeight' results in a dereference of a null pointer (loaded from variable 'pindex')
crypto/sha256.cpp:597:9: warning: Value stored to 'enabled_avx' is never read
crypto/sha256.cpp:601:9: warning: Value stored to 'have_avx2' is never read
crypto/sha256.cpp:602:9: warning: Value stored to 'have_shani' is never read
net_processing.cpp:3701:55: warning: Called C++ object pointer is null
validation.cpp:4245:50: warning: Access to field 'nHeight' results in a dereference of a null pointer (loaded from variable 'pindex')
</details>
Cppcheck warnings
<details> <summary>17 instances (+0)</summary>
checkqueue.h:89 -> src/checkqueue.h:93: (warning) Identical inner 'if' condition is always true.
cuckoocache.h:245: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:246: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:247: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:248: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:249: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:250: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:251: (error) Shifting 32-bit value by 32 bits is undefined behaviour
cuckoocache.h:252: (error) Shifting 32-bit value by 32 bits is undefined behaviour
index/base.cpp:178: (warning) Assert statement calls a function which may have desired side effects: 'GetAncestor'.
index/blockfilterindex.cpp:286: (warning) Assert statement calls a function which may have desired side effects: 'GetAncestor'.
net_processing.cpp:884: (error) Same iterator is used with different containers 'mapOrphanTransactions' and 'itPrev.second'.
txdb.cpp:316: (error) Uninitialized variable: nVersionDummy
txmempool.cpp:643: (warning) Assert statement calls a function which may have desired side effects: 'end'.
undo.h:57: (error) Uninitialized variable: nVersionDummy
validation.cpp:2215: (warning) Assert statement calls a function which may have desired side effects: 'CanFlushToDisk'.
wallet/rpcwallet.cpp:1484: (error) After erase(), the iterator 'first' may be invalid.
</details>
Signed integer assumptions made by the GCC optimizer
<details> <summary>52 instances (+0)</summary>
addrman.cpp:295:25: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
addrman.cpp:350:11: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
arith_uint256.cpp:29:31: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
arith_uint256.cpp:46:28: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
arith_uint256.cpp:67:18: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
arith_uint256.cpp:96:18: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
arith_uint256.cpp:96:18: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
blockencodings.cpp:49:12: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
blockencodings.cpp:97:9: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
chain.cpp:171:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
chain.cpp:84:20: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
consensus/tx_verify.cpp:194:5: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
consensus/tx_verify.cpp:200:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
crypto/aes.cpp:78:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
crypto/ctaes/ctaes.c:447:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
dbwrapper.cpp:41:17: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
init.cpp:1263:24: warning: assuming signed overflow does not occur when simplifying range test [-Wstrict-overflow]
key.cpp:43:5: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
netaddress.cpp:804:14: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
net.cpp:2767:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
net_processing.cpp:3604:115: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
net_processing.cpp:4083:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
net_processing.cpp:4095:63: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
net_processing.cpp:597:5: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
policy/fees.cpp:725:25: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
random.cpp:714:6: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
rpc/net.cpp:427:20: warning: assuming signed overflow does not occur when simplifying range test [-Wstrict-overflow]
rpc/server.cpp:397:31: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
rpc/util.cpp:697:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
script/descriptor.cpp:133:5: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
script/descriptor.cpp:133:5: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
script/interpreter.cpp:281:6: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
script/script.h:332:33: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
script/script.h:351:29: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
script/script.h:352:14: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
serialize.h:389:9: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
util/moneystr.cpp:11:13: warning: assuming signed overflow does not occur when determining that expression is always non-negative [-Wstrict-overflow]
util/moneystr.cpp:76:1: warning: assuming signed overflow does not occur when determining that expression is always non-negative [-Wstrict-overflow]
util/strencodings.cpp:446:24: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
util/strencodings.cpp:446:24: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
wallet/coinselection.cpp:185:35: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
wallet/coinselection.cpp:262:64: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/coinselection.cpp:269:59: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/coinselection.cpp:292:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/rpcdump.cpp:1450:1: warning: assuming signed overflow does not occur when changing X +- C1 cmp C2 to X cmp C2 -+ C1 [-Wstrict-overflow]
wallet/wallet.cpp:2117:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/wallet.cpp:2381:5: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
wallet/wallet.cpp:2384:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/wallet.cpp:2935:9: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
wallet/wallet.cpp:3285:1: warning: assuming signed overflow does not occur when reducing constant in comparison [-Wstrict-overflow]
wallet/wallet.cpp:3566:9: warning: assuming signed overflow does not occur when simplifying conditional [-Wstrict-overflow]
wallet/wallet.cpp:984:13: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
</details>
Suggested code changes waiting for review (grouped by author)
| # | Username | Lines added | Lines removed | Net lines | Files chgd | Pull reqs |
|---|---|---|---|---|---|---|
| 1 | Sjors | 23 010 (27%) | -7 463 | 15 547 | 252 | 19 (7%) |
| 2 | achow101 | 11 183 (13%) | -6 146 | 5 037 | 93 | 11 (4%) |
| 3 | ryanofsky | 8 429 (10%) | -2 274 | 6 155 | 178 | 13 (5%) |
| 4 | jamesob | 4 282 (5%) | -442 | 3 840 | 42 | 5 (2%) |
| 5 | jonasschnelli | 3 653 (4%) | -535 | 3 118 | 38 | 10 (4%) |
| 6 | practicalswift | 3 402 (4%) | -351 | 3 051 | 36 | 14 (5%) |
| 7 | TheBlueMatt | 3 183 (4%) | -777 | 2 406 | 51 | 10 (4%) |
| 8 | sipa | 3 162 (4%) | -1 035 | 2 127 | 52 | 5 (2%) |
| 9 | kallewoof | 2 464 (3%) | -355 | 2 109 | 67 | 6 (2%) |
| 10 | luke-jr | 1 990 (2%) | -442 | 1 548 | 95 | 20 (7%) |
| 11 | icota | 1 808 (2%) | -54 | 1 754 | 41 | 3 (1%) |
| 12 | MarcoFalke | 1 760 (2%) | -494 | 1 266 | 76 | 12 (4%) |
| 13 | jl2012 | 1 620 (2%) | -1 537 | 83 | 9 | 2 (1%) |
| 14 | Christewart | 991 (1%) | -24 | 967 | 18 | 1 (0%) |
| 15 | dongcarl | 854 (1%) | -455 | 399 | 30 | 3 (1%) |
| 16 | marcinja | 832 (1%) | -109 | 723 | 31 | 2 (1%) |
| 17 | jimpo | 813 (1%) | -24 | 789 | 13 | 1 (0%) |
| 18 | ariard | 761 (1%) | -886 | -125 | 21 | 2 (1%) |
| 19 | martinus | 750 (1%) | -88 | 662 | 17 | 2 (1%) |
| 20 | LarryRuane | 749 (1%) | -277 | 472 | 24 | 4 (1%) |
| 21 | fanquake | 728 (1%) | -835 | -107 | 73 | 4 (1%) |
| 22 | Empact | 720 (1%) | -432 | 288 | 74 | 14 (5%) |
| 23 | ajtowns | 628 (1%) | -217 | 411 | 27 | 5 (2%) |
| 24 | hebasto | 587 (1%) | -402 | 185 | 80 | 7 (2%) |
| 25 | naumenkogs | 573 (1%) | -106 | 467 | 15 | 3 (1%) |
| 26 | meshcollider | 559 (1%) | -93 | 466 | 18 | 3 (1%) |
| 27 | jnewbery | 504 (1%) | -504 | 0 | 38 | 3 (1%) |
| 28 | promag | 504 (1%) | -222 | 282 | 45 | 15 (5%) |
| 29 | fingera | 478 (1%) | -9 | 469 | 4 | 1 (0%) |
| 30 | amitiuttarwar | 477 (1%) | -105 | 372 | 16 | 2 (1%) |
| 31 | JeremyRubin | 453 (1%) | -272 | 181 | 16 | 3 (1%) |
| 32 | sdaftuar | 405 (0%) | -55 | 350 | 7 | 1 (0%) |
| 33 | domob1812 | 333 (0%) | -159 | 174 | 14 | 3 (1%) |
| 34 | jtimon | 317 (0%) | -234 | 83 | 33 | 6 (2%) |
| 35 | l2a5b1 | 299 (0%) | -93 | 206 | 22 | 2 (1%) |
| 36 | hosseinamin | 261 (0%) | -43 | 218 | 3 | 1 (0%) |
| 37 | andrewtoth | 243 (0%) | -75 | 168 | 4 | 1 (0%) |
| 38 | ch4ot1c | 175 (0%) | -208 | -33 | 6 | 3 (1%) |
| 39 | jkczyz | 174 (0%) | -90 | 84 | 12 | 4 (1%) |
| 40 | benthecarman | 173 (0%) | -13 | 160 | 10 | 3 (1%) |
| 41 | instagibbs | 154 (0%) | -43 | 111 | 29 | 3 (1%) |
| 42 | mzumsande | 136 (0%) | -2 | 134 | 2 | 1 (0%) |
| 43 | FelixWeis | 135 (0%) | -101 | 34 | 4 | 1 (0%) |
| 44 | AkioNak | 133 (0%) | -88 | 45 | 4 | 1 (0%) |
| 45 | metalicjames | 98 (0%) | -4 | 94 | 4 | 1 (0%) |
| 46 | n2yen | 86 (0%) | -9 | 77 | 5 | 1 (0%) |
| 47 | IntegralTeam | 79 (0%) | -3 | 76 | 3 | 1 (0%) |
| 48 | adamjonas | 79 (0%) | -19 | 60 | 8 | 3 (1%) |
| 49 | lucayepa | 48 (0%) | -26 | 22 | 1 | 2 (1%) |
| 50 | mmachicao | 47 (0%) | -40 | 7 | 6 | 1 (0%) |
| 51 | emilengler | 44 (0%) | -25 | 19 | 2 | 1 (0%) |
| 52 | IPGlider | 40 (0%) | -15 | 25 | 15 | 1 (0%) |
| 53 | shannon1916 | 39 (0%) | -9 | 30 | 4 | 1 (0%) |
| 54 | davereikher | 37 (0%) | -6 | 31 | 2 | 1 (0%) |
| 55 | sadrasabouri | 33 (0%) | -17 | 16 | 2 | 1 (0%) |
| 56 | Bushstar | 31 (0%) | -24 | 7 | 5 | 2 (1%) |
| 57 | GChuf | 30 (0%) | -24 | 6 | 4 | 3 (1%) |
| 58 | btcdrak | 30 (0%) | -25 | 5 | 4 | 1 (0%) |
| 59 | RandyMcMillan | 29 (0%) | -31 | -2 | 1 | 1 (0%) |
| 60 | elichai | 29 (0%) | -21 | 8 | 5 | 2 (1%) |
| 61 | laanwj | 25 (0%) | -1 | 24 | 1 | 1 (0%) |
| 62 | carnhofdaki | 23 (0%) | -1 | 22 | 1 | 1 (0%) |
| 63 | mruddy | 22 (0%) | -2 | 20 | 2 | 1 (0%) |
| 64 | shargon | 16 (0%) | -1 | 15 | 1 | 1 (0%) |
| 65 | tryphe | 15 (0%) | -16 | -1 | 2 | 1 (0%) |
| 66 | candrews | 13 (0%) | -7 | 6 | 1 | 1 (0%) |
| 67 | fjahr | 13 (0%) | -19 | -6 | 2 | 1 (0%) |
| 68 | lucash-dev | 13 (0%) | -5 | 8 | 2 | 1 (0%) |
| 69 | darosior | 12 (0%) | -4 | 8 | 3 | 1 (0%) |
| 70 | theStack | 12 (0%) | -17 | -5 | 3 | 3 (1%) |
| 71 | sanket1729 | 11 (0%) | -3 | 8 | 1 | 1 (0%) |
| 72 | jameshilliard | 8 (0%) | -3 | 5 | 3 | 1 (0%) |
| 73 | nijynot | 7 (0%) | -1 | 6 | 1 | 1 (0%) |
| 74 | pstratem | 6 (0%) | -5 | 1 | 1 | 1 (0%) |
| 75 | d3spwn | 4 (0%) | -2 | 2 | 2 | 1 (0%) |
| 76 | Zero-1729 | 3 (0%) | -5 | -2 | 2 | 1 (0%) |
| 77 | qubenix | 3 (0%) | -4 | -1 | 1 | 1 (0%) |
| 78 | stefanwouldgo | 3 (0%) | -5 | -2 | 2 | 1 (0%) |
| 79 | HashUnlimited | 1 (0%) | -2 | -1 | 1 | 1 (0%) |
| 80 | ernestognw | 1 (0%) | -2 | -1 | 1 | 1 (0%) |
| 81 | setpill | 1 (0%) | -3 | -2 | 1 | 1 (0%) |
| 82 | wodry | 0 (0%) | -6 | -6 | 2 | 1 (0%) |