Sample
Dorn/python/98
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 34.5Δ 37.3 |
| Dorn | 0.643 | 0–1; higher is more readable | 56.5Δ 15.3 |
| Mi | 0.52 | 0–1; higher is more readable | 56.0Δ 15.9 |
| LLOC | 27 | Logical lines; fewer is more readable | 16.9Δ 55.0 |
| DeepSeek V4 Pro | 11.67 | 0–20; mean of three runs | 51.4Δ 20.5 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 52.8Δ 19.1 |
| BTTF | 0.438 | 0–1; higher is more readable | 30.1Δ 41.8 |
| Human | 3.62 | 1–5; original rating | 71.9 |
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. | 1055.671 | −34.837 |
| Source linesThe number of non-empty source lines. | 30 | +12 |
| 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.39 | −6.585 |
Intercept 8.87 + feature contributions = -20.552 (log-odds).
Score = sigmoid(-20.552) = 0.
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 90 | +0.648 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 29 | +0.266 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 29 | −0.245 |
| 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. | 89.935 | −0.144 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.092 | +0.047 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.923 | +0.008 |
Intercept 0.07 + feature contributions = 0.59 (log-odds).
Score = sigmoid(0.59) = 0.643.
| Score | 0.52 |
|---|
| Score | 27 |
|---|
Run 1
The code has a clear purpose and is generally structured logically, but suffers from several readability issues. The regex is compiled inside the function, which is inefficient and unnecessary. There are magic numbers (0, 1) used for selection and insertion parameters that lack naming without context. The while loop with manual index manipulation creates moderate complexity. Empty string constants QUOTE_START and QUOTE_END are unclear. The function has multiple return types (0, count). The nested try-except is shallow and appropriate. Line 9 is unnecessarily long with semicolon and message box call. Variable names like 'i' and 'end' are conventional but could be more descriptive. The function performs multiple actions per iteration (select, delete, insert, select, delete, insert) without helpers, making the core logic harder to follow. Overall, the code is maintainable but would benefit from extracting helper functions and adding better variable names.
Run 2
The code has a generally clear purpose—quoting text within a frame—but suffers from readability issues. Structure is acceptable, though the function mixes regex, error handling, UI actions, and text mutation. Nesting is moderate (one try/except, one while, one if), but the while-loop with manual index management increases cognitive load. Intent is fairly clear, aided by the function name and a helpful comment, but the interaction between selectText, deleteText, and insertText is not self-evident; multiple actions are packed into several lines, reducing clarity. Code length is reasonable, but some lines perform multiple distinct operations (e.g., selecting, deleting, then inserting), which hurts action granularity. Reading flow is somewhat disjointed due to manual index arithmetic and side-effect-heavy operations. Overall, it is understandable but would benefit from helper functions and clearer separation of concerns.
Run 3
The code structure is somewhat tangled: regex compilation should be outside the function, and the main loop mixes multiple responsibilities (finding, deleting, inserting). Nesting is shallow but the while/if logic obscures intent. Variable names like 'i' and 'end' are ambiguous; non-standard QUOTE_START/END empty strings are confusing. The function is moderately long but does several actions per iteration without clear separation. Action granularity is poor—selectText, deleteText, insertText operations are scattered without helper functions. Reading flow is disjointed: comments don't fully clarify the algorithm, and the early-return for empty text sits awkwardly after exception handling. Some positive points: docstring-like purpose is implied, and basic error handling exists, but overall readability is limited.
Run 1
Code Structure: Logically organized into text retrieval, error handling, an empty-text guard, and quote processing, though replacement operations could be extracted into a helper. Nesting: Moderate and manageable, with one conditional inside a loop. Clarity of intent: The function and API calls suggest replacing quotation marks, but empty replacement constants, generic names such as 'i' and 'end', and unexplained position calculations obscure details. Code length: Reasonably concise, although repeated selection/deletion/insertion sequences add verbosity. Action granularity: Almost every line performs a single action, making operations easy to follow; the stray semicolon is inconsistent with surrounding style. Reading flow: Mostly natural and sequential, but tracking offsets across mutations requires careful reading, especially because the replacement strings are empty.
Run 2
Code Structure: The function follows a logical sequence: retrieve text, handle errors and empty input, process matches, then return a count. Nesting: The loop contains a single if/else, keeping nesting manageable. Clarity of intent: Function and API names suggest replacing quotation marks, but empty replacement constants, generic variables such as i and end, and unexplained offset calculations obscure details. Code length: Fairly concise, although repeated select/delete/insert sequences could be extracted into a descriptive helper. Action granularity: Almost every line performs one action; the unnecessary trailing semicolon is a minor style inconsistency. Reading flow: Execution proceeds naturally from setup to processing and completion, but manual index manipulation and repeated editing operations require careful tracing. The empty-input comment helps, while a short description of the replacement strategy would improve readability.
Run 3
Code Structure: A single, logically organized function handles text retrieval, validation, scanning, replacement, and counting. Nesting: Modest nesting within the loop and conditional keeps complexity manageable; the early return helps. Clarity of intent: Names and operations suggest replacing quotation marks, but empty replacement constants, terse variables such as i and end, and undocumented external APIs obscure details. Code length: Reasonably concise, though repeated selection/deletion/insertion sequences add verbosity. Action granularity: Nearly every line performs one action, making individual steps easy to follow. Reading flow: Execution proceeds naturally from setup to processing to return, but index arithmetic and modifications to the external text while scanning the original string require careful reasoning. The unnecessary semicolon and inconsistent naming style slightly reduce polish.