Sample
Dorn/python/86
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.297 | 0–1; higher is more readable | 77.7Δ 21.7 |
| Scalabrino | 0.541 | 0–1; higher is more readable | 50.0Δ 49.4 |
| Dorn | 0.776 | 0–1; higher is more readable | 74.4Δ 25.1 |
| Mi | 0.741 | 0–1; higher is more readable | 91.4Δ 8.1 |
| LLOC | 6 | Logical lines; fewer is more readable | 72.8Δ 26.6 |
| DeepSeek V4 Pro | 6.33 | 0–20; mean of three runs | 18.1Δ 81.3 |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs | 88.9Δ 10.6 |
| BTTF | 0.623 | 0–1; higher is more readable | 79.7Δ 19.8 |
| Human | 4.28 | 1–5; original rating | 99.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) |
|---|---|---|
| Halstead volumeHow much symbolic information the code contains. It combines the total number of operators and values with the number of distinct ones. | 216.331 | −7.139 |
| 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.395 | −6.593 |
| Source linesThe number of non-empty source lines. | 10 | +4 |
Intercept 8.87 + feature contributions = -0.862 (log-odds).
Score = sigmoid(-0.862) = 0.297.
| Score | 0.541 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| 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. | 52 | +1.463 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 0 | −0.804 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 11 | +0.647 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 9 | −0.426 |
| 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. | 9.811 | −0.273 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.08 | +0.166 |
Intercept 0.07 + feature contributions = 1.241 (log-odds).
Score = sigmoid(1.241) = 0.776.
| Score | 0.741 |
|---|
| Score | 6 |
|---|
Run 1
The code has significant readability issues. The function call 'tex_processor(rubber_argv)' lacks context and the comment is ambiguous ('Rename output to _destination or print to stdout'). The if/else structure is flat but the logic is unclear: variable names like 'destination', 'pdfpath', and 'pdffile' are inconsistent, and the 'file()' built-in is used without a mode, which is cryptic. Action granularity is mixed—three actions are crammed into the if-branch without separation. The code appears incomplete and lacks error handling or clear intent about what 'tex_processor' does or why the file is being read or renamed. There is no indication of imports or variable definitions, making the flow disorganized and hard to follow. Overall, the code is terse but not readable; it needs comments explaining each step and consistent naming.
Run 2
The code is relatively straightforward but has several readability issues. The structure is logical but disjointed: a function call is followed by an unrelated comment acting as a section header, which breaks flow. The if-else structure is flat and simple, which is good, but clarity of intent suffers because variables like 'rubber_argv', 'destination', and 'pdfpath' aren't defined in-scope, making the purpose ambiguous without external context. Code length is concise, though the stdout branch could be simplified using a context manager or shutil.copyfileobj. Action granularity is mostly one action per line, which is positive. Reading flow is mixed: the natural top-to-bottom progression is interrupted by the comment style and the lack of context. The use of Python 2-style print and file handling suggests legacy code but doesn't directly impact readability. Overall, it's understandable at a glance but would benefit from clearer naming, a more integrated comment, and modern file-handling idioms.
Run 3
The code is mostly unreadable due to severe structural and clarity issues. It starts with a vague function call (`tex_processor(rubber_argv)`) with no context. The comment mixes unrelated concepts and incorrectly uses `::`, causing confusion. Variable naming is poor (`pdffile`, `pdfpath`, `destination` lack clarity). The if/else logic is simple, but the Python syntax is outdated (e.g., `file()` instead of `open()`, `print` statement instead of function), making the intent ambiguous. Action granularity is reasonable for the print block, but the flow is disjointed and lacks necessary imports or error handling. Overall, the snippet appears incomplete and would require significant effort to understand or maintain.
Run 1
Code Structure: A straightforward processor call followed by a logically organized output branch. Nesting: Only one conditional level, making the code easy to scan. Clarity of intent: Printing the generated file or renaming it is clear, although the processor's role and externally defined variables require context; the comment's '_destination' does not match 'destination'. Code length: Short and appropriately concise. Action granularity: Each statement performs one action. Reading flow: Natural top-to-bottom execution, with minor distractions from legacy Python syntax, inconsistent spacing in 'print pdffile.read()', and the comment's trailing punctuation.
Run 2
Code Structure: Logically organized into processing followed by output handling. Nesting: A single shallow if/else keeps complexity low. Clarity of intent: The comment and variable names clearly convey printing or renaming the PDF, though tex_processor and rubber_argv require external context. Code length: Short and appropriately concise. Action granularity: Each statement performs one action on its own line. Reading flow: Natural top-to-bottom execution with clearly separated alternatives. Minor readability drawbacks include outdated Python syntax, inconsistent spacing in the print statement, and manual file closing rather than a context manager.
Run 3
Code Structure: Logically organized into processing followed by output handling. Nesting: A single shallow if/else keeps complexity low. Clarity of intent: The comment and variable names clearly convey whether the PDF is printed or renamed, though tex_processor's behavior is not shown and the comment refers to _destination rather than destination. Code length: Concise with no unnecessary logic. Action granularity: Each statement performs one action on its own line. Reading flow: Natural top-to-bottom progression with whitespace separating stages. Minor readability issues include obsolete Python 2 file/print syntax, inconsistent spacing after print, and explicit file closing instead of a context manager.