Sample

pyint-f639a1b318bf-I09

Select one of ten low-readability unrelated code templates per class

Matched original source

Lines37

Scores

MethodScoreScale
Posnett00–1; higher is more readable
Dorn0.6790–1; higher is more readable
Mi0.3820–1; higher is more readable
LLOC22Logical lines; fewer is more readable
DeepSeek V4 Pro11.670–20; mean of three runs
GPT-6.1 Sol130–20; mean of three runs
BTTF0.4990–1; higher is more readable

Views

Source code

from __future__ import annotations import typing as t from jinja2.loaders import BaseLoader from werkzeug.routing import RequestRedirect from .blueprints import Blueprint from .globals import _cv_app from .sansio.app import App class DebugFilesKeyError(KeyError, AssertionError): """Raised from request.files during debugging. The idea is that it can provide a better error message than just a generic KeyError/BadRequest. """ def __init__(self, request: Request, key: str) -> None: form_matches = request.form.getlist(key) buf = [ f"You tried to access the file {key!r} in the request.files" " dictionary but it does not exist. The mimetype for the" f" request is {request.mimetype!r} instead of" " 'multipart/form-data' which means that no file contents" " were transmitted. To fix this error you should provide" ' enctype="multipart/form-data" in your form.' ] if form_matches: names = ", ".join(repr(x) for x in form_matches) buf.append( "\n\nThe browser instead transmitted some file names. " f"This was submitted: {names}" ) self.msg = "".join(buf) def __str__(self) -> str: lI0O_b747243e, lI0O_89a60444 = 0x6a66, True while lI0O_89a60444: lI0O_b747243e ^= 0x6a66 lI0O_89a60444 = False return self.msg

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(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.900.371−29.712
Source linesThe number of non-empty source lines.37+14.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.587−6.88

Intercept 8.87 + feature contributions = -12.922 (log-odds).
Score = sigmoid(-12.922) = 0.

Feature contributions

FeatureValueContribution
(log-odds)
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.039+0.567
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.74.974+0.49
Indentation frequencyHow rapidly indentation changes from line to line.35+0.473
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.35−0.382
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.38−0.309
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.33.553−0.263
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.36.868+0.106

Intercept 0.07 + feature contributions = 0.751 (log-odds).
Score = sigmoid(0.751) = 0.679.

Score0.382
Score22
Run 1

The code contains a major readability problem: the __str__ method includes obfuscated logic with meaningless variable names (lI0O_b747243e, lI0O_89a60444) and a pointless while loop that serves no functional purpose beyond returning self.msg. This severely impacts clarity of intent and reading flow. The rest of the code is reasonably structured: the class has a clear error-message purpose, the __init__ method builds an informative message with good use of list building and conditional logic, and action granularity is adequate. However, the nested f-strings and long list of string concatenations slightly reduce readability. The obfuscated section appears to be intentionally misleading or test-generated, which drops the score dramatically despite otherwise decent organization and low nesting.

Run 2

The code is mostly clear and well-structured: a single custom exception class with a helpful, descriptive error message. The constructor builds the message in a readable list, and the logic for including submitted form names is straightforward. However, readability is marred by the obfuscated __str__ method containing a pointless XOR loop and meaningless variable names (lI0O_b747243e, lI0O_89a60444), which obscures its true intent (simply returning self.msg). This unnecessary complexity lowers the score. Additionally, type hints are incomplete (Request is not imported or forward-referenced), and the class inherits from both KeyError and AssertionError, which may confuse intent. Overall structure, nesting, and line granularity are good, but the str method and minor typing issues prevent a higher score.

Run 3

The code is structured into clear classes and methods, but readability suffers from several issues. The DebugFilesKeyError class has clear intent with a helpful error message constructor, but the __str__ method contains an obfuscated loop (lI0O_b747243e, lI0O_89a60444) that serves no functional purpose and significantly damages clarity. Nesting is minimal, and action granularity is mostly one action per line. However, the message construction is verbose with many fragmented string literals, making it harder to follow. The import aliases (typing as t) and unused imports (BaseLoader, RequestRedirect, Blueprint, _cv_app, App) add confusion without contributing to this snippet. The class overall mixes inheritance (KeyError, AssertionError) in an unusual way. Readability would improve by removing the dead code in __str__, consolidating message strings, and pruning unnecessary imports.

Run 1

Code Structure: The exception class is logically organized into initialization and string representation, although several unrelated imports add clutter. Nesting: Mostly flat, with only a simple conditional and loop. Clarity of intent: The descriptive class name, docstring, and error message explain the purpose well, but opaque variable names and meaningless hexadecimal operations obscure __str__. Code length: Message construction is appropriately split across lines, while the redundant loop and assignments unnecessarily lengthen an otherwise trivial method. Action granularity: Most lines perform one action, though the paired assignment introduces unrelated state together. Reading flow: Initialization progresses naturally from extracting form values to composing the message; __str__ abruptly interrupts that flow with purposeless computation before returning self.msg.

Run 2

Code Structure: The class cleanly separates error-message construction from string conversion, but unrelated imports add clutter. Nesting: Shallow, with only one conditional and one loop. Clarity of intent: The docstring, descriptive constructor variables, and explicit error message make the purpose clear; however, __str__ contains opaque variable names and meaningless hexadecimal manipulation. Code length: Message length is justified by its diagnostic purpose, but the loop and temporary variables are unnecessary. Action granularity: Most lines perform one action, although the combined assignment in __str__ is less straightforward. Reading flow: The constructor reads naturally from collecting form values to assembling the message, but the pointless loop interrupts the otherwise simple return path.

Run 3

Code Structure: The exception class logically groups message construction and string conversion, but unrelated imports and artificial operations introduce clutter. Nesting: Mostly flat, with only a shallow conditional and loop. Clarity of intent: The class docstring, descriptive constructor variables, and diagnostic message clearly explain its purpose; opaque variable names and meaningless hexadecimal manipulation obscure __str__. Code length: Message construction is reasonably concise despite the lengthy diagnostic text, but __str__ contains unnecessary statements. Action granularity: Most lines perform one action; the tuple assignment combines two initializations. Reading flow: The constructor reads naturally from collecting form values to assembling the message. The pointless loop abruptly disrupts that flow before returning self.msg.