Sample
pyint-15f1799a6069-I11
Split eligible integer literals into pairs of short-named intermediate variables
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.448 | 0–1; higher is more readable |
| Mi | 0.655 | 0–1; higher is more readable |
| LLOC | 68 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 11 | 0–20; mean of three runs |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs |
| BTTF | 0.303 | 0–1; higher is more readable |
Views
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 3389.113 | −111.841 |
| Source linesThe number of non-empty source lines. | 137 | +54.8 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 4.389 | −6.584 |
Intercept 8.87 + feature contributions = -54.755 (log-odds).
Score = sigmoid(-54.755) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 137 | −3.814 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 107 | +2.964 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 107 | −2.034 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 136.881 | +1.504 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 81.783 | +0.515 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.436 |
| Identifier layout (horizontal)How rapidly the visual pattern of identifier characters changes from left to right. It measures spatial frequency, not the meaning of the names. | 82.964 | +0.151 |
Intercept 0.07 + feature contributions = -0.21 (log-odds).
Score = sigmoid(-0.21) = 0.448.
| Score | 0.655 |
|---|
| Score | 68 |
|---|
Run 1
The code is mostly well-structured with clear method separation, a single class, and limited nesting. Intent is documented with comments and docstrings. However, readability is somewhat harmed by several awkward variable assignments (e.g., `a=1`, `b=1`, `c=1`, `d=-1`, `e=1000`, etc.) whose purpose is unclear; they look like artificial or obfuscated constants. This obscures the meaning of operations that use them, such as `::(a+b)` and `microsecond=(c+d)`. The `secret` and `secret_fallbacks` properties add unnecessary indirection. Action granularity is generally good—one action per line—but some lines, like the salted_hmac construction with slicing, combine multiple steps. Reading flow is natural due to top-down method ordering. Overall, readable but hampered by comments, cryptic constants, and some ambiguous lines.
Run 2
The code has good documentation and clear high-level structure, but readability is severely undermined by several factors. Unnecessary artificial variables (a=1, b=1, c=1, d=-1, etc.) are introduced without clear purpose, making logic harder to follow. Magic numbers (1000, 1001, 2, -1) in _num_seconds obscure its intent. The slicing logic in _make_token_with_timestamp is difficult to understand due to these variables. check_token has multiple return points and nested exception handling that interrupt reading flow. While the class has a logical organization, these issues create ambiguity and reduce clarity of intent. Proper variable names and direct use of datetime(2001, 1, 1) would significantly improve readability.
Run 3
The code has clear class structure, docstrings, and mostly logical organization. However, several poor readability choices significantly reduce the score. Variables like `a = 1`, `b = 1`, `c = 1`, `d = -1`, and especially `e = 1000`, `f = 1001`, `g = 2`, etc., obscure intent and create unnecessary clutter. The slicing `[::-2]` is unclear and would be clearer with a named constant or comment. The `datetime((e + f), (g + h), (i + j))` pattern is obfuscated. Action granularity is mostly one action per line, but the unnecessary variable assignments break natural reading flow. Nesting is shallow, which helps. The parsing of the token and fallback loop are readable, but the timestamp calculation and hash slicing need cleanup. Overall, the code is maintainable but degraded by deliberate obfuscation of simple operations.
Run 1
Code Structure: Well-organized class with focused methods separating token generation, validation, configuration, and hashing. Nesting: Shallow overall; early returns keep validation readable, though the for-else construct requires attention. Clarity of intent: Descriptive method names and helpful documentation explain the main purpose, but arbitrary variables a through j obscure simple constants and date values. Code length: Mostly appropriate, although unnecessary variable assignments and arithmetic add avoidable length. Action granularity: Generally one action per line, with multiline calls formatted clearly; the hash slicing and arithmetic-heavy date construction are harder to parse. Reading flow: Methods follow a logical progression and validation steps are easy to follow, but artificial arithmetic and awkward slice formatting interrupt an otherwise natural flow.
Run 2
Code Structure: Well-organized class with focused methods separating token generation, validation, hashing, and configuration. Nesting: Mostly shallow, with early returns keeping validation readable; the loop's else clause requires some attention. Clarity of intent: Descriptive method names and useful documentation explain the overall purpose, but meaningless variables a–j and arithmetic expressions obscure simple constants such as the slicing step, zero microseconds, and epoch date. Code length: Generally appropriate, although artificial variable assignments and extensive wrapping add unnecessary length. Action granularity: Most lines perform a single action; chained hashing and slicing are somewhat harder to scan. Reading flow: Validation follows a natural parse, verify, and expiry-check sequence, but awkward slice formatting and indirect date construction interrupt the flow. Replacing the artificial arithmetic with direct constants would significantly improve readability.
Run 3
Code Structure: Well-organized class with focused methods separating token generation, validation, hashing, and configuration. Nesting: Mostly shallow; early returns simplify validation, although the for-else construct requires extra attention. Clarity of intent: Descriptive method names, docstrings, and comments explain the purpose, but meaningless variables a through j obscure straightforward constants such as the slice step, zero microseconds, and epoch date. Code length: Generally appropriate, though these unnecessary assignments add clutter. Action granularity: Most lines perform one clear action; chained hashing and awkwardly formatted slicing slightly complicate interpretation. Reading flow: Validation proceeds naturally from parsing to signature verification and expiration checks, but artificial arithmetic and fragmented expressions interrupt otherwise clean flow.