Sample
Schnappinger/aoi/artofillusion.ui.DefaultDockableWidget
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0 | 0–1; higher is more readable | 53.2Δ 18.5 |
| Scalabrino | 0.549 | 0–1; higher is more readable | 13.7Δ 21.0 |
| Dorn | 0.349 | 0–1; higher is more readable | 51.2Δ 16.5 |
| Mi | 0.059 | 0–1; higher is more readable | 7.3Δ 27.4 |
| LLOC | 13 | Logical lines; fewer is more readable | 68.2Δ 33.5 |
| DeepSeek V4 Pro | 16.67 | 0–20; mean of three runs | 59.9Δ 25.2 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 39.1 |
| BTTF | 0.548 | 0–1; higher is more readable | 50.2Δ 15.5 |
| Human | 3.25 | 1–4; original rating | 34.7 |
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. | 1368.309 | −45.154 |
| Source linesThe number of non-empty source lines. | 48 | +19.2 |
| 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.986 | −7.479 |
Intercept 8.87 + feature contributions = -24.563 (log-odds).
Score = sigmoid(-24.563) = 0.
| Score | 0.549 |
|---|
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. | 129 | −1.799 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 129 | +1.277 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 49 | −0.699 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 38 | +0.577 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 38 | −0.451 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 47.938 | +0.26 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.083 | +0.14 |
Intercept 0.07 + feature contributions = -0.624 (log-odds).
Score = sigmoid(-0.624) = 0.349.
| Score | 0.059 |
|---|
| Score | 13 |
|---|
Run 1
The code is logically structured, with clear class responsibility and minimal nesting. Methods are short, focused, and well-named, making intent easy to understand. The paintBorder method uses a flat control flow, mostly one action per line, and follows a natural top-to-bottom progression: bounds, colors, fill, line, then label. The only minor weaknesses are the slightly long gradient creation line and the repeated calls to ThemeManager methods, which could be placed in named variables for improved readability. Overall, it is concise, maintainable, and easy to follow.
Run 2
The code is well-structured, with a clear class definition and logical imports. It uses flat nesting with only one if-statement, making it easy to follow. The purpose of each method is evident: constructors for initialization and paintBorder for custom rendering. The code is concise, avoiding unnecessary verbosity. Each line performs a single action, maintaining good granularity. Reading flow is natural, with the paint logic progressing from background fill to border line to text. Minor readability could be improved by extracting the gradient painting and font metrics into helper methods, but overall it is highly readable.
Run 3
The code is generally readable with a clear purpose: a dockable widget that customizes its border painting. The class structure is logical, with two simple constructors and a single overridden paintBorder method. Nesting is minimal (one if statement), and action granularity is mostly one action per line. The paintBorder method follows a natural flow—get bounds, compute insets, paint gradient, draw line, then draw label. However, readability is reduced by several long lines, especially the GradientPaint constructor call, which packs many arguments into one line. The drawing coordinates (e.g., 'insets.top-1', 'fm.getMaxAscent()+2') are magic numbers without explanation. The empty no-argument constructor is unnecessary and adds clutter. Overall, it is clear and concise, but could benefit from line breaks and explanatory comments for coordinate calculations.
Run 1
Code Structure: The class is logically organized, with constructors followed by a focused border-painting method. Nesting: Only one shallow conditional keeps complexity low. Clarity of intent: The class documentation, descriptive API calls, and theme-related names clearly communicate its purpose; abbreviated variables and unexplained positioning constants slightly reduce clarity. Code length: The implementation is concise without unnecessary logic. Action granularity: Each statement performs one primary action, although the gradient construction combines several arguments and method calls on a long line. Reading flow: Painting proceeds naturally from background to separator to title, with consistent formatting. Separating these visual stages with blank lines, adding an override annotation, and spacing arithmetic expressions would improve readability further.
Run 2
Code Structure: A small, focused class cleanly separates constructors from border rendering. Nesting: Only one conditional, keeping control flow shallow. Clarity of intent: The class documentation and descriptive theme methods clearly explain the purpose; abbreviated variables and unexplained pixel offsets slightly reduce clarity. Code length: Concise, with little unnecessary implementation code, though the gradient construction line is long. Action granularity: Each statement performs one main action, making drawing operations easy to follow. Reading flow: Rendering progresses naturally from background to separator to title, with consistent formatting. Minor improvements would include wrapping the long line, spacing arithmetic operators, and using more descriptive local names.
Run 3
Code Structure: A small, focused subclass cleanly separates constructors from border rendering. Nesting: Only one shallow conditional, making control flow easy to follow. Clarity of intent: The class comment, method names, and theme-color accessors clearly explain the purpose; abbreviated variables and unexplained positioning constants slightly reduce clarity. Code length: Concise implementation with no unnecessary logic, though the gradient construction line is long. Action granularity: Each statement performs a distinct operation, with only modest expression complexity. Reading flow: Rendering proceeds naturally from geometry retrieval to background, separator, and optional title. Consistent formatting supports readability, although spacing around arithmetic operators and an explicit override annotation would improve scanability.