Sample
int-8c6ec846301e-I05
Rewrite eligible decimal integer literals in hexadecimal notation
Scores
| Method | Score | Scale |
|---|---|---|
| Posnett | 0 | 0–1; higher is more readable |
| Scalabrino | 0.611 | 0–1; higher is more readable |
| Dorn | 0.381 | 0–1; higher is more readable |
| Mi | 0.405 | 0–1; higher is more readable |
| LLOC | 35 | Logical lines; fewer is more readable |
| DeepSeek V4 Pro | 15.67 | 0–20; mean of three runs |
| GPT-6.1 Sol | 17.67 | 0–20; mean of three runs |
| BTTF | 0.142 | 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. | 3192.537 | −105.354 |
| Source linesThe number of non-empty source lines. | 93 | +37.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.812 | −7.219 |
Intercept 8.87 + feature contributions = -66.502 (log-odds).
Score = sigmoid(-66.502) = 0.
| Score | 0.611 |
|---|
Feature contributions
| Feature | Value | Contribution (log-odds) |
|---|---|---|
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 94 | −2.292 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 81 | +2.065 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 81 | −1.438 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 92.845 | +0.888 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 95.894 | +0.743 |
| 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. | 96 | −0.401 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.109 | −0.118 |
Intercept 0.07 + feature contributions = -0.484 (log-odds).
Score = sigmoid(-0.484) = 0.381.
| Score | 0.405 |
|---|
| Score | 35 |
|---|
Run 1
The code is fairly readable due to clear class structure, logical method naming, and useful Javadoc comments. The helper methods reduce duplication and improve clarity in size() and contains(). However, it loses points for several issues: the ternary expression in size() uses hex literals (0x1/0x0) instead of boolean true/false, reducing clarity. The contains() method has nested conditionals and repeated graph.isDirected() checks, adding mild nesting and slight ambiguity. Some logic — particularly the directed size calculation and incident-edge containment checks — could be extracted for better flow. Overall, the structure is solid, but a few dense expressions and nesting patterns prevent it from being highly readable.
Run 2
The code is well-structured and readable overall. It has clear class and method names, meaningful Javadoc, and a logical organization with helper methods that reduce duplication. The nesting is shallow (mostly 2-3 levels), and the reading flow is natural. The main readability issue is in the `size()` method: the inline ternary using hex literals (`0x1` / `0x0`) and the multi-line expression make the intent less obvious. The `contains` method is slightly long but still logical. Some minor verbosity exists in the repeated `endpointPair` variable declarations, but overall the code is concise, purposeful, and easy to follow.
Run 3
The code is generally well-structured and readable. It follows a logical organization with clear separation of concerns (fields, constructor, overridden methods, private helpers). Nesting is minimal, with only a couple of two-level conditionals. Intent is mostly clear: it represents a set of incident edges for a node in a graph. Methods like predecessorsOrEmpty and successorsOrEmpty improve clarity. However, readability is slightly reduced by the compact ternary expression in size(), which combines arithmetic and a boolean check in one line. The method contains() has multiple branches but remains flat and understandable. Variable names like nodeU and nodeV are a bit vague. Overall, the code is concise, uses helper methods effectively, and maintains good reading flow, but could benefit from slightly more explicit handling of the edgeType logic in size() and clearer endpoint variable naming.
Run 1
Code Structure: Fields, enum, constructor, public overrides, and private helpers are logically organized. Nesting: Control flow is shallow, with early returns simplifying contains(). Clarity of intent: Descriptive names and helper documentation clearly convey edge filtering; however, the self-loop correction in size() requires interpretation, and hexadecimal 0x1/0x0 unnecessarily obscure ordinary counts. Code length: Generally concise, though repeated predecessor lookups and explicit else branches after returns add minor verbosity. Action granularity: Statements generally perform one action each; compound boolean expressions remain manageable, but size() combines several operations in one expression. Reading flow: Methods follow a natural progression, and directed versus undirected behavior is clearly separated. Minor drawbacks include the missing blank line after the package declaration and the uncommented self-loop adjustment.
Run 2
Code Structure: Fields, enum, constructor, overridden methods, and private helpers are logically organized with clear responsibilities. Nesting: Shallow conditionals and early validation returns keep control flow easy to follow. Clarity of intent: Descriptive names, enum comments, and helper documentation explain edge filtering well; however, the self-loop adjustment in size() lacks explanation, and hexadecimal 0x1/0x0 unnecessarily obscure simple values. Code length: Compact overall, with minor repetition in directedness checks and helper calls. Action granularity: Statements generally perform one action per line, although compound return expressions require slightly more attention. Reading flow: Consistent formatting and separate directed/undirected branches support natural reading; the multiline arithmetic and Boolean expressions introduce modest cognitive overhead.
Run 3
Code Structure: Methods are logically organized, with edge-selection logic isolated in small helpers. Nesting: Shallow conditionals and early returns keep complexity low, though some else branches are unnecessary. Clarity of intent: Descriptive names, enum comments, and helper documentation explain the purpose well; hexadecimal 0x1 and 0x0 obscure an otherwise straightforward self-loop adjustment. Code length: Concise overall, with minor repetition in graph queries and similar helper methods. Action granularity: Statements generally perform one action per line; compound return expressions remain manageable. Reading flow: Validation precedes membership checks naturally, and directed versus undirected behavior is clearly separated. The size calculation requires slightly more effort to understand because it combines conditional edge selection and self-loop deduplication.