Sample

Schnappinger/diarymanagement/TBA.Data.User#ddf7c5b75ed4

Human rating uses the original dataset scale.

Human4
Lines125

Scores

MethodScoreScaleDataset rank
(0–100)
Dorn0.8950–1; higher is more readable
96.0Δ 0.3
Mi0.8180–1; higher is more readable
97.4Δ 1.0
LLOC30Logical lines; fewer is more readable
49.2Δ 47.2
DeepSeek V4 Pro140–20; mean of three runs
29.9Δ 66.5
GPT-6.1 Sol16.670–20; mean of three runs
48.0Δ 48.3
BTTF0.6920–1; higher is more readable
78.9Δ 17.5
Human41–4; original rating
96.4

Views

Source code

package TBA.Data; import java.util.ArrayList; /** * This class provides an interface of a user * @author Dan McGrath */ public class User { private String displayName; private String sessionID; private int defaultDiaryID; private int numberOfDiaries; ArrayList<Diary> Diaries; /** * This method returns the diaries of a user * @return A Vector of Diaries. */ public ArrayList<Diary> getDiaries() { return Diaries; } /** * This method sets the diaries of a user * @param Diaries A Vector of Diaries. */ public void setDiaries(ArrayList<Diary> Diaries) { this.Diaries = Diaries; } /** * This method returns the unique sessionID assigned to the user * @return sessionID field */ public String getSessionID() { return sessionID; } /** * Sets the sessionID field of a user * @param sessionID */ public void setSessionID(String sessionID) { this.sessionID = sessionID; } /** * Sets the default diary id a user has access to * @param defaultDiaryID */ public void setDefaultDiaryID(int defaultDiaryID) { this.defaultDiaryID = defaultDiaryID; } /** * Sets name of the user * @param displayName */ public void setDisplayName(String displayName) { this.displayName = displayName; } /** * Sets the number of diaries a user has * @param numberOfDiaries */ public void setNumberOfDiaries(int numberOfDiaries) { this.numberOfDiaries = numberOfDiaries; } /** * This method returns the default diary id a user has access to * @return defaultDiaryID field */ public int getDefaultDiaryID() { return defaultDiaryID; } /** * This method returns the name of the user * @return displayName field */ public String getDisplayName() { return displayName; } /** * This method returns the number of Diaries a user has * @return numberOfDiaries field */ public int getNumberOfDiaries() { return numberOfDiaries; } /** * Find the Diary with the same ID as the one passed in and replace all of * it's details with the new ones. This is used when a new version of the * diary has been recieved across the network. *<p> * @param newDiary The new Diary. */ public void replaceDiary(Diary newDiary) { for(Diary nextDiary: Diaries) { if(nextDiary.getID() == newDiary.getID()) { nextDiary.replaceDiary(newDiary); break; } } } }

Loading feature diagnosis…

Source regions

Feature contributions

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.121−3.248
Indentation frequencyHow rapidly indentation changes from line to line.85+2.203
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.124.731+1.334
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.041+0.543
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.76.952+0.437
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.76.952+0.406
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.1+0.398

Intercept 0.07 + feature contributions = 2.143 (log-odds).
Score = sigmoid(2.143) = 0.895.

Score0.818
Score30
Run 1

The code is functional but has several readability issues. The class provides basic getters/setters with JavaDoc, which is clear, but inconsistent naming (e.g., 'Diaries' field and parameter names starting with uppercase) breaks Java conventions and reduces clarity. The field 'Diaries' should be 'diaries'. JavaDoc comments are repetitive and not consistently formatted. The 'replaceDiary' method has a loop with a conditional and a break, which could be clearer using streams or better separation. Overall structure is simple and reasonably organized, but naming and documentation issues, along with minor formatting inconsistencies, diminish readability. The code would benefit from following standard Java naming conventions and reducing redundant comments.

Run 2

The code is generally readable and follows a simple JavaBean pattern with clear getter/setter methods and Javadoc comments. Structure is logical, nesting is minimal, and each method performs one action. However, readability suffers slightly due to inconsistent formatting (uneven indentation), unconventional field naming (`Diaries` starts with uppercase), and redundant documentation. Some comments add little value, like 'Sets the sessionID field of a user.' The class is concise and straightforward, but lacks constructor initialization, which could make intent clearer. Overall, it is functional and understandable, but not polished.

Run 3

The code is generally readable with clear intent, simple getters/setters, and logical organization. It benefits from flat nesting and one action per line. However, issues slightly reduce readability: inconsistent indentation (some methods use 3 spaces vs other blocks), non-standard field naming (`Diaries` should be `diaries`), parameter names shadowing field names without clarity, redundant/no-value Javadoc on trivial getters/setters, and a lack of constructor or null-checking for the `Diaries` list. The `replaceDiary` method is clear but relies on `Diaries` being initialized elsewhere. Overall, it's maintainable but could be improved with better naming conventions and consistent formatting.

Run 1

1. Code Structure: Fields precede straightforward accessors and a diary-update method, providing logical organization, though getter/setter pairing is inconsistent. 2. Nesting: Accessors are flat; replaceDiary has only a loop and conditional, making nesting easy to follow. 3. Clarity of intent: Descriptive method and field names communicate purpose. However, capitalized Diaries violates Java naming conventions, and comments incorrectly describe ArrayList as Vector. 4. Code length: Method bodies are concise, but repetitive Javadoc adds unnecessary length for obvious accessors. 5. Action granularity: Each statement performs one action, with no compressed multi-action lines. 6. Reading flow: The class is easy to scan, but inconsistent indentation, spacing, and accessor ordering slightly disrupt flow.

Run 2

Code Structure: Fields and methods are logically organized, though grouping each getter with its setter would improve navigation. Nesting: Accessors are flat; replaceDiary uses only a straightforward loop and conditional. Clarity of intent: Descriptive method names make the user-data model and diary update clear, but capitalized Diaries is unconventional, and comments incorrectly describe ArrayList as Vector. Code length: Implementation is concise, but repetitive accessor documentation adds unnecessary bulk. Action granularity: Each statement performs one clear action on its own line. Reading flow: Consistent braces and simple methods support easy reading, while uneven indentation and inconsistent accessor ordering mildly disrupt the flow.

Run 3

Code Structure: Fields and small methods are logically organized, though grouping matching getters and setters would improve navigation. Nesting: Most methods are flat; replaceDiary has only a straightforward loop and conditional. Clarity of intent: Descriptive method names make the purpose clear, but the capitalized Diaries field violates naming conventions, and comments incorrectly describe ArrayList as Vector. Code length: The implementation is concise, although repetitive accessor documentation adds unnecessary length. Action granularity: Each statement performs a single action, making operations easy to follow. Reading flow: Consistent brace placement and simple control flow support readability, but uneven indentation and scattered accessor pairs slightly disrupt the flow.