One function
HalsteadClassifier in terryyin/lizard
The author described this change as “fix(halstead): classify leading-dot float literals as operands in C-family code”. It counts as a record because the check below fails on the code as it stood at 12ae6f853 and passes on 4ba7373a2, with nothing else changed between the two runs.
Projectterryyin/lizard
Fix saved2026-07-02
Sharing licenceMIT · LICENSE.txt
Change size+2 −1
What the code was meant to do, written into the code itself as a docstring
Classify tokens into Halstead operators and operands. This is the per-language extension point. The base class implements the generic rules that work for the operators and punctuation shared by lizard's common tokenizer, plus a broad set of C-family keywords. Subclass it and override :attr:`keyword_operators` / :attr:`literal_keywords` (or :meth:`classify` itself) for language-specific behaviour.
The change
| 37 | 37 | if not token or token.isspace(): | |
| 38 | 38 | return self.SKIP | |
| 39 | 39 | first = token[0] | |
| 40 | - | if first in "\"'" or first.isdigit(): | |
| 40 | + | if first in "\"'" or first.isdigit() or \ | |
| 41 | + | (first == "." and token[1:2].isdigit()): | |
| 41 | 42 | # A string or numeric literal: lizard emits each quoted run or | |
| 42 | 43 | # number (or number fragment) as a single token. | |
| 43 | 44 | return self.OPERAND |
The check that tells the two apart
fail→pass·test/testHalstead.py::TestHalsteadClassifierUnit::test_leading_dot_float_is_operand
Check file test/testHalstead.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it12ae6f853b5d0bba08ec4d29463a4ed3dd008d43
Broken version dated2026-06-30
Modulelizard_ext.lizardhalstead
Units changedHalsteadClassifier
Fingerprintd26a5ef16e7a066c
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in terryyin/lizard
- 2026-08-08fix(java): do not report control structures as methods
- 2026-07-02fix(csv): emit columns for extensions with multiple FUNCTION_INFO fields
- 2026-06-15fix(golike): register generic functions with [...] type params
- 2026-06-15fix(java): enhance parsing of generic and qualified type names in anonymous classes
- 2026-06-11fix(script): stop a '#' comment continuing past a trailing backslash (#317)
- 2026-06-02fix(objc): handle nested parens in block / function-pointer param types