Sample
Dorn/python/74
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.991 | 0–1; higher is more readable | 96.1Δ 43.7 |
| Scalabrino | 0.827 | 0–1; higher is more readable | 89.1Δ 36.8 |
| Dorn | 0.86 | 0–1; higher is more readable | 88.3Δ 35.9 |
| Mi | 0.518 | 0–1; higher is more readable | 55.4Δ 3.1 |
| LLOC | 4 | Logical lines; fewer is more readable | 82.7Δ 30.4 |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs | 49.3Δ 3.1 |
| GPT-6.1 Sol | 16.67 | 0–20; mean of three runs | 73.8Δ 21.4 |
| BTTF | 0.718 | 0–1; higher is more readable | 93.9Δ 41.5 |
| Human | 3.36 | 1–5; original rating | 52.4 |
Views
Select the downloaded ZIP or its extracted folder. Files stay in your browser.
Loading feature diagnosis…
Source regions
Feature contributions
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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.344 | −6.516 |
| Source linesThe number of non-empty source lines. | 9 | +3.6 |
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 38.054 | −1.256 |
Intercept 8.87 + feature contributions = 4.698 (log-odds).
Score = sigmoid(4.698) = 0.991.
| Score | 0.827 |
|---|
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. | 10 | +0.682 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.036 | +0.59 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 6 | −0.53 |
| 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. | 75 | +0.489 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 75 | +0.406 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 1 | +0.398 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 8.789 | −0.287 |
Intercept 0.07 + feature contributions = 1.818 (log-odds).
Score = sigmoid(1.818) = 0.86.
| Score | 0.518 |
|---|
| Score | 4 |
|---|
Run 1
The code snippet is too small to be highly readable, and lacks context. It demonstrates some readability problems: a vague variable name ('topicObj'), an ambiguous comment that doesn't clearly explain the behavior, and missing surrounding structure. There is no method definition visible, making the code impossible to fully evaluate. The comment contains a typo ('not final' should be 'not final') and references a method without showing its implementation. The code does show low nesting and one action per line, but the unclear purpose, incomplete structure, and ambiguous intent significantly reduce readability.
Run 2
The code is relatively simple and concise, with one action per line, making the reading flow fairly natural. However, it lacks context and structure: the excerpt begins mid-function, the relationship between `topicObj`, `topicMgr`, and the surrounding class is unclear, and the comment is ambiguous—it mentions 'don't care if topic not final' but doesn't explain why or what 'final' means here. The nested method `getMsgProtocol` appears abruptly without clear separation from the preceding logic. While the code avoids deep nesting and keeps actions granular, the overall clarity of intent is moderate due to missing context, unclear variable naming (`topicObj`, `topicMgr` are terse), and minimal documentation. The comment could be more precise to justify the design decision.
Run 3
The code is mostly readable with clear intent: it retrieves or creates a topic, explains a non-critical condition in a comment, publishes data, and returns a protocol string. Structure is logical and nesting is flat. However, there are minor issues: the comment is slightly verbose and could be more concise; the method name `getMsgProtocol` is clear, but the surrounding code snippet appears to be a fragment, making it harder to assess full context. Action granularity is good—one action per line. Reading flow is natural, but the comment interrupts flow slightly. Overall, it is readable but could be tightened.
Run 1
Code Structure: The visible operations are logically organized, though the excerpt begins inside an unseen method. Nesting: No deep nesting is present. Clarity of intent: Topic retrieval and publication are clear, and the comment explains behavior for non-final topics; however, 'arg1' is an unexplained protocol identifier. Code length: The snippet is concise without unnecessary implementation detail. Action granularity: Each executable line performs one primary action. Reading flow: Retrieval naturally precedes publication, followed by a separate protocol accessor; missing surrounding context and slightly awkward comment wording mildly hinder readability.
Run 2
Code Structure: The visible operations are logically ordered, followed by a separate method, though the incomplete surrounding context limits assessment. Nesting: The snippet is flat, with no nested control flow. Clarity of intent: Getting or creating a topic and publishing data are clear; the comment explains non-final topic behavior, but 'arg1' and the abbreviated method name provide limited context. Code length: Concise, with no obvious unnecessary code. Action granularity: Each statement performs one primary action. Reading flow: The sequence is natural and whitespace separates the method, though the comment references getListeners(), which is not called here, slightly interrupting comprehension.
Run 3
Code Structure: The topic lookup and publication form a logical sequence, followed by a separate protocol accessor, though the snippet lacks surrounding context. Nesting: No deep nesting is visible. Clarity of intent: Descriptive names make topic publication clear, and the comment explains behavior for non-final topics; however, 'arg1' and the protocol accessor's purpose are not explained. Code length: Concise, with little unnecessary code. Action granularity: Each statement performs one clear action. Reading flow: Natural and easy to follow, although the leading indentation and transition to a method definition make the fragment feel incomplete.