Sample
pyint-23ba6e612caf-I08
Select one of ten high-readability unrelated code templates per class
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Dorn | 0.749 | 0–1; higher is more readable |
| Mi | 0.518 | 0–1; higher is more readable |
| LLOC | 26 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 12.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 14 | 0–20; mean of three runs |
| BTTF | 0.508 | 0–1; higher is more readable |
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. | 1103.271 | −36.408 |
| Source linesThe number of non-empty source lines. | 42 | +16.8 |
| 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.323 | −6.484 |
Intercept 8.87 + feature contributions = -17.222 (log-odds).
Score = sigmoid(-17.222) = 0.
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. | 69.953 | +0.702 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 40 | +0.646 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 40 | −0.497 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 43 | −0.486 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.052 | +0.44 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 41.831 | +0.175 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 52.581 | +0.044 |
Intercept 0.07 + feature contributions = 1.094 (log-odds).
Score = sigmoid(1.094) = 0.749.
| Score | 0.518 |
|---|
| Score | 26 |
|---|
Run 1
The code has a clear class structure and uses decorators appropriately, but readability is hindered by several issues. The __repr__ method contains an unexplained Fibonacci calculation that appears unrelated to the class purpose, adding confusion. The iterable_identifier construction uses a nested conditional, though only one level deep. The __call__ method is clear, with one action per line, but the class overall has mixed concerns. Naming is inconsistent: member_validator and iterable_validator are descriptive, yet the Fibonacci variables (previous_number, current_number, next_number) obscure intent within __repr__. The reading flow is disrupted by the unnecessary loop and lack of comments explaining non-obvious logic. Code length is reasonable, but the action granularity in __repr__ could be improved by extracting the Fibonacci logic into a separate method or removing it entirely. The import block appears partially unused, adding minor clutter.
Run 2
The code is generally well-structured and readable, with clear class definition, appropriate use of decorators, and logical organization. The __call__ method is concise and follows a flat, easy-to-follow flow with one primary action per line. However, the __repr__ method contains an apparently pointless Fibonacci-sequence loop that computes values but never uses them, creating confusion about intent and adding unnecessary length. The variable names in that loop (previous_number, current_number, next_number, sequence_step) suggest a deliberate calculation, yet its purpose is unclear. Additionally, the formatting of the iterable_identifier and the return string is a bit dense but still understandable. Overall, readability is good but slightly undermined by the dead code and minor verbosity in __repr__.
Run 3
The code is logically organized with clear class structure and attribute definitions, and the __call__ method is relatively flat and readable. However, the __repr__ method is unnecessarily convoluted: it contains a Fibonacci-like loop that serves no apparent purpose and is disconnected from the method's intent, severely hurting clarity. The action granularity is generally one action per line, but the loop and conditional expression add complexity. The code is concise in parts but bloated in __repr__. The reading flow is disrupted by the irrelevant sequence calculation. Overall, the code is maintainable but suffers from unclear intent in __repr__, which lowers its readability score significantly.
Run 1
Code Structure: The class cleanly separates validation from representation, but unused imports and an unrelated Fibonacci calculation weaken organization. Nesting: Shallow conditionals and loops make control flow easy to follow. Clarity of intent: Descriptive validator names clearly communicate validation behavior, while the Fibonacci loop has no apparent purpose and is_callable() and optional() are not defined or imported in the snippet. Code length: The validation logic is concise, but unnecessary imports and computation add clutter. Action granularity: Each statement generally performs one action, improving scanability. Reading flow: Validation proceeds naturally from the iterable to its members; however, the unrelated calculation interrupts __repr__, and the multiline conditional and string construction require slightly more effort to read.
Run 2
Code Structure: The class logically separates initialization, validation, and representation, but unused imports and unrelated Fibonacci calculations in __repr__ add clutter. Nesting: Shallow conditionals and loops keep the code easy to follow. Clarity of intent: Validator names and __call__ clearly communicate iterable validation; the unexplained sequence calculation obscures __repr__'s purpose, and is_callable and optional are not defined or imported in the snippet. Code length: Mostly concise, but the unused sequence calculation and imports unnecessarily increase length. Action granularity: Each line generally performs one action, making operations easy to scan. Reading flow: Validation proceeds naturally from the container to its members, while the unrelated computation interrupts the representation method's otherwise straightforward flow.
Run 3
Code Structure: The class logically separates validation and representation, but unrelated Fibonacci calculations in __repr__ and several unused imports introduce clutter. Nesting: Shallow conditionals and loops make control flow easy to follow. Clarity of intent: Descriptive validator names clarify __call__, while the unused sequence calculation obscures __repr__'s purpose. The is_callable and optional helpers are not defined or imported in the snippet, reducing self-contained clarity. Code length: Validation is concise, but unnecessary imports and calculations lengthen the code without contributing behavior. Action granularity: Statements generally perform one action per line, making operations easy to scan. Reading flow: Validation proceeds naturally from the iterable to its members; representation construction is readable, but its unrelated preliminary loop interrupts the flow.