huangzworks/annotated_redis_source
带有详细注释的 Redis 2.6 源码
- Repository: https://github.com/huangzworks/annotated_redis_source
- Commit:
67758fdfe196d96ddc8a83784fa48f22226a3818 - Generated: 2026-11-13T23:31:56+00:00
- Scorer 0.1.0, scoring prov-4+qual-2+sec-2, report schema v2
Scores
| Pillar | Score | Signal | Confidence | Coverage |
|---|---|---|---|---|
| AI provenance (estimated AI-generated share) | 0 | none-detected | 65% | 100% |
| Code quality | 53 | weak | 90% | 100% |
| Security | 74 | adequate | 85% | 100% |
AI provenance
No AI attribution or AI-consistent velocity signals detected.
-
Explicitly attributed share (lower bound): 0.0%
-
Unattributed share in AI-consistent velocity bursts: 0.0%
-
Estimated AI-generated share: 0.0%
-
Stylometry index: 0.08 per 1,000 lines (narrated steps 7, placeholders 0, assistant phrasing 0, emoji 0). Reported as a signal, not scored.
| Month | Lines added | Attributed to AI |
|---|---|---|
| 2013-02 | 887 | 0% |
| 2013-03 | 209 | 0% |
| 2013-04 | 124 | 0% |
| 2013-05 | 6 | 0% |
| 2013-06 | 13 | 0% |
| 2013-08 | 1 | 0% |
| 2013-09 | 3 | 0% |
| 2013-10 | 2 | 0% |
| 2013-11 | 8 | 0% |
| 2014-03 | 1 | 0% |
| 2014-05 | 1 | 0% |
| 2016-12 | 1 | 0% |
Evidence
- step-by-step narration comment: /* Now we found a non empty bucket, but it is a linked (src/dict.c:8)
- step-by-step narration comment: /* Now we can use the hiredis to read the incoming protocol. */ (src/redis-cl)
- step-by-step narration comment: /* Now we subscribe to the Sentinels "Hello" channel. */ (src/sentinel)
- step-by-step narration comment: /* First, try to see if we already have this sentinel. */ (src/sentinel)
- step-by-step narration comment: * now we are in charge of actually sending the reconfiguration (src/sentinel)
- step-by-step narration comment: /* Now we need to protect sortval incrementing its count, in the future (src/sort.c:2)
- step-by-step narration comment: /* First, move the tail <empty> bytes to the front, then resize (src/zipmap.c)
AI provenance describes how code was produced; it is not a quality judgment. Unless attribution is explicit, these are signals consistent with AI generation, not proof. Squash/rebase workflows, imported code, and rewritten history reduce accuracy.
Code quality
Code quality is weak: test-to-source ratio 0.02, no CI test run detected; 26% of function code in complex or long functions; 7% duplicated lines. Weakest area: testing.
| Area | Score |
|---|---|
| Complexity (lizard) | 46 |
| Duplication | 66 |
| Code smells (Opengrep) | 84 |
| Tests and CI | 21 |
| Documentation | 80 |
| Type safety | n/a |
| Process (Scorecard review/maintenance) | n/a |
- Functions: 2,644; mean complexity 4.7, 90th percentile 9; 117 complex and 46 long functions
- Duplicated lines: 7.0% of 65,988 compared
- Tests: 1,607 test lines for 90,705 source lines (ratio 0.02); CI test commands: none detected; 1% of recent source commits also change tests
- Docs missing or thin: readme
Most complex functions:
- loadServerConfigFromString in src/config.c: complexity 168, 333 lines
- configSetCommand in src/config.c: complexity 120, 240 lines
- sortCommand in src/sort.c: complexity 88, 260 lines
- luaV_execute in deps/lua/src/lvm.c: complexity 86, 386 lines
- malloc_conf_next in deps/jemalloc/src/jemalloc.c: complexity 72, 63 lines
Security
Security posture is adequate: 9 high-severity SAST findings. Weakest area: posture.
| Area | Score |
|---|---|
| Secrets (gitleaks, tree + history) | 97 |
| Static analysis (Opengrep) | 82 |
| Vulnerable dependencies (OSV) | n/a |
| CI workflows (zizmor) | n/a |
| Posture (policy, updates, signing, lockfiles) | 0 |
| OpenSSF Scorecard | n/a |
- Posture checks passed: lockfiles; missing: security policy, dependency updates, signed commits
Top findings
| Severity | Finding | Location |
|---|---|---|
| high | opengrep/c.lang.security.double-free: Variable 'curargv' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/hiredis.c:900 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:113 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:119 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:125 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:131 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:137 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:143 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:194 |
| high | opengrep/c.lang.security.double-free: Variable 'cmd' was freed twice. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:200 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'curargv' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/hiredis.c:899 |
| medium | opengrep/c.lang.security.insecure-use-memset: When handling sensitive information in a buffer, it's important to ensure that the data is securely erased before the buffer is deleted or reused. While memset() is commonly used for this purpose, it can leave sensitive information behind due to compiler optimizations or other factors. To avoi [confidence low] |
deps/hiredis/net.c:214 |
| medium | opengrep/c.lang.security.insecure-use-string-copy-fn: Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker [confidence low] |
deps/hiredis/net.c:274 |
| medium | opengrep/c.lang.security.insecure-use-memset: When handling sensitive information in a buffer, it's important to ensure that the data is securely erased before the buffer is deleted or reused. While memset() is commonly used for this purpose, it can leave sensitive information behind due to compiler optimizations or other factors. To avoi [confidence low] |
deps/hiredis/sds.c:57 |
| medium | opengrep/c.lang.security.insecure-use-memset: When handling sensitive information in a buffer, it's important to ensure that the data is securely erased before the buffer is deleted or reused. While memset() is commonly used for this purpose, it can leave sensitive information behind due to compiler optimizations or other factors. To avoi [confidence low] |
deps/hiredis/sds.c:120 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:110 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:111 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:111 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:116 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:117 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:117 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:122 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:123 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:123 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:128 |
| medium | opengrep/c.lang.security.function-use-after-free: Variable 'cmd' was passed to a function after being freed. This can lead to undefined behavior. [confidence low] |
deps/hiredis/test.c:129 |
Static signals only: the scorer never runs the project's code. Secret findings are pattern matches that were not verified, and secret values are never stored.
Repository profile
- Source lines: 90,705; test lines: 1,607
| Language | Lines |
|---|---|
| C | 90,793 |
| Ruby | 735 |
| Lua | 525 |
| Shell | 250 |
| C++ | 9 |