Sample
Dorn/python/4
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 15.3Δ 36.1 |
| Scalabrino | 0.479 | 0–1; higher is more readable | 39.1Δ 12.2 |
| Dorn | 0.144 | 0–1; higher is more readable | 10.0Δ 41.4 |
| Mi | 0.04 | 0–1; higher is more readable | 6.7Δ 44.7 |
| LLOC | 39 | Logical lines; fewer is more readable | 2.1Δ 49.3 |
| DeepSeek V4 Pro | 11.33 | 0–20; mean of three runs | 49.3Δ 2.1 |
| GPT-6.1 Sol | 15 | 0–20; mean of three runs | 52.8Δ 1.4 |
| BTTF | 0.205 | 0–1; higher is more readable | 6.1Δ 45.3 |
| Human | 3.35 | 1–5; original rating | 51.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. | 1917.551 | −63.279 |
| Source linesThe number of non-empty source lines. | 50 | +20 |
| 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.365 | −6.548 |
Intercept 8.87 + feature contributions = -40.957 (log-odds).
Score = sigmoid(-40.957) = 0.
| Score | 0.479 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Indentation frequencyHow rapidly indentation changes from line to line. | 50 | +0.992 |
| 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. | 107.98 | −0.908 |
| 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. | 51 | −0.769 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 50 | −0.727 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 49.853 | +0.287 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.089 | +0.079 |
Intercept 0.07 + feature contributions = -1.781 (log-odds).
Score = sigmoid(-1.781) = 0.144.
| Score | 0.04 |
|---|
| Score | 39 |
|---|
Run 1
The code demonstrates moderate readability with clear class structure and logical method organization. It uses flat nesting with only one level of conditionals, maintaining good action granularity with one main action per line. The intent is mostly clear despite some naming inconsistencies (mixing camelCase and snake_case) and magic strings like '\x00'. The feed method is somewhat long, containing multiple responsibilities including state management, debugging output, and distribution analysis. The logic for handling character buffers is complex but the code doesn't add unnecessary nesting. However, the mixing of naming conventions (_mCodingSM vs get_charset_name) and lack of type hints or docstrings reduces clarity. The code would benefit from breaking the feed method into smaller helper methods and more consistent naming conventions.
Run 2
The code follows a class-based structure with clear method separation, but readability is hampered by cryptic naming conventions (e.g., '_mCodingSM', 'eItsMe'), inconsistent indentation, and several overly long lines. The main feed() method has logical flow but contains a deeply nested conditional chain and an awkward trailing blank line before the return. Variable names are terse and require domain knowledge to interpret. The error/debug handling is inline and breaks the flow slightly. While each line generally performs one action and the overall purpose is understandable with context, the lack of comments, ambiguous state names, and mixed formatting reduce clarity.
Run 3
The code has poor readability due to several factors. The structure is moderately organized but the feed() method mixes state machine logic, error handling, and distribution analysis in a single loop with multiple responsibilities. Nesting is somewhat deep with nested if/elif/else blocks and conditional debug statements. The intent is unclear: magic values like '\x00', unclear variable names (aBuf, aLen, _mCodingSM), and an unexplained SHORTCUT_THRESHOLD make the purpose ambiguous. The code is unnecessarily long for what it does, with redundant reset() logic and awkward last-char tracking. Action granularity is violated: multiple operations are crammed into single lines (e.g., nested method calls on one line). Reading flow is disorganized—the conditional debug block interrupts the logic flow, and the final state check is separated from the main loop. The class also has placeholder methods (get_charset_name), suggesting incomplete design. Overall, this code requires significant effort to understand.
Run 1
Code Structure: Clearly separated initialization, reset, and input-processing methods provide logical organization. Nesting: Moderate nesting in feed, particularly state handling and character-boundary processing, adds some complexity but remains manageable. Clarity of intent: State constants and method names convey charset detection, but abbreviated, legacy-style names and unexplained buffer-boundary logic obscure details; the empty get_charset_name method does not explicitly communicate its intended subclass contract. Code length: Compact overall, although the debug message and confidence condition are visually cumbersome. Action granularity: Most lines perform one action, with the combined import being a minor exception. Reading flow: Processing proceeds naturally from state transitions to distribution analysis and final detection checks, but mixed naming conventions, a backslash continuation, and missing explanatory comments interrupt readability.
Run 2
Code Structure: Methods separate initialization, reset, and processing logically, although feed combines state transitions, distribution analysis, and detection decisions. Nesting: Mostly shallow, with moderate nesting inside the processing loop and confidence check. Clarity of intent: Method names and state constants communicate charset detection, but abbreviated variables, legacy member prefixes, and unexplained cross-buffer character handling require interpretation. The empty get_charset_name method lacks an explicit abstract-method contract. Code length: Compact overall, with little unnecessary code; the debug message and confidence condition are somewhat awkwardly formatted. Action granularity: Statements generally perform one action per line, though the combined import and long debug expression slightly reduce clarity. Reading flow: Initialization-to-reset-to-processing progression is natural, and breaks make state outcomes easy to follow. Mixed constant-access styles and missing comments around boundary handling interrupt that flow.
Run 3
Code Structure: Initialization, reset, and processing are logically separated into methods, although feed combines state transitions, character buffering, and confidence checking. Nesting: Mostly manageable, but the loop contains several nested conditionals, reaching four levels for debug logging and boundary handling. Clarity of intent: State constants and method names communicate charset detection, but abbreviated names, legacy member prefixes, unexplained buffer handling, and the empty get_charset_name method obscure details. Code length: Compact overall, with one long logging expression and a manually continued condition reducing readability slightly. Action granularity: Most lines perform one action; the combined import is a minor exception. Reading flow: Processing proceeds naturally from bytes to detection state and final confidence checks, though mixed naming conventions and absent explanations for cross-buffer character handling interrupt comprehension.