Sample

Schnappinger/aoi/artofillusion.spmanager.SPMFileSystem

Human rating uses the original dataset scale.

Human3.84
Lines98

Scores

MethodScoreScaleDataset rank
(0–100)
Posnett00–1; higher is more readable
43.5Δ 2.4
Scalabrino0.7560–1; higher is more readable
51.0Δ 5.2
Dorn0.4420–1; higher is more readable
57.8Δ 11.9
Mi0.4440–1; higher is more readable
27.4Δ 18.5
LLOC61Logical lines; fewer is more readable
34.3Δ 11.6
DeepSeek V4 Pro13.330–20; mean of three runs
24.1Δ 21.8
GPT-6.1 Sol150–20; mean of three runs
25.7Δ 20.1
BTTF0.4610–1; higher is more readable
40.9Δ 5.0
Human3.841–4; original rating
45.9

Views

Source code

/* Copyright 2004 Francois Guillet This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ package artofillusion.spmanager; import java.util.Vector; import artofillusion.*; public class SPMFileSystem { protected Vector pluginsInfo, toolInfo, objectInfo, startupInfo; protected boolean initialized; public final static short PLUGIN_TYPE = 0; public final static short TOOL_SCRIPT_TYPE = 1; public final static short OBJECT_SCRIPT_TYPE = 2; public final static short STARTUP_SCRIPT_TYPE = 3; public SPMFileSystem() { pluginsInfo = new Vector(); toolInfo = new Vector(); objectInfo = new Vector(); startupInfo = new Vector(); initialized = false; } public short getInfoType(SPMObjectInfo info) { for (int i = 0; i < pluginsInfo.size(); ++i) if (info == pluginsInfo.elementAt(i)) return PLUGIN_TYPE; for (int i = 0; i < toolInfo.size(); ++i) if (info == toolInfo.elementAt(i)) return TOOL_SCRIPT_TYPE; for (int i = 0; i < objectInfo.size(); ++i) if (info == objectInfo.elementAt(i)) return OBJECT_SCRIPT_TYPE; for (int i = 0; i < startupInfo.size(); ++i) if (info == startupInfo.elementAt(i)) return STARTUP_SCRIPT_TYPE; return PLUGIN_TYPE; } public void deleteInfo(SPMObjectInfo info) { pluginsInfo.remove(info); toolInfo.remove(info); objectInfo.remove(info); startupInfo.remove(info); } public void downloadRemoteFile(SPMObjectInfo nodeInfo, String fileName) { System.out.println("Download request for a non able SPMFileSystem"); } public void initialize() { pluginsInfo.clear(); toolInfo.clear(); objectInfo.clear(); startupInfo.clear(); } public Vector getPlugins() { if (!initialized) initialize(); return pluginsInfo; } public Vector getToolScripts() { if (!initialized) initialize(); return toolInfo; } public Vector getObjectScripts() { if (!initialized) initialize(); return objectInfo; } public Vector getStartupScripts() { if (!initialized) initialize(); return startupInfo; } public void getRemoteInfo(Runnable cb) { if (!initialized) initialize(); } }

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.2655.435−87.629
Source linesThe number of non-empty source lines.98+39.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.691−7.037

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

Score0.756

Feature contributions

FeatureValueContribution
(log-odds)
Comment layout frequencyHow frequently the layout switches between lines containing only comments or whitespace and lines containing code.99−2.469
Indentation frequencyHow rapidly indentation changes from line to line.89+2.341
Number layout frequencyHow rapidly the number of numeric values per line changes through the code.89−1.621
Identifier layout (vertical)How rapidly the visual pattern of identifier characters changes from top to bottom.97.851+0.958
Comment layout (horizontal)How rapidly the visual pattern of comment characters changes from left to right.70.556+0.334
Operator visual areaThe share of the code’s visual area occupied by operators such as +, =, and *.0.084+0.128
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.85.96+0.024

Intercept 0.07 + feature contributions = -0.234 (log-odds).
Score = sigmoid(-0.234) = 0.442.

Score0.444
Score61
Run 1

The code is moderately readable but has several issues. The structure is logical with clear separation of concerns, but there's code duplication and potential bugs. The first three criteria (structure, nesting, clarity) are mostly satisfied - the class is well-organized and flat. However, the `getInfoType` method has repetitive loops with identical logic, which could be simplified using a single map or helper method. The `initialized` flag is never set to `true` after initialization, suggesting a bug or incomplete implementation. The `getRemoteInfo` method appears incomplete, accepting a callback but never using it. Method naming is generally clear, but `SPMFileSystem` is poorly named - the abbreviation is unclear without context. The code uses raw `Vector` instead of generics, reducing type safety and clarity. Overall, while the basic structure is maintainable, the code has several quality issues that impact readability and correctness.

Run 2

The code has a logical structure with clear class organization, flat nesting, and generally one action per line. Method names clearly express intent. However, several issues reduce readability: the getInfoType method uses repetitive loops instead of a more efficient map or helper method, fields like pluginsInfo are public API via getters but lack defensive copies, and vector usage is outdated. The initialized flag is redundantly checked in every getter, and getRemoteInfo ignores its callback parameter without explanation. Magic strings like 'Download request for a non able SPMFileSystem' are unclear. The class mixes responsibilities (file system, script management, remote operations) without clear separation. Overall it's readable but would benefit from modernization and simpler type-checking logic.

Run 3

The code is generally readable with clear structure and intent. Class organization is logical, methods are short and focused, and naming is descriptive. However, there are notable issues: getInfoType() uses repeated loop patterns with if statements instead of a simpler lookup map or helper method, creating unnecessary duplication. The downloadRemoteFile and getRemoteInfo methods contain placeholder implementations without clear documentation of their incomplete status. The class uses raw Vector types (legacy Java), which reduces type safety and readability. While the code is flat and actions are well-separated per line, the copyright header is verbose relative to the simple class content. Overall, the code is maintainable but could benefit from modernization and reduced repetition.

Run 1

Code Structure: Methods are logically separated, and related collections and type constants are grouped clearly. Nesting: Control flow is shallow, although omitted braces make loop and conditional boundaries less explicit. Clarity of intent: Most method names are descriptive, but initialize() never sets initialized to true, getRemoteInfo() ignores its callback, and downloadRemoteFile() provides only an awkward diagnostic message. Returning PLUGIN_TYPE for unknown objects also obscures intent. Code length: The class is compact, though repeated collection searches and initialization checks introduce some duplication. Action granularity: Most lines perform one action, but inline conditional returns and initialization calls compress distinct control-flow steps. Reading flow: Declaration, construction, and method ordering are easy to follow; consistent formatting helps, while raw Vector types and unexplained stub-like behavior require extra interpretation.

Run 2

Code Structure: Fields, constants, construction, and operations are logically organized, although repeated collection handling could be consolidated. Nesting: Shallow loops and conditionals make control flow easy to follow; omitted braces slightly weaken visual clarity. Clarity of intent: Method and constant names generally communicate purpose, but raw Vectors obscure element types. initialize() never sets initialized, getRemoteInfo() ignores its callback, and getInfoType() defaults to PLUGIN_TYPE, making intended behavior ambiguous. Code length: The class is compact, though initialization checks and collection operations are repetitive. Action granularity: Most statements perform one action per line, but inline conditional returns and initialization calls compress control flow. Reading flow: Consistent formatting and short methods support natural reading, while unexplained stub methods and the unclear download message interrupt understanding.

Run 3

Code Structure: Fields, constants, constructor, and short methods are logically organized, though repeated collection handling adds duplication. Nesting: Very shallow, with simple loops and conditionals; omitted braces make control boundaries slightly less explicit. Clarity of intent: Method and constant names mostly communicate purpose, but raw Vectors obscure element types, initialize() never sets initialized, getInfoType() defaults to PLUGIN_TYPE for unknown objects, and the unused callback makes getRemoteInfo() ambiguous. Code length: Compact overall, though collection searches and initialization checks are repetitive. Action granularity: Most lines perform one action, but inline conditional returns and initialization calls compress control flow and actions together. Reading flow: Consistent formatting and straightforward method bodies support easy scanning, while unexplained stub behavior and unclear initialization semantics interrupt understanding.