java-topology/defects/jsbsim/CLEAN
russell@unturf.com e007972e5b jsbsim: all 5 MOADs CLEAN
236 source files scanned. Property tree uses O(N) find_child but only in
config-phase code. Runtime property access uses cached direct pointers.
Single-threaded codebase with small fixed-size collections throughout.
2026-03-31 12:58:58 -04:00

33 lines
1.7 KiB
Text

CLEAN — All 5 MOADs scanned 2026-03-31
Target: JSBSim (C++ flight dynamics model, used by FlightGear and ArduPilot)
Source: https://github.com/JSBSim-Team/jsbsim
Clone: ~/git/jsbsim (depth=1)
MOAD-0001 (CWE-407): CLEAN
Scanned all 236 source files in src/. Property tree (simgear/props/props.cxx)
has find_child O(N) linear scan but it is only used in configuration-phase
functions (first_unused_index, addChild, getChild). Runtime property access
uses direct bound pointers (FGPropertyValue caches PropertyNode after first
lookup). No vector.find/contains inside loops in hot paths. Collections are
small and fixed-size: 6 axes, 4 engines, 5 gear units, 3 aero force axes.
MOAD-0002 (Intertangle): CLEAN
FGFDMExec is a coordinator/scheduler, not a god object. Subsystems (FGAerodynamics,
FGPropulsion, FGFCS, etc.) have well-defined responsibilities and communicate
through a shared property tree (intended architecture). Input structs copy values
per frame, providing clean interfaces.
MOAD-0003 (Leaked Context): CLEAN
Single thread_local (FGLog.cpp GlobalLogger) holds a logger, not request-scoped
identity. JSBSim is single-threaded, no thread-local context leaks possible.
MOAD-0004 (Logged Secret): CLEAN
No credentials, passwords, tokens, or API keys in a flight dynamics model.
Logging is limited to simulation parameters, debug messages, and error reporting.
MOAD-0005 (Thundering Herd): CLEAN
No threading primitives (no mutex, no atomic, no lock_guard). JSBSim is
entirely single-threaded. FGModelLoader CachedFiles uses std::map (safe in
single-threaded context). FGFunction/FGLocation/FGQuaternion caches are
per-object with boolean invalidation flags (correct single-threaded pattern).