Repository Analysis

Farama-Foundation/HighwayEnv

A collection of environments for autonomous driving and tactical decision-making tasks

16.1 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of Farama-Foundation/HighwayEnv, a Python project with 3,291 GitHub stars. SynthScan v2.0 examined 19,424 lines of code across 123 source files, recording 200 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 16.1 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

16.1
Adjusted Score
16.1
Raw Score
100%
Time Factor
2026-07-13
Last Push
3.3K
Stars
Python
Language
19.4K
Lines of Code
123
Files
200
Pattern Hits
2026-07-14
Scan Date
0.10
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 12MEDIUM 21LOW 167

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 200 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers76 hits · 88 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py17def test_rotated_rectangles_intersect():CODE
LOWtests/test_utils.py36def test_confidence_ellipsoid(linear_regression_data):CODE
LOWtests/test_utils.py56def test_is_valid_observation(linear_regression_data):CODE
LOWtests/test_utils.py65def test_is_consistent_dataset_single_point():CODE
LOWtests/test_utils.py70def test_is_consistent_dataset_multiple_points(linear_regression_data):CODE
LOWtests/test_utils.py80def test_near_split_size_bins():CODE
LOWtests/test_utils.py85def test_distance_to_circle_hit():CODE
LOWtests/test_utils.py92def test_distance_to_circle_inside():CODE
LOWtests/test_utils.py98def test_distance_to_circle_miss():CODE
LOWtests/test_utils.py104def test_distance_to_rect_intersection():CODE
LOWtests/test_utils.py115def test_distance_to_rect_no_intersection():CODE
LOWtests/vehicle/test_behavior.py12def test_stop_before_obstacle(vehicle_type):CODE
LOWtests/road/test_road.py43def test_network_to_from_config(net):CODE
LOWtests/road/test_neighbour_vehicles.py31def _enable_connected_lane_search(road: Road) -> None:CODE
LOWtests/road/test_neighbour_vehicles.py162 def test_front_and_rear_on_same_segment(self, straight_connected_road):CODE
LOWtests/road/test_neighbour_vehicles.py198 def test_connected_segments_ignored_by_default(self, straight_connected_road):CODE
LOWtests/road/test_neighbour_vehicles.py216 def test_front_on_next_segment(self, straight_connected_road):CODE
LOWtests/road/test_neighbour_vehicles.py228 def test_rear_on_previous_segment(self, straight_connected_road):CODE
LOWtests/road/test_neighbour_vehicles.py240 def test_front_on_curve_segment(self, straight_curve_road):CODE
LOWtests/road/test_neighbour_vehicles.py252 def test_closer_same_segment_preferred_over_next_segment(CODE
LOWtests/road/test_neighbour_vehicles.py270 def test_both_connected_front_and_rear(self, three_segment_road):CODE
LOWtests/road/test_neighbour_vehicles.py282 def test_multi_lane_same_lane_id(self, multi_lane_road):CODE
LOWtests/road/test_neighbour_vehicles.py348 def test_vehicle_far_on_next_segment_detected(self, straight_connected_road):CODE
LOWtests/road/test_neighbour_vehicles.py358 def test_lane_index_none_returns_none(self, straight_connected_road):CODE
LOWtests/road/test_spline.py59 def test_single_element_array(self, simple_data):CODE
LOWtests/road/test_spline.py89 def test_epsilon_outside_left(self, simple_data):CODE
LOWtests/road/test_spline.py96 def test_epsilon_inside_right(self, simple_data):CODE
LOWtests/road/test_spline.py103 def test_epsilon_outside_right(self, simple_data):CODE
LOWtests/road/test_spline.py114 def test_large_extrapolation_left(self, simple_data):CODE
LOWtests/road/test_spline.py121 def test_large_extrapolation_right(self, simple_data):CODE
LOWtests/road/test_spline.py128 def test_two_point_interpolation(self, two_point_data):CODE
LOWtests/road/test_spline.py135 def test_two_point_extrapolation(self, two_point_data):CODE
LOWtests/road/test_spline.py159 def test_mixed_extrapolation_array(self, simple_data):CODE
LOWtests/road/test_spline.py184 def test_roundtrip_cartesian_frenet(self, spline):CODE
LOWtests/graphics/test_gym_render_mode.py22 def test_none_derives_offscreen(self):CODE
LOWtests/graphics/test_gym_render_mode.py28 def test_rgb_array_derives_offscreen(self):CODE
LOWtests/graphics/test_gym_render_mode.py35 def test_human_derives_onscreen(self):CODE
LOWtests/graphics/test_gym_render_mode.py41 def test_explicit_override_respected(self):CODE
LOWtests/graphics/test_gym_render_mode.py57 def test_rgb_array_returns_ndarray(self):CODE
LOWtests/graphics/test_gym_render_mode.py78 def test_rgb_array_with_window_still_returns_ndarray(self):CODE
LOWtests/graphics/test_gym_render_mode.py88 def test_human_with_offscreen_returns_none(self):CODE
LOWtests/graphics/test_gym_render_mode.py99 def test_offscreen_env_var_emits_warning(self):CODE
LOWtests/envs/test_gym.py120def test_connected_lane_neighbour_versions(old_env_spec, new_env_spec):CODE
LOWtests/envs/test_gym.py151def test_env_vectorization__info_dtype_is_float(env_spec):CODE
LOWtests/envs/test_finite_mdp.py13def test_clip_position_clips_to_grid_bounds():CODE
LOWtests/envs/test_finite_mdp.py20def test_transition_model_via_fromfunction():CODE
LOWtests/envs/test_finite_mdp.py34def test_compute_ttc_grid_on_highway_env():CODE
LOWtests/envs/test_finite_mdp.py49def test_compute_ttc_grid_predicts_collision():CODE
LOWscripts/sb3_highway_ppo_transformer.py303def display_vehicles_attention(CODE
LOWscripts/sb3_highway_ppo_transformer.py338def compute_vehicles_attention(env, model):CODE
LOWscripts/validate/compare_neighbour_detection.py326def original_neighbour_vehicles(CODE
LOWscripts/validate/compare_neighbour_detection.py364def patch_original_neighbour_vehicles(road: Road) -> None:CODE
LOWscripts/validate/compare_neighbour_detection.py469def _has_same_segment_vehicle(road, ego, direction: str) -> bool:CODE
LOWscripts/validate/compare_neighbour_detection.py499def _find_connected_lane_vehicle(road, ego, direction: str = "front"):CODE
LOWscripts/validate/compare_neighbour_detection.py556def _missed_connected_neighbour(road, ego, detected, reference, direction: str) -> bool:CODE
LOWscripts/validate/compare_neighbour_detection.py567def _draw_missed_neighbour_cue(CODE
LOWhighway_env/interval.py107def interval_absolute_to_local(CODE
LOWhighway_env/interval.py131def interval_local_to_absolute(CODE
LOWhighway_env/utils.py75def point_in_rotated_rectangle(CODE
LOWhighway_env/utils.py113def rotated_rectangles_intersect(CODE
16 more matches not shown…
Decorative Section Separators18 hits · 66 pts
SeverityFileLineSnippetContext
MEDIUMtests/road/test_neighbour_vehicles.py35# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py37# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py154# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py156# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py208# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py210# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py298# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/road/test_neighbour_vehicles.py300# ---------------------------------------------------------------------------COMMENT
MEDIUMscripts/sb3_highway_ppo.py9# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo.py11# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py21# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py23# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py270# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py272# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py298# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py300# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py368# ==================================COMMENT
MEDIUMscripts/sb3_highway_ppo_transformer.py370# ==================================COMMENT
Cross-File Repetition12 hits · 60 pts
SeverityFileLineSnippetContext
HIGHhighway_env/vehicle/kinematics.py0create a new vehicle from an existing one. the vehicle dynamics and target dynamics are copied, other properties are defSTRING
HIGHhighway_env/vehicle/controller.py0create a new vehicle from an existing one. the vehicle dynamics and target dynamics are copied, other properties are defSTRING
HIGHhighway_env/vehicle/behavior.py0create a new vehicle from an existing one. the vehicle dynamics and target dynamics are copied, other properties are defSTRING
HIGHhighway_env/envs/racetrack_env.py0populate a road with several vehicles on the highway and on the merging lane, as well as an ego-vehicle. :return: the egSTRING
HIGHhighway_env/envs/merge_env.py0populate a road with several vehicles on the highway and on the merging lane, as well as an ego-vehicle. :return: the egSTRING
HIGHhighway_env/envs/roundabout_env.py0populate a road with several vehicles on the highway and on the merging lane, as well as an ego-vehicle. :return: the egSTRING
HIGHhighway_env/envs/intersection_env.py0the episode is truncated if the time limit is reached.STRING
HIGHhighway_env/envs/highway_env.py0the episode is truncated if the time limit is reached.STRING
HIGHhighway_env/envs/exit_env.py0the episode is truncated if the time limit is reached.STRING
HIGHhighway_env/envs/highway_env.py0create some new random vehicles of a given type, and add them on the road.STRING
HIGHhighway_env/envs/parking_env.py0create some new random vehicles of a given type, and add them on the road.STRING
HIGHhighway_env/envs/exit_env.py0create some new random vehicles of a given type, and add them on the road.STRING
Unused Imports52 hits · 52 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py21CODE
LOWdocs/scripts/move_404.py1CODE
LOWscripts/sb3_highway_dqn_cnn.py5CODE
LOWscripts/sb3_highway_ppo.py6CODE
LOWscripts/sb3_highway_dqn.py5CODE
LOWscripts/sb3_highway_ppo_transformer.py17CODE
LOWscripts/sb3_racetrack_oval_ppo.py9CODE
LOWscripts/sb3_racetracks_ppo.py7CODE
LOWhighway_env/interval.py1CODE
LOWhighway_env/utils.py1CODE
LOWhighway_env/vehicle/graphics.py1CODE
LOWhighway_env/vehicle/kinematics.py1CODE
LOWhighway_env/vehicle/behavior.py1CODE
LOWhighway_env/vehicle/objects.py1CODE
LOWhighway_env/vehicle/dynamics.py1CODE
LOWhighway_env/vehicle/uncertainty/estimation.py1CODE
LOWhighway_env/vehicle/uncertainty/prediction.py1CODE
LOWhighway_env/road/graphics.py1CODE
LOWhighway_env/road/spline.py1CODE
LOWhighway_env/road/regulation.py1CODE
LOWhighway_env/road/road.py1CODE
LOWhighway_env/road/lane.py1CODE
LOWhighway_env/envs/u_turn_env.py1CODE
LOWhighway_env/envs/racetrack_env.py1CODE
LOWhighway_env/envs/merge_env.py1CODE
LOWhighway_env/envs/lane_keeping_env.py1CODE
LOWhighway_env/envs/intersection_env.py1CODE
LOWhighway_env/envs/__init__.py1CODE
LOWhighway_env/envs/__init__.py2CODE
LOWhighway_env/envs/__init__.py2CODE
LOWhighway_env/envs/__init__.py3CODE
LOWhighway_env/envs/__init__.py3CODE
LOWhighway_env/envs/__init__.py3CODE
LOWhighway_env/envs/__init__.py8CODE
LOWhighway_env/envs/__init__.py9CODE
LOWhighway_env/envs/__init__.py10CODE
LOWhighway_env/envs/__init__.py10CODE
LOWhighway_env/envs/__init__.py10CODE
LOWhighway_env/envs/__init__.py15CODE
LOWhighway_env/envs/__init__.py16CODE
LOWhighway_env/envs/__init__.py17CODE
LOWhighway_env/envs/__init__.py18CODE
LOWhighway_env/envs/highway_env.py1CODE
LOWhighway_env/envs/two_way_env.py1CODE
LOWhighway_env/envs/roundabout_env.py1CODE
LOWhighway_env/envs/parking_env.py1CODE
LOWhighway_env/envs/exit_env.py1CODE
LOWhighway_env/envs/common/abstract.py1CODE
LOWhighway_env/envs/common/graphics.py1CODE
LOWhighway_env/envs/common/observation.py1CODE
LOWhighway_env/envs/common/action.py1CODE
LOWhighway_env/envs/common/finite_mdp.py1CODE
Deep Nesting23 hits · 23 pts
SeverityFileLineSnippetContext
LOWscripts/validate/compare_neighbour_detection.py161CODE
LOWscripts/validate/compare_neighbour_detection.py427CODE
LOWscripts/validate/compare_neighbour_detection.py499CODE
LOWhighway_env/interval.py271CODE
LOWhighway_env/vehicle/graphics.py232CODE
LOWhighway_env/vehicle/controller.py89CODE
LOWhighway_env/vehicle/behavior.py219CODE
LOWhighway_env/vehicle/objects.py91CODE
LOWhighway_env/vehicle/uncertainty/estimation.py79CODE
LOWhighway_env/vehicle/uncertainty/prediction.py364CODE
LOWhighway_env/road/graphics.py127CODE
LOWhighway_env/road/regulation.py42CODE
LOWhighway_env/road/road.py159CODE
LOWhighway_env/road/road.py483CODE
LOWhighway_env/envs/racetrack_env.py371CODE
LOWhighway_env/envs/racetrack_env.py1336CODE
LOWhighway_env/envs/roundabout_env.py419CODE
LOWhighway_env/envs/roundabout_env.py662CODE
LOWhighway_env/envs/common/observation.py772CODE
LOWhighway_env/envs/common/observation.py354CODE
LOWhighway_env/envs/common/observation.py454CODE
LOWhighway_env/envs/common/observation.py486CODE
LOWhighway_env/envs/common/finite_mdp.py104CODE
Modern Structural Boilerplate8 hits · 8 pts
SeverityFileLineSnippetContext
LOWhighway_env/interval.py237 def update_coordinates_frame(self, a0: np.ndarray) -> None:CODE
LOWhighway_env/interval.py264 def set_control(self, control: np.ndarray, state: np.ndarray = None) -> None:CODE
LOWhighway_env/vehicle/controller.py221 def set_route_at_intersection(self, _to: int) -> None:CODE
LOWhighway_env/vehicle/uncertainty/estimation.py79 def update_possible_routes(self) -> None:CODE
LOWhighway_env/road/road.py15logger = logging.getLogger(__name__)CODE
LOWhighway_env/envs/__init__.py21__all__ = [CODE
LOWhighway_env/envs/common/graphics.py66 def set_agent_display(self, agent_display: Callable) -> None:CODE
LOWhighway_env/envs/common/graphics.py92 def set_agent_action_sequence(self, actions: list[Action]) -> None:CODE
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMscripts/sb3_highway_dqn.py11 # Create the environmentCOMMENT
MEDIUMscripts/sb3_highway_dqn.py15 # Create the modelCOMMENT
AI Structural Patterns5 hits · 5 pts
SeverityFileLineSnippetContext
LOWhighway_env/vehicle/behavior.py374CODE
LOWhighway_env/vehicle/uncertainty/estimation.py41CODE
LOWhighway_env/vehicle/uncertainty/prediction.py42CODE
LOWhighway_env/envs/common/observation.py160CODE
LOWhighway_env/envs/common/observation.py286CODE
Excessive Try-Catch Wrapping2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/envs/test_multiprocessing.py30 except Exception as exc:CODE
LOWhighway_env/__init__.py15except Exception: # nosecCODE
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMscripts/sb3_highway_ppo_transformer.py347 if hasattr(obs_type, "agents_observation_types"): # Handle multi-agent observationCODE
Over-Commented Block1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py1# Configuration file for the Sphinx documentation builder.COMMENT