Sample
Dorn/python/91
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 49.6Δ 15.6 |
| Scalabrino | 0.607 | 0–1; higher is more readable | 60.1Δ 5.1 |
| Dorn | 0.722 | 0–1; higher is more readable | 68.0Δ 2.8 |
| Mi | 0.355 | 0–1; higher is more readable | 35.1Δ 30.1 |
| LLOC | 20 | Logical lines; fewer is more readable | 32.5Δ 32.7 |
| DeepSeek V4 Pro | 8.67 | 0–20; mean of three runs | 32.7Δ 32.5 |
| GPT-6.1 Sol | 14.33 | 0–20; mean of three runs | 44.4Δ 20.8 |
| BTTF | 0.551 | 0–1; higher is more readable | 60.4Δ 4.7 |
| Human | 3.51 | 1–5; original rating | 65.2 |
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. | 729.11 | −24.061 |
| 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.865 | −7.298 |
Intercept 8.87 + feature contributions = -10.489 (log-odds).
Score = sigmoid(-10.489) = 0.
| Score | 0.607 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 86.935 | +0.598 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.061 | +0.348 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 28 | +0.231 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 28 | −0.222 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 31 | −0.061 |
| 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. | 86.968 | −0.018 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 29.852 | +0.007 |
Intercept 0.07 + feature contributions = 0.954 (log-odds).
Score = sigmoid(0.954) = 0.722.
| Score | 0.355 |
|---|
| Score | 20 |
|---|
Run 1
The code has several readability issues. The TableSpec class uses verbose getter/setter methods instead of Pythonic properties, adding unnecessary boilerplate. Multiple statements are compressed onto single lines (e.g., 'def getColumnCount(self): return self.columnCount'), violating the one-action-per-line principle. The Writer class contains commented-out code and commented-out settings spec entries, creating noise and ambiguity about what is actually active. The class attribute 'supported' appears after the tuple declaration with its docstring, disrupting natural reading flow and making the attribute's purpose unclear. The settings_spec structure is a complex nested tuple that is somewhat disorganized. While the constants at the top are clear and the overall structure is not deeply nested, the combination of compressed lines, dead code, and unclear organization significantly reduces readability. The code works but requires careful reading to understand what is functional versus leftover from previous versions.
Run 2
The code has some redeeming qualities, like the use of named constants and a simple class, but overall readability is poor. Structure suffers from a missing settings_default_overrides and incomplete-looking settings_spec. There's commented-out code that adds confusion. The mixing of English and non-English identifiers (`columnCount` vs `setColumnCount`) is inconsistent. Although nesting is minimal and actions are mostly one per line, clarity of intent is low: the Writer class lacks a clear docstring for its supported formats, settings_spec is fragmented, and the commented-out alternative documentclass option obscures active logic. Code length is acceptable, but redundancy from getters/setters and dead comments increases cognitive load. Reading flow is choppy due to abrupt line breaks, inline method definitions, and trailing commas without clear context. Overall, the code is maintainable only by someone very familiar with the docutils writer framework.
Run 3
The code has some readable elements but suffers from several issues. The TableSpec class is flat and simple, with clear getter/setter methods, but the one-line method definitions reduce readability. The constants are clearly named at the top, which helps establish intent. However, the Writer class is more problematic: there's commented-out code, unclear documentation strings, and the settings_spec tuple is nested and difficult to parse at a glance. The reading flow is disrupted by inconsistent formatting, unused imports, and the commented-out lines create ambiguity about what's current versus legacy. The class structure is logical but the settings_spec structure with nested tuples and comments makes it hard to understand the configuration schema without careful study. Action granularity is mixed - the TableSpec methods cram multiple actions onto single lines while the Writer settings span awkwardly across lines.
Run 1
Code Structure: Constants and classes are logically organized, but obsolete commented-out alternatives add clutter. Nesting: Methods are shallow; the nested settings_spec tuple is harder to parse visually. Clarity of intent: TableSpec and its accessors are straightforward, and option descriptions explain configuration, though dependencies and table-mode semantics are not shown. Code length: The snippet is concise, but trivial getters/setters and stale comments introduce avoidable verbosity. Action granularity: Most lines contain one action, although single-line method definitions compress declarations and implementations. Reading flow: The progression from constants to state management to writer configuration is natural, but inconsistent spacing, tightly packed methods, and uneven tuple indentation interrupt scanning.
Run 2
Code Structure: Constants and classes are logically separated, but commented-out alternatives and inconsistent spacing add clutter. Nesting: Methods are shallow; the nested settings tuple is harder to parse because of its indentation and closing delimiters. Clarity of intent: Descriptive constants, class names, and accessors make the purpose mostly clear, although the numeric modes and settings structure lack explanation. Code length: Compact overall, but boilerplate accessors and obsolete comments add unnecessary lines. Action granularity: Most lines perform one action, though single-line method definitions compress declarations and implementation together. Reading flow: The progression from table state to writer configuration is understandable, but inconsistent formatting and embedded commented-out configuration interrupt scanning.
Run 3
Code Structure: Constants and classes are logically grouped, but sparse spacing and a commented-out alternative weaken organization. Nesting: Methods are flat; the nested settings tuple is harder to parse because of uneven indentation. Clarity of intent: Descriptive constants, class names, and accessors convey purpose, although TableSpec lacks documentation and the settings text contains stale alternatives. Code length: Short overall, but repetitive accessors and obsolete comments add clutter. Action granularity: Most lines contain one action, though one-line method definitions compress declarations and bodies. Reading flow: Straightforward from constants to classes, but inconsistent formatting, deeply parenthesized configuration, and commented-out code interrupt scanning.