Sample
Schnappinger/jsweet/org.jsweet.input.typescriptdef.parser.GenParser
Human rating uses the original dataset scale.
Scores
| Method | Score | Scale | Dataset rank (0–100) |
|---|---|---|---|
| Posnett | 0.424 | 0–1; higher is more readable | 77.6Δ 20.3 |
| Scalabrino | 0.716 | 0–1; higher is more readable | 42.1Δ 15.1 |
| Dorn | 0.335 | 0–1; higher is more readable | 50.8Δ 6.4 |
| Mi | 0.083 | 0–1; higher is more readable | 9.6Δ 47.7 |
| LLOC | 3 | Logical lines; fewer is more readable | 91.1Δ 33.8 |
| DeepSeek V4 Pro | 17.33 | 0–20; mean of three runs | 73.9Δ 16.7 |
| GPT-6.1 Sol | 18 | 0–20; mean of three runs | 73.8Δ 16.5 |
| BTTF | 0.675 | 0–1; higher is more readable | 74.3Δ 17.0 |
| Human | 3.92 | 1–4; original rating | 57.3 |
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. | 395.918 | −13.065 |
| Source linesThe number of non-empty source lines. | 29 | +11.6 |
| Byte entropyHow varied the bytes in the source text are. Repeated bytes give a lower value; a more even mixture gives a higher value. | 5.141 | −7.711 |
Intercept 8.87 + feature contributions = -0.306 (log-odds).
Score = sigmoid(-0.306) = 0.424.
| Score | 0.716 |
|---|
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. | 154 | −2.858 |
| Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right. | 154 | +1.68 |
| Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *. | 0.032 | +0.633 |
| Indentation frequencyHow rapidly indentation changes from line to line. | 12 | −0.322 |
| Number layout frequencyHow rapidly the number of numeric values per line changes through the code. | 12 | +0.145 |
| Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code. | 30 | −0.026 |
| Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom. | 28.819 | −0.007 |
Intercept 0.07 + feature contributions = -0.684 (log-odds).
Score = sigmoid(-0.684) = 0.335.
| Score | 0.083 |
|---|
| Score | 3 |
|---|
Run 1
The code is concise and well-structured with a clear purpose, generating parser and lexer files. It has minimal nesting and one action per method, aiding readability. However, some ambiguity exists: the repeated '-expect 0' flag in the argument array could confuse readers, and the long parameter list lacks formatting. Magic strings for file names and package names slightly diminish clarity, though the overall intent is straightforward.
Run 2
The code is highly readable due to its simplicity and clarity. It has a logical structure with a single class and a concise main method. Nesting is minimal, with only method calls inside an array. The intent is unambiguous: generating parser files via Java CUP and JFlex. Code length is appropriate, with no unnecessary verbosity. Action granularity is good, with one logical operation per line. Reading flow is natural, progressing from the cup generation to the lexer generation. Minor deductions: the duplicated '-expect', '0' argument is slightly redundant, and the long single-line file paths and arguments reduce readability slightly. Overall, the code is clear and maintainable.
Run 3
The code is highly readable due to its simple structure, clear intent, and minimal nesting. The main method directly invokes two parser-generation tools with explicit string arguments, and each tool call occupies its own logical block. Action granularity is reasonable, though the java_cup.Main.main line contains many arguments on one line, slightly reducing readability. The license header adds length but is standard boilerplate and clearly separated from the logic. Overall, the code is concise, flat, and straightforward with no ambiguity.
Run 1
Code Structure: A single class and entry point logically group the parser and lexer generation steps. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Generator calls and filenames convey the purpose, although the abbreviated class name and unexplained command-line options slightly reduce clarity. Code length: The implementation is concise; the lengthy license header is conventional rather than unnecessary logic. Action granularity: Each generator invocation is a separate statement, keeping actions distinct. Reading flow: The two calls follow a straightforward sequence, but the long argument-array line and duplicated '-expect', '0' option introduce minor visual clutter.
Run 2
Code Structure: A single class and entry point logically group parser and lexer generation. Nesting: No nested control flow, making the code easy to scan. Clarity of intent: Class and tool names reveal the purpose, though the generation sequence and command-line options lack explanation; the duplicated '-expect', '0' pair is distracting. Code length: The implementation is concise; the lengthy license header is standard boilerplate rather than unnecessary implementation. Action granularity: Each statement performs one generation action, although the parser invocation packs many arguments onto a long line. Reading flow: Execution proceeds naturally from parser generation to lexer generation, with only the dense argument formatting slightly interrupting readability.
Run 3
Code Structure: A simple class with one entry point logically groups parser and lexer generation. Nesting: Minimal nesting makes the code easy to scan. Clarity of intent: Generator names, arguments, and filenames communicate the purpose, though GenParser is abbreviated and the duplicated '-expect', '0' option is distracting. Code length: The executable code is concise; the lengthy license header is standard boilerplate rather than unnecessary implementation. Action granularity: Each generator invocation is a separate statement, although the first invocation packs many arguments into a long line. Reading flow: Parser generation followed by lexer generation is straightforward, but cleaner argument formatting would improve readability.