Repository Analysis

napari/napari

napari: a fast, interactive, multi-dimensional image viewer for python

25.7 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of napari/napari, a Python project with 2,698 GitHub stars. SynthScan v2.0 examined 210,512 lines of code across 1034 source files, recording 3413 pattern matches distributed across 21 syntactic categories. The overall adjusted score of 25.7 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).

25.7
Adjusted Score
25.7
Raw Score
100%
Time Factor
2026-07-14
Last Push
2.7K
Stars
Python
Language
210.5K
Lines of Code
1.0K
Files
3.4K
Pattern Hits
2026-07-14
Scan Date
0.20
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

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

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 105HIGH 102MEDIUM 81LOW 3125

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 3413 distinct pattern matches across 21 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 Identifiers2042 hits · 2072 pts
SeverityFileLineSnippetContext
LOWtools/create_pr_or_update_existing_one.py319def update_external_pr_comment(CODE
LOWtools/validate_strings.py526def test_missing_translations(checks):CODE
LOWtools/validate_strings.py563def test_outdated_string_skips(checks):CODE
LOWtools/check_deps_version.py58def get_specified_min_version(specifier: SpecifierSet) -> Version:CODE
LOWtools/check_deps_version.py142def check_version_for_compatible_wheel(CODE
LOWtools/check_deps_version.py160def find_lowest_version_with_compatible_wheel(CODE
LOWtools/remove_html_comments_from_pr.py23def edit_pull_request_description(repo, pull_request_number, access_token):CODE
LOWexamples/theme_sample.py248 def _build_theme_selector_group(self) -> QGroupBox:STRING
LOWexamples/boids_simulation.py124 def compute_flock_step_forward(CODE
LOWexamples/boids_simulation.py194def iterate_accelerated_flock_forever(boids, num_workers=8):CODE
LOWexamples/interactive_move_rectangle_3d.py44def move_rectangle_along_normal(layer, event):STRING
LOWexamples/custom_mouse_functions.py33def get_connected_component_shape(layer, event):CODE
LOWexamples/custom_mouse_functions.py76def on_second_click_of_double_click(layer, event):CODE
LOWexamples/bbox_annotator.py57 def set_selected_features_to_default():CODE
LOWexamples/multithreading_two_way_.py23def two_way_communication_with_args(start, end):CODE
LOWexamples/dev/triangle_edge.py64def get_reference_edge_triangulation_points(shape: Shapes) -> np.ndarray:CODE
LOWexamples/dev/triangle_edge.py108def generate_miter_helper_vectors(CODE
LOWexamples/dev/triangle_edge.py140def generate_orthogonal_vectors(direction_vectors: np.ndarray) -> np.ndarray:CODE
LOWexamples/dev/triangle_edge.py197def generate_edge_triangle_borders(centers, offsets, triangles) -> np.ndarray:CODE
LOWexamples/dev/triangle_edge.py231def generate_face_triangle_borders(vertices, triangles) -> np.ndarray:CODE
LOWexamples/dev/triangle_edge.py268def get_helper_data_from_shapes(shapes_layer: Shapes) -> Helpers:CODE
LOWexamples/dev/controllable_overlay.py181def highlight_roi_box_handles(layer: Image, event: NapariMouseEvent) -> None:CODE
LOWsrc/napari_builtins/_measure_shapes.py67def update_features_with_measures(shapes_layer, event=None):CODE
LOWsrc/napari_builtins/_tests/test_writer.py50def test_no_write_layer_bad_extension(some_layer: 'layers.Layer'):CODE
LOWsrc/napari_builtins/_tests/test_io.py96def test_zarr_with_unrelated_file(tmp_path):CODE
LOWsrc/napari_builtins/_tests/test_io.py169def test_guess_layer_type_from_column_names():CODE
LOWsrc/napari_builtins/_tests/test_io.py214def test_csv_to_layer_data_raises(tmp_path):CODE
LOWsrc/napari_builtins/_tests/test_io.py368def test_github_and_gitlab_to_raw_url(url, expected):CODE
LOWsrc/napari_builtins/_tests/test_io.py372def test_read_zarr_non_existent_path_raises(tmp_path):CODE
LOWsrc/napari_builtins/_tests/test_io.py378def test_read_zarr_remote_group_raises(tmp_path, monkeypatch):CODE
LOWsrc/napari_builtins/_tests/test_io.py393def test_read_zarr_remote_array_succeeds(tmp_path, monkeypatch):CODE
LOWsrc/napari_builtins/_tests/test_io.py408def test_zarr_multiple_groups_reads_first(tmp_path, monkeypatch):CODE
LOWsrc/napari_builtins/_tests/test_read.py96def test_read_python_source_uses_python_source_encoding(CODE
LOWsrc/napari_builtins/io/_read.py43def _git_provider_url_to_raw_url(filename: str) -> str:CODE
LOWsrc/napari_builtins/io/_read.py421def _guess_layer_type_from_column_names(CODE
LOWsrc/napari_builtins/io/_read.py603def load_and_execute_python_code(script_path: str) -> list[LayerData]:CODE
LOWsrc/napari_builtins/io/_write.py270def write_layer_data_with_plugins(CODE
LOWsrc/napari_builtins/_qt/features_table.py383 def _get_cell_value_and_dtype(CODE
LOWsrc/napari_builtins/_qt/features_table.py814 def _get_selection_event_for_layer(layer):CODE
LOWsrc/napari_builtins/_qt/features_table.py844 def _on_layer_selection_change(self):CODE
LOWsrc/napari_builtins/_qt/features_table.py909 def _build_multilayer_features_table(CODE
LOWsrc/napari_builtins/_qt/features_table.py961 def _get_original_categories_from_layers(CODE
LOWsrc/napari_builtins/_qt/features_table.py993 def _on_table_selection_changed(self):CODE
LOWsrc/napari_builtins/_qt/features_table.py1052 def _update_table_selected_cells(self):CODE
LOWsrc/napari_builtins/_qt/_tests/test_qt_read.py26 def test_load_and_execute_python_code_uses_python_source_encoding(CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py49def test_pandas_model_set_data(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py74def test_pandas_model_set_data_categorical(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py162def test_features_table_selection_labels(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py178def test_features_table_selection_shapes(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py224def test_features_table_save_csv(qtbot, tmp_path, monkeypatch):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py242def test_features_table_copy_paste(qtbot, qapp):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py305def test_features_tables_dtypes(CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py354def test_features_table_change_active_layer(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py393def _add_all_supported_layers(viewer, include=None):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py444def test_features_table_multilayer_table_concat(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py478def test_features_table_multilayer_layer_selection_change(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py516def test_features_table_multilayer_table_selection(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py569def test_features_table_multilayer_edit(qtbot):CODE
LOWsrc/napari_builtins/_qt/_tests/test_features_table.py606def test_features_table_multilayer_save_csv(qtbot, tmp_path, monkeypatch):CODE
LOWsrc/napari/conftest.py197 def pytest_exception_interact(call):CODE
1982 more matches not shown…
Hallucination Indicators105 hits · 1470 pts
SeverityFileLineSnippetContext
CRITICALexamples/multiple_viewer_widget.py151 self.viewer.dims.events.order.connect(self.update_cross)CODE
CRITICALexamples/multiple_viewer_widget.py152 self.viewer.dims.events.ndim.connect(self._update_ndim)CODE
CRITICALexamples/multiple_viewer_widget.py153 self.viewer.dims.events.current_step.connect(self.update_cross)CODE
CRITICALexamples/multiple_viewer_widget.py251 self.viewer.layers.events.inserted.connect(self._layer_added)CODE
CRITICALexamples/multiple_viewer_widget.py252 self.viewer.layers.events.removed.connect(self._layer_removed)CODE
CRITICALexamples/multiple_viewer_widget.py253 self.viewer.layers.events.moved.connect(self._layer_moved)CODE
CRITICALexamples/multiple_viewer_widget.py254 self.viewer.layers.selection.events.active.connect(CODE
CRITICALexamples/multiple_viewer_widget.py257 self.viewer.dims.events.current_step.connect(self._point_update)CODE
CRITICALexamples/multiple_viewer_widget.py258 self.viewer_model1.dims.events.current_step.connect(self._point_update)CODE
CRITICALexamples/multiple_viewer_widget.py259 self.viewer_model2.dims.events.current_step.connect(self._point_update)CODE
CRITICALexamples/multiple_viewer_widget.py260 self.viewer.dims.events.order.connect(self._order_update)CODE
CRITICALexamples/viewer_fps_label.py24viewer.window._qt_viewer.canvas._scene_canvas.measure_fps(callback=update_fps)CODE
CRITICALsrc/napari_builtins/_qt/features_table.py755 self.viewer.layers.selection.events.changed.connect(CODE
CRITICALsrc/napari_builtins/_qt/features_table.py758 self.viewer.layers.events.renamed.connect(self._on_layer_renamed)CODE
CRITICALsrc/napari/layers/labels/labels.py2157 value = self._slice.image.raw.dtype.type(value)CODE
CRITICALsrc/napari/_tests/test_multiple_viewers.py12 v1.window._qt_viewer.viewerButtons.gridViewButton.click()CODE
CRITICALsrc/napari/_vispy/canvas.py260 self.viewer.cursor.events.style.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py261 self.viewer.cursor.events.size.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py269 self.viewer.camera.events.mouse_pan.connect(self._on_interactive)CODE
CRITICALsrc/napari/_vispy/canvas.py270 self.viewer.camera.events.mouse_zoom.connect(self._on_interactive)CODE
CRITICALsrc/napari/_vispy/canvas.py271 self.viewer.camera.events.zoom.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py273 self.viewer._zoom_box.events.zoom_area.connect(self._on_boxzoom)CODE
CRITICALsrc/napari/_vispy/canvas.py274 self.viewer.layers.events.reordered.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py275 self.viewer.layers.events.removed.connect(self._remove_layer)CODE
CRITICALsrc/napari/_vispy/canvas.py276 self.viewer.layers.events.begin_batch.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py279 self.viewer.layers.events.end_batch.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py282 self.viewer.layers.events.units.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py285 self.viewer.grid.events.stride.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py286 self.viewer.grid.events.shape.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py287 self.viewer.grid.events.enabled.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py288 self.viewer.grid.events.spacing.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py289 self.viewer._overlays.events.added.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py292 self.viewer._overlays.events.removed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py295 self.viewer._overlays.events.changed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py808 self.viewer.camera.events.angles.connect(vispy_layer._on_camera_move)CODE
CRITICALsrc/napari/_vispy/layers/points.py34 self.layer._border.events.colors.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/layers/points.py35 self.layer._border.events.color_properties.connect(CODE
CRITICALsrc/napari/_vispy/layers/points.py39 self.layer._face.events.colors.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/layers/points.py40 self.layer._face.events.color_properties.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/layers/scalar_field.py63 self.layer.plane.events.position.connect(CODE
CRITICALsrc/napari/_vispy/layers/scalar_field.py66 self.layer.plane.events.thickness.connect(CODE
CRITICALsrc/napari/_vispy/layers/scalar_field.py69 self.layer.plane.events.normal.connect(self._on_plane_normal_change)CODE
CRITICALsrc/napari/_vispy/layers/surface.py36 self.layer.wireframe.events.visible.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py39 self.layer.wireframe.events.width.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py42 self.layer.wireframe.events.color.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py45 self.layer.normals.face.events.connect(self._on_face_normals_change)CODE
CRITICALsrc/napari/_vispy/layers/surface.py46 self.layer.normals.vertex.events.connect(CODE
CRITICALsrc/napari/_vispy/_tests/test_utils.py57 viewer.window._qt_viewer.canvas.cursor.shape()CODE
CRITICALsrc/napari/_vispy/_tests/test_utils.py63 viewer.window._qt_viewer.canvas.cursor.shape()CODE
CRITICAL…ari/_vispy/_tests/test_vispy_labels_polygon_overlay.py183 ) in viewer.window._qt_viewer.canvas._layer_overlay_to_visual.get(CODE
CRITICALsrc/napari/_vispy/overlays/brush_circle.py49 self.node.parent.scene.canvas.events.mouse_move.connect(CODE
CRITICALsrc/napari/_vispy/overlays/scale_bar.py50 self.viewer.camera.events.zoom.connect(self._on_size_or_zoom_change)CODE
CRITICALsrc/napari/_vispy/overlays/scale_bar.py52 self.viewer.dims.events.order.connect(self._on_unit_change)CODE
CRITICALsrc/napari/_vispy/overlays/scale_bar.py53 self.viewer.dims.events.ndisplay.connect(self._on_unit_change)CODE
CRITICALsrc/napari/_vispy/overlays/axes.py44 self.viewer.camera.events.zoom.connect(self._on_zoom_change)CODE
CRITICALsrc/napari/_vispy/overlays/axes.py45 self.viewer.dims.events.order.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/overlays/axes.py46 self.viewer.dims.events.range.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/overlays/axes.py47 self.viewer.dims.events.ndisplay.connect(self._on_data_change)CODE
CRITICALsrc/napari/_vispy/overlays/axes.py48 self.viewer.dims.events.axis_labels.connect(CODE
CRITICALsrc/napari/_vispy/overlays/floating_axes.py56 self.viewer.dims.events.order.connect(self._on_data_change)CODE
45 more matches not shown…
Unused Imports484 hits · 481 pts
SeverityFileLineSnippetContext
LOWtools/validate_strings.py32CODE
LOWtools/validate_strings.py43CODE
LOWtools/check_updated_packages.py1CODE
LOWexamples/theme_sample.py15CODE
LOWexamples/boids_simulation.py25CODE
LOWexamples/mgui_dask_delayed_.py10CODE
LOWexamples/dev/controllable_overlay.py22CODE
LOWsrc/napari_builtins/_tests/test_writer.py11CODE
LOWsrc/napari_builtins/_tests/test_io.py27CODE
LOWsrc/napari_builtins/_tests/test_read.py15CODE
LOWsrc/napari_builtins/_tests/test_read.py16CODE
LOWsrc/napari_builtins/io/_read.py1CODE
LOWsrc/napari_builtins/io/_write.py13CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py1CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/io/__init__.py10CODE
LOWsrc/napari_builtins/_qt/features_table.py1CODE
LOWsrc/napari/conftest.py32CODE
LOWsrc/napari/viewer.py13CODE
LOWsrc/napari/window.py14CODE
LOWsrc/napari/types.py25CODE
LOWsrc/napari/types.py26CODE
LOWsrc/napari/types.py27CODE
LOWsrc/napari/types.py28CODE
LOWsrc/napari/_event_loop.py2CODE
LOWsrc/napari/settings/_base.py1CODE
LOWsrc/napari/settings/__init__.py5CODE
LOWsrc/napari/settings/_yaml.py1CODE
LOWsrc/napari/settings/_shortcuts.py1CODE
LOWsrc/napari/settings/_application.py1CODE
LOWsrc/napari/settings/_migrations.py1CODE
LOWsrc/napari/experimental/__init__.py1CODE
LOWsrc/napari/experimental/__init__.py1CODE
LOWsrc/napari/experimental/__init__.py1CODE
LOWsrc/napari/layers/_source.py1CODE
LOWsrc/napari/layers/intensity_mixin.py14CODE
LOWsrc/napari/layers/intensity_mixin.py15CODE
LOWsrc/napari/layers/__init__.py10CODE
LOWsrc/napari/layers/__init__.py11CODE
LOWsrc/napari/layers/__init__.py12CODE
LOWsrc/napari/layers/__init__.py13CODE
LOWsrc/napari/layers/__init__.py14CODE
LOWsrc/napari/layers/__init__.py15CODE
LOWsrc/napari/layers/__init__.py16CODE
LOWsrc/napari/layers/__init__.py17CODE
LOWsrc/napari/layers/_layer_actions.py6CODE
LOWsrc/napari/layers/_multiscale_data.py1CODE
LOWsrc/napari/layers/labels/labels.py1CODE
LOWsrc/napari/layers/labels/__init__.py2CODE
424 more matches not shown…
Cross-File Repetition70 hits · 350 pts
SeverityFileLineSnippetContext
HIGHsrc/napari/layers/labels/labels.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/tracks/tracks.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/tracks/_track_utils.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/surface/surface.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/shapes/shapes.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/vectors/vectors.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/points/points.py0dataframe-like features table. it is an implementation detail that this is a `pandas.dataframe`. in the future, we will STRING
HIGHsrc/napari/layers/labels/labels.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/tracks/tracks.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/surface/surface.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/shapes/shapes.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/vectors/vectors.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/image/image.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/points/points.py0get dictionary of layer state. returns ------- state : dict of str to any dictionary of layer state.STRING
HIGHsrc/napari/layers/labels/labels.py0tooltip message of the data at a coordinate position. parameters ---------- position : ndarray position in either data oSTRING
HIGHsrc/napari/layers/points/points.py0tooltip message of the data at a coordinate position. parameters ---------- position : ndarray position in either data oSTRING
HIGHsrc/napari/layers/base/base.py0tooltip message of the data at a coordinate position. parameters ---------- position : ndarray position in either data oSTRING
HIGHsrc/napari/layers/labels/_tests/test_labels.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/shapes/_tests/test_shapes.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/vectors/_tests/test_vectors.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/image/_tests/test_volume.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/image/_tests/test_image.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/image/_tests/test_multiscale.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/points/_tests/test_points.py0test getting the value of the rgb data at the current coordinates.STRING
HIGHsrc/napari/layers/tracks/tracks.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/surface/surface.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/shapes/shapes.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/vectors/vectors.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/points/points.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/_scalar_field/scalar_field.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/base/base.py0extent of layer in data coordinates. returns ------- extent_data : array, shape (2, d)STRING
HIGHsrc/napari/layers/surface/surface.py0dataframe-like with one row of feature default values. see `features` for more details on the type of this property.STRING
HIGHsrc/napari/layers/shapes/shapes.py0dataframe-like with one row of feature default values. see `features` for more details on the type of this property.STRING
HIGHsrc/napari/layers/vectors/vectors.py0dataframe-like with one row of feature default values. see `features` for more details on the type of this property.STRING
HIGHsrc/napari/layers/points/points.py0dataframe-like with one row of feature default values. see `features` for more details on the type of this property.STRING
HIGHsrc/napari/layers/shapes/shapes.py0return the colormap to be applied to a property to get the border color. returns ------- colormap : napari.utils.colormaSTRING
HIGHsrc/napari/layers/vectors/vectors.py0return the colormap to be applied to a property to get the border color. returns ------- colormap : napari.utils.colormaSTRING
HIGHsrc/napari/layers/points/points.py0return the colormap to be applied to a property to get the border color. returns ------- colormap : napari.utils.colormaSTRING
HIGHsrc/napari/layers/shapes/shapes.py0none, (float, float): contrast limits for mapping the border_color colormap property to 0 and 1STRING
HIGHsrc/napari/layers/vectors/vectors.py0none, (float, float): contrast limits for mapping the border_color colormap property to 0 and 1STRING
HIGHsrc/napari/layers/points/points.py0none, (float, float): contrast limits for mapping the border_color colormap property to 0 and 1STRING
HIGHsrc/napari/layers/shapes/shapes.py0str: face color setting mode direct (default mode) allows each point to be set arbitrarily cycle allows the color to be STRING
HIGHsrc/napari/layers/vectors/vectors.py0str: face color setting mode direct (default mode) allows each point to be set arbitrarily cycle allows the color to be STRING
HIGHsrc/napari/layers/points/points.py0str: face color setting mode direct (default mode) allows each point to be set arbitrarily cycle allows the color to be STRING
HIGHsrc/napari/layers/shapes/shapes.py0calculate and update face and border colors if using a cycle or color map parameters ---------- update_color_mapping : bSTRING
HIGHsrc/napari/layers/utils/color_manager.py0calculate and update face and border colors if using a cycle or color map parameters ---------- update_color_mapping : bSTRING
HIGHsrc/napari/layers/vectors/vectors.py0calculate and update face and border colors if using a cycle or color map parameters ---------- update_color_mapping : bSTRING
HIGHsrc/napari/layers/points/points.py0calculate and update face and border colors if using a cycle or color map parameters ---------- update_color_mapping : bSTRING
HIGHsrc/napari/layers/shapes/shapes.py0get the colors of the text elements at the given indices.STRING
HIGHsrc/napari/layers/utils/text_manager.py0get the colors of the text elements at the given indices.STRING
HIGHsrc/napari/layers/points/points.py0get the colors of the text elements at the given indices.STRING
HIGHsrc/napari/layers/shapes/_shapes_constants.py0colormode: color setting mode. direct (default mode) allows each point to be set arbitrarily cycle allows the color to bSTRING
HIGHsrc/napari/layers/utils/_color_manager_constants.py0colormode: color setting mode. direct (default mode) allows each point to be set arbitrarily cycle allows the color to bSTRING
HIGHsrc/napari/layers/points/_points_constants.py0colormode: color setting mode. direct (default mode) allows each point to be set arbitrarily cycle allows the color to bSTRING
HIGHsrc/napari/layers/shapes/_tests/test_shapes.py0helper function to make property values parameters ---------- values the values to be cycled. length : int the length ofSTRING
HIGHsrc/napari/layers/utils/_tests/test_color_manager.py0helper function to make property values parameters ---------- values the values to be cycled. length : int the length ofSTRING
HIGHsrc/napari/layers/points/_tests/test_points.py0helper function to make property values parameters ---------- values the values to be cycled. length : int the length ofSTRING
HIGHsrc/napari/layers/shapes/_tests/test_shapes.py0see the following for the issues this covers: https://github.com/napari/napari/issues/5632 https://github.com/napari/napSTRING
HIGHsrc/napari/layers/vectors/_tests/test_vectors.py0see the following for the issues this covers: https://github.com/napari/napari/issues/5632 https://github.com/napari/napSTRING
HIGHsrc/napari/layers/points/_tests/test_points.py0see the following for the issues this covers: https://github.com/napari/napari/issues/5632 https://github.com/napari/napSTRING
10 more matches not shown…
Over-Commented Block237 hits · 194 pts
SeverityFileLineSnippetContext
LOWtox.ini1# Tox (http://tox.testrun.org/) is a tool for running testsCOMMENT
LOWresources/requirements_mypy.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWresources/requirements_mypy.txt41 # buildCOMMENT
LOWresources/requirements_mypy.txt61 # via pydanticCOMMENT
LOWresources/requirements_mypy.txt81 # magicguiCOMMENT
LOWresources/requirements_mypy.txt101types-setuptools==83.0.0.20260706COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt21 # aiohttpCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt41 # via requestsCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt61 # via cuda-bindingsCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt81 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt101 # via matplotlibCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt121google-crc32c==1.8.0COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt141imageio==2.37.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt161 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt181 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt201 # distributedCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt221 # glasbeyCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt241 # via napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt261npe2==0.8.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt281 # edtCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt301 # scikit-learnCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt321nvidia-cuda-runtime==13.0.96COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt341nvidia-nvjitlink==13.0.88COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt361 # nibabelCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt381 # via daskCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt401 # napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt421 # via ipythonCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt441pure-eval==0.2.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt461pydantic-settings==2.14.2COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt481 # via napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt501 # pytest-json-reportCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt521python-discovery==1.4.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt541qtpy==2.4.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt561rich==15.0.0COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt581 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt601 # hypothesisCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt621 # via scikit-learnCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt641 # via trackastraCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt661 # qtconsoleCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt681 # numcodecsCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt701 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt721 # geffCOMMENT
LOWresources/constraints/constraints_py3.14.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWresources/constraints/constraints_py3.14.txt21 # referencingCOMMENT
LOWresources/constraints/constraints_py3.14.txt61 # via virtualenvCOMMENT
LOWresources/constraints/constraints_py3.14.txt81freetype-py==2.5.1COMMENT
LOWresources/constraints/constraints_py3.14.txt101 # viaCOMMENT
LOWresources/constraints/constraints_py3.14.txt121 # ipykernelCOMMENT
LOWresources/constraints/constraints_py3.14.txt141 # ipykernelCOMMENT
LOWresources/constraints/constraints_py3.14.txt161 # via lxmlCOMMENT
LOWresources/constraints/constraints_py3.14.txt181 # viaCOMMENT
LOWresources/constraints/constraints_py3.14.txt201 # viaCOMMENT
LOWresources/constraints/constraints_py3.14.txt221 # pandasCOMMENT
LOWresources/constraints/constraints_py3.14.txt241nvidia-cuda-runtime==13.0.96COMMENT
LOWresources/constraints/constraints_py3.14.txt261nvidia-nvjitlink==13.0.88COMMENT
LOWresources/constraints/constraints_py3.14.txt281 # pytest-rerunfailuresCOMMENT
LOWresources/constraints/constraints_py3.14.txt301 # viaCOMMENT
LOWresources/constraints/constraints_py3.14.txt321pluggy==1.6.0COMMENT
LOWresources/constraints/constraints_py3.14.txt341 # ipythonCOMMENT
177 more matches not shown…
Cross-Language Confusion29 hits · 190 pts
SeverityFileLineSnippetContext
HIGHsrc/napari/viewer.py121 self.window._qt_viewer.console.push(variables)CODE
HIGHsrc/napari/layers/labels/_tests/test_labels.py2291 with more colors is undefined, so we don't test it here.CODE
HIGHsrc/napari/layers/vectors/vectors.py547 self.events.length()CODE
HIGHsrc/napari/_vispy/visuals/volume.py113 if (u_clamp_at_border || (prev_loc[i] >= 0.0 && prev_loc[i] <= 1.0)) {CODE
HIGHsrc/napari/_vispy/visuals/volume.py120 if (u_clamp_at_border || (next_loc[i] >= 0.0 && next_loc[i] <= 1.0)) {CODE
HIGHsrc/napari/_vispy/visuals/volume.py168 if (is_on_border && (i != 0 && j != 0 && k != 0)) {CODE
HIGHsrc/napari/_vispy/visuals/volume.py176 if (is_in_bounds || u_clamp_at_border) {CODE
HIGHsrc/napari/_vispy/visuals/volume.py183 (1 + float(j == 0 || k == 0) + 2 * float(j == 0 && k == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py183 (1 + float(j == 0 || k == 0) + 2 * float(j == 0 && k == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py185 (1 + float(i == 0 || k == 0) + 2 * float(i == 0 && k == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py185 (1 + float(i == 0 || k == 0) + 2 * float(i == 0 && k == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py187 (1 + float(i == 0 || j == 0) + 2 * float(i == 0 && j == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py187 (1 + float(i == 0 || j == 0) + 2 * float(i == 0 && j == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py189 next.x += int(i == 1 && j == 0 && k == 0) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py190 next.y += int(i == 0 && j == 1 && k == 0) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py191 next.z += int(i == 0 && j == 0 && k == 1) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py192 prev.x += int(i == -1 && j == 0 && k == 0) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py193 prev.y += int(i == 0 && j == -1 && k == 0) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py194 prev.z += int(i == 0 && j == 0 && k == -1) * val;CODE
HIGHsrc/napari/_vispy/visuals/volume.py196 is_on_border = is_on_border || (!is_in_bounds && (i == 0 || j == 0 || k == 0));CODE
HIGHsrc/napari/_vispy/visuals/volume.py201 if (is_on_border && u_clamp_at_border) {CODE
HIGHsrc/napari/utils/misc.py425 return df1.equals(df2)CODE
HIGHsrc/napari/utils/io.py283 console.push(variables)CODE
HIGHsrc/napari/utils/events/evented_model.py457 before = self.model_config.get('use_enum_values', null)CODE
HIGHsrc/napari/components/_layer_slicer.py325 Attempt to remove task, return false if task not found, return trueSTRING
HIGHsrc/napari/_qt/qt_viewer.py523 console.push(CODE
HIGHsrc/napari/_qt/qt_viewer.py528 console.push({'np': np})CODE
HIGHsrc/napari/_qt/qt_viewer.py531 console.push(CODE
HIGHsrc/napari/_qt/qt_viewer.py1286 filenames.append(url.toString())CODE
Modern Structural Boilerplate167 hits · 170 pts
SeverityFileLineSnippetContext
LOWexamples/theme_sample.py154 def set_color(self, color: str) -> None:STRING
LOWexamples/theme_sample.py181 def set_color(self, color: str) -> None:STRING
LOWsrc/napari_builtins/io/__init__.py20__all__ = [CODE
LOWsrc/napari/window.py9__all__ = ['Window']CODE
LOWsrc/napari/view_layers.py13__all__ = ['imshow']CODE
LOWsrc/napari/types.py31__all__ = [CODE
LOWsrc/napari/settings/__init__.py11__all__ = ['CURRENT_SCHEMA_VERSION', 'NapariSettings', 'get_settings']CODE
LOWsrc/napari/settings/_experimental.py128def _update_triangulation_backend(event: Event) -> None:CODE
LOWsrc/napari/settings/_experimental.py134def _update_colormap_backend(event: Event) -> None:CODE
LOWsrc/napari/experimental/__init__.py7__all__ = [CODE
LOWsrc/napari/layers/__init__.py27__all__ = [CODE
LOWsrc/napari/layers/labels/__init__.py10__all__ = ['Labels']CODE
LOWsrc/napari/layers/tracks/tracks.py277 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/tracks/tracks.py300 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/tracks/tracks.py695 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/tracks/__init__.py3__all__ = ['Tracks']CODE
LOWsrc/napari/layers/surface/__init__.py3__all__ = ['Surface']CODE
LOWsrc/napari/layers/surface/surface.py644 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/shapes/shapes.py2681 def _set_highlight(self, force=False) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py758 def _update_displayed(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py1149 def _update_vertices(self, index: int) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py1176 def _update_mesh_triangles(self, index: int) -> None:CODE
LOWsrc/napari/layers/shapes/__init__.py10__all__ = ['Shapes']CODE
LOW…ari/layers/shapes/_accelerated_triangulate_dispatch.py83def _set_numba(value: bool) -> None:CODE
LOW…ari/layers/shapes/_accelerated_triangulate_dispatch.py106def _set_warmup(value: bool) -> None:CODE
LOW…c/napari/layers/shapes/_shapes_models/_polygon_base.py95 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/line.py74 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/__init__.py8__all__ = ['Ellipse', 'Line', 'Path', 'Polygon', 'Rectangle', 'Shape']CODE
LOWsrc/napari/layers/shapes/_shapes_models/rectangle.py80 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py209 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py310 def _set_empty_edge(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py315 def _set_empty_face(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/ellipse.py88 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/utils/layer_utils.py830 def set_values(self, values, *, num_data=None) -> None:CODE
LOWsrc/napari/layers/utils/layer_utils.py840 def set_defaults(self, defaults: dict[str, Any] | pd.DataFrame) -> None:CODE
LOWsrc/napari/layers/utils/stack_utils.py19logger = logging.getLogger(__name__)CODE
LOWsrc/napari/layers/vectors/__init__.py3__all__ = ['Vectors']CODE
LOWsrc/napari/layers/image/__init__.py10__all__ = ['Image']CODE
LOWsrc/napari/layers/image/_image_mouse_bindings.py91def set_plane_position(layer: Image, event: Event) -> None:CODE
LOWsrc/napari/layers/image/image.py512 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/points/_points_mouse_bindings.py184def _update_drag_vectors_from_event(layer: Points, event: Event) -> None:CODE
LOWsrc/napari/layers/points/points.py623 def _set_data(self, data: np.ndarray | None) -> None:CODE
LOWsrc/napari/layers/points/points.py1861 def _set_highlight(self, force: bool = False) -> None:CODE
LOWsrc/napari/layers/points/points.py1928 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/points/points.py2490 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/points/points.py2522 def _update_slice_response(self, response: _PointSliceResponse) -> None:CODE
LOWsrc/napari/layers/points/__init__.py10__all__ = ['Points']CODE
LOWsrc/napari/layers/base/_test_util_sample_layer.py13 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/base/_test_util_sample_layer.py91 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/base/_test_util_sample_layer.py94 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/base/__init__.py4__all__ = ['ActionType', 'Layer', 'LayerLock', '_LayerSlicingState', 'no_op']CODE
LOWsrc/napari/layers/base/base.py307 def _set_loaded(self, loaded: bool) -> None:CODE
LOWsrc/napari/layers/base/base.py313 def _set_unloaded_slice_id(self, slice_id: int) -> None:CODE
LOWsrc/napari/layers/base/base.py322 def _update_loaded_slice_id(self, slice_id: int) -> None:CODE
LOWsrc/napari/layers/base/base.py139 def set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/base/base.py881 def _set_source(self, source: Source) -> None:CODE
LOWsrc/napari/layers/base/base.py1135 def _update_dims(self) -> None:CODE
LOWsrc/napari/layers/base/base.py1447 def set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/base/base.py1675 def _set_highlight(self, force: bool = False) -> None:CODE
LOWsrc/napari/resources/__init__.py9__all__ = [CODE
107 more matches not shown…
Self-Referential Comments42 hits · 134 pts
SeverityFileLineSnippetContext
MEDIUMexamples/surface_multi_texture.py106# Create the napari layersCOMMENT
MEDIUMexamples/bbox_annotator.py43 # Create the label selection menuCOMMENT
MEDIUMexamples/affine_coffee_cup.py39# Define an original affine transformation to be position of surface upon being loaded into viewerCOMMENT
MEDIUMexamples/affine_coffee_cup.py59 # Define a new affine transform for the creamer surface, where it is moved up and at an angle to be 'poured' into thCOMMENT
MEDIUMexamples/screenshot_and_export_figure.py25# Create a napari viewer with multiple layer types and add a scale bar.COMMENT
MEDIUMexamples/mouse_drag_image_warping.py40# Define a function to estimate the warping required to transform the destination pointsCOMMENT
MEDIUMexamples/image_border.py23# Create a napari viewer with a 3D, 2 channel image, with the `add_image` convenience function.COMMENT
MEDIUMexamples/affine_transforms.py14# Create a random imageCOMMENT
MEDIUMexamples/affine_transforms.py17# Define an affine transformCOMMENT
MEDIUMexamples/affine_transforms.py20# Define the corners of the image, including in homogeneous spaceCOMMENT
MEDIUMexamples/export_rois.py22# Create a napari viewer with multiple layer types and add a scale bar.COMMENT
MEDIUMexamples/dev/triangle_edge.py29 # Create a dummy numba.njit to allow running this script without numbaCOMMENT
MEDIUMexamples/dev/slicing/random_shapes.py63# Create the example shapes if they do not existCOMMENT
MEDIUMsrc/napari_builtins/io/_write.py56 # The above method generates a lot of extensions that will fail. This listCOMMENT
MEDIUMsrc/napari/layers/_tests/test_layer_actions.py387 # Create a label based on the shape.COMMENT
MEDIUMsrc/napari/layers/labels/labels.py1354 # Create the slice to extract the full working volume/planeCOMMENT
MEDIUM…apari/layers/shapes/_accelerated_triangulate_python.py281 # Create an adjacency list representation from the edgesCOMMENT
MEDIUM…napari/layers/shapes/_accelerated_triangulate_numba.py826 # Create a list (indexed by vertex) containing lists of incident edge indices.COMMENT
MEDIUMsrc/napari/layers/shapes/_tests/test_shapes.py2418 # Create a layer with the first shapeCOMMENT
MEDIUMsrc/napari/layers/utils/text_manager.py359 # Create a new instance from the input to populate all fields.COMMENT
MEDIUMsrc/napari/layers/utils/style_encoding.py114# The following classes provide generic implementations of common waysCOMMENT
MEDIUMsrc/napari/layers/points/points.py2322 # Define a minimal set of coordinates where the mask could be presentCOMMENT
MEDIUMsrc/napari/layers/base/base.py600 # Create a transform chain consisting of four transforms:COMMENT
MEDIUMsrc/napari/_tests/test_function_widgets.py12 # Define a function.COMMENT
MEDIUM…ari/_vispy/_tests/test_vispy_labels_polygon_overlay.py164 # Create a labels layer that will be downsampledCOMMENT
MEDIUMsrc/napari/utils/stubgen.py1"""This module provides helper functions for autogenerating type stubs.STRING
MEDIUMsrc/napari/utils/colormaps/colormap_utils.py243# The following code can be used to reproduce these values.COMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py504 # Create a DirectLabelColormap with an empty color_dictCOMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py510 # Create a DirectLabelColormap with a simple color_dictCOMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py437 # Create a DirectLabelColormap with a simple color_dictCOMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py455 # Create a DirectLabelColormap with a simple color_dict and a selectionCOMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py475 # Create a DirectLabelColormap with a simple color_dictCOMMENT
MEDIUMsrc/napari/utils/colormaps/_tests/test_colormap.py543 # Create a DirectLabelColormap with a simple color_dictCOMMENT
MEDIUMsrc/napari/components/experimental/monitor/_monitor.py178 # Create the API first. It will register our callbacks, thenCOMMENT
MEDIUMsrc/napari/_qt/qt_main_window.py789 """This function is only executed once at the startup of napariSTRING
MEDIUMsrc/napari/_qt/qt_viewer.py212 # Create the experimental QtPool for the monitor.COMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py215 # Create the experimental RemoteManager for the monitor.COMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py1519 # Create the remote manager and have monitor call its process_command()COMMENT
MEDIUMsrc/napari/_qt/_qapp_model/_tests/test_qproviders.py35 # Create a viewerCOMMENT
MEDIUMsrc/napari/_qt/_tests/test_qt_viewer.py292 # Create an image with a defined shape (100x100) and a square in the middleCOMMENT
MEDIUMsrc/napari/_qt/_tests/test_qt_viewer.py300 # Create a couple of clearly defined rectangular polygons for validationCOMMENT
MEDIUMsrc/napari/_qt/threads/status_checker.py53 # Create a Signal to establish a lightweight communication mechanism between theCOMMENT
Deep Nesting91 hits · 88 pts
SeverityFileLineSnippetContext
LOWtools/validate_strings.py269CODE
LOWtools/validate_strings.py344CODE
LOWtools/validate_strings.py435CODE
LOWtools/check_deps_version.py75CODE
LOWsrc/napari_builtins/_measure_shapes.py67CODE
LOWsrc/napari_builtins/io/_read.py223CODE
LOWsrc/napari_builtins/io/_read.py341CODE
LOWsrc/napari_builtins/_qt/features_table.py128CODE
LOWsrc/napari_builtins/_qt/features_table.py675CODE
LOWsrc/napari_builtins/_qt/features_table.py909CODE
LOWsrc/napari_builtins/_qt/features_table.py961CODE
LOWsrc/napari_builtins/_qt/features_table.py993CODE
LOWsrc/napari_builtins/_qt/features_table.py1052CODE
LOWsrc/napari/conftest.py654CODE
LOWsrc/napari/_main.py49CODE
LOWsrc/napari/_pydantic_util.py26CODE
LOWsrc/napari/__main__.py211CODE
LOWsrc/napari/settings/_base.py511CODE
LOWsrc/napari/settings/_fields.py171CODE
LOWsrc/napari/settings/_migrations.py29CODE
LOWsrc/napari/settings/_migrations.py141CODE
LOWsrc/napari/layers/_tests/test_layer_attributes.py71CODE
LOWsrc/napari/layers/shapes/shapes.py1127CODE
LOWsrc/napari/layers/shapes/shapes.py1466CODE
LOWsrc/napari/layers/shapes/shapes.py2455CODE
LOWsrc/napari/layers/shapes/shapes.py2543CODE
LOWsrc/napari/layers/shapes/shapes.py2590CODE
LOWsrc/napari/layers/shapes/shapes.py2704CODE
LOWsrc/napari/layers/shapes/shapes.py2815CODE
LOWsrc/napari/layers/shapes/shapes.py2991CODE
LOW…apari/layers/shapes/_accelerated_triangulate_python.py263CODE
LOWsrc/napari/layers/shapes/_shapes_mouse_bindings.py58CODE
LOWsrc/napari/layers/shapes/_shapes_mouse_bindings.py683CODE
LOWsrc/napari/layers/shapes/_shapes_mouse_bindings.py812CODE
LOWsrc/napari/layers/shapes/_shapes_mouse_bindings.py905CODE
LOW…napari/layers/shapes/_accelerated_triangulate_numba.py399CODE
LOW…napari/layers/shapes/_accelerated_triangulate_numba.py793CODE
LOW…ari/layers/shapes/_tests/test_shapes_mouse_bindings.py1227CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py788CODE
LOWsrc/napari/layers/utils/layer_utils.py646CODE
LOWsrc/napari/layers/utils/color_manager.py76CODE
LOWsrc/napari/layers/utils/color_manager.py495CODE
LOWsrc/napari/layers/utils/stack_utils.py60CODE
LOWsrc/napari/layers/vectors/vectors.py594CODE
LOWsrc/napari/layers/vectors/_vector_utils.py48CODE
LOWsrc/napari/layers/image/_slice.py16CODE
LOWsrc/napari/layers/points/points.py1277CODE
LOWsrc/napari/layers/points/points.py1861CODE
LOWsrc/napari/layers/points/points.py1999CODE
LOW…ari/layers/points/_tests/test_points_mouse_bindings.py686CODE
LOWsrc/napari/plugins/_npe2.py362CODE
LOWsrc/napari/_vispy/canvas.py402CODE
LOWsrc/napari/_vispy/canvas.py968CODE
LOWsrc/napari/_vispy/canvas.py1117CODE
LOWsrc/napari/_vispy/canvas.py1209CODE
LOWsrc/napari/_vispy/_tests/test_vispy_vectors_layer.py24CODE
LOWsrc/napari/_vispy/overlays/text.py64CODE
LOWsrc/napari/_vispy/visuals/axes.py215CODE
LOWsrc/napari/utils/action_manager.py330CODE
LOWsrc/napari/utils/_tracebacks.py100CODE
31 more matches not shown…
Decorative Section Separators28 hits · 82 pts
SeverityFileLineSnippetContext
MEDIUMtools/validate_strings.py512# ----------------------------------------------------------------------------COMMENT
MEDIUMtools/validate_strings.py525# ----------------------------------------------------------------------------COMMENT
MEDIUMexamples/surface_multi_texture.py56# ------------------COMMENT
MEDIUMexamples/surface_multi_texture.py76# --------------COMMENT
MEDIUMexamples/surface_multi_texture.py85# -----------------COMMENT
MEDIUMexamples/surface_multi_texture.py107# ------------------------COMMENT
MEDIUMexamples/surface_multi_texture.py126# --------------------------COMMENT
MEDIUMexamples/theme_sample.py53# ── WCAG 2.1 helpers ───────────COMMENT
MEDIUMexamples/3D_vectors_through_time.py21# -----------COMMENT
MEDIUMexamples/3D_vectors_through_time.py52#----------------------------------COMMENT
MEDIUMsrc/napari/layers/points/points.py2357 # ----------STRING
MEDIUM…apari/layers/_scalar_field/_tests/test_scalar_field.py177# ---------------------------------------------------------------------------COMMENT
MEDIUM…apari/layers/_scalar_field/_tests/test_scalar_field.py179# ---------------------------------------------------------------------------COMMENT
MEDIUMsrc/napari/utils/translations.py164# ----------------------------------------------------------------------------COMMENT
MEDIUMsrc/napari/utils/_tests/test_translations.py183# ------------------STRING
MEDIUMsrc/napari/utils/_tests/test_translations.py360# ------------------------------STRING
MEDIUMsrc/napari/utils/_tests/test_translations.py374# ----------------------STRING
MEDIUMsrc/napari/utils/events/event.py6# ---------------------COMMENT
MEDIUMsrc/napari/utils/events/event.py37# ----------COMMENT
MEDIUM…er_controls/_tests/test_qt_multiscale_level_control.py12# ---------------------------------------------------------------------------COMMENT
MEDIUM…er_controls/_tests/test_qt_multiscale_level_control.py14# ---------------------------------------------------------------------------COMMENT
MEDIUM…er_controls/_tests/test_qt_multiscale_level_control.py36# ---------------------------------------------------------------------------COMMENT
MEDIUM…er_controls/_tests/test_qt_multiscale_level_control.py38# ---------------------------------------------------------------------------COMMENT
MEDIUMsrc/napari/_qt/widgets/_tests/test_qt_size_preview.py34# ----------------------------------------------------------------------------COMMENT
MEDIUMsrc/napari/_qt/widgets/_tests/test_qt_size_preview.py50# ----------------------------------------------------------------------------COMMENT
MEDIUM…napari/_qt/widgets/_tests/test_qt_highlight_preview.py48# ----------------------------------------------------------------------------COMMENT
MEDIUM…napari/_qt/widgets/_tests/test_qt_highlight_preview.py65# ----------------------------------------------------------------------------COMMENT
MEDIUM…napari/_qt/widgets/_tests/test_qt_highlight_preview.py115# ----------------------------------------------------------------------------COMMENT
Redundant / Tautological Comments33 hits · 54 pts
SeverityFileLineSnippetContext
LOWexamples/clipping_planes_interactive_.py110 # Check if click was on plane by checking if intersection occurs withinCOMMENT
LOWexamples/live_tiffs_.py96 # Check if the end of acquisition has reachedCOMMENT
LOW.github/workflows/label_and_milestone_checker.yml65 # Check if PR_MILESTONE_NAME is definedCOMMENT
LOW.github/workflows/label_and_milestone_checker.yml92 # Check if the PR's milestone is the closest future milestoneCOMMENT
LOWsrc/napari_builtins/io/_write.py305 # Loop through data for each layerCOMMENT
LOWsrc/napari_builtins/_qt/features_table.py163 # Check if this column is immutableCOMMENT
LOWsrc/napari_builtins/_qt/features_table.py188 # Check if this column is immutableCOMMENT
LOWsrc/napari_builtins/_qt/features_table.py440 # Check if this is an immutable structural column (source or index)COMMENT
LOWsrc/napari_builtins/_qt/features_table.py450 # Check if the feature column name is in immutable setCOMMENT
LOWsrc/napari/settings/_appearance.py78 # Check if a font_size change is needed when changing theme:COMMENT
LOWsrc/napari/settings/_appearance.py90 # Check if a font_size change is needed when changing theme:COMMENT
LOWsrc/napari/layers/shapes/shapes.py3028 # Check if inside vertex of interaction box or rotation handleCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3032 # Check if any matching verticesCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3041 # Check if inside vertex of shapeCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3051 # Check if any matching verticesCOMMENT
LOWsrc/napari/layers/shapes/shapes.py2692 # Check if any shape or vertex ids have changed since last callCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3068 # Check if mouse inside shapeCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py285 # Check if the shape has been updatedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py301 # Check if the shape has been updatedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py323 # Check if the shape has been updatedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py350 # Check if the face color has been updatedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py362 # Check if the edge color remains unchangedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py383 # Check if the edge color has been updatedCOMMENT
LOWsrc/napari/layers/shapes/_tests/test_shape_list.py395 # Check if the face color remains unchangedCOMMENT
LOWsrc/napari/layers/utils/stack_utils.py42 # Check if array is a zarr array and wrap it with daskCOMMENT
LOWsrc/napari/layers/utils/stack_utils.py348 # Check if input images are either all multiscale or notCOMMENT
LOWsrc/napari/layers/image/_image_mouse_bindings.py49 # Check if click was on plane and if not, exit early.COMMENT
LOWsrc/napari/layers/image/_image_mouse_bindings.py107 # Check if click was on plane and if not, exit early.COMMENT
LOWsrc/napari/layers/points/points.py1871 # Check if any point ids have changed since last callCOMMENT
LOWsrc/napari/_vispy/layers/scalar_field.py137 # Check if ndisplay has changed current node type needs updatingCOMMENT
LOWsrc/napari/utils/transforms/transform_utils.py247 # Check if an upper-triangular representation of shear orCOMMENT
LOWsrc/napari/utils/transforms/_tests/test_transforms.py303 # Set shear to same valueCOMMENT
LOWsrc/napari/utils/transforms/_tests/test_transforms.py308 # Set shear to same valueCOMMENT
Excessive Try-Catch Wrapping28 hits · 30 pts
SeverityFileLineSnippetContext
LOWtools/validate_strings.py367 except Exception: # noqa BLE001CODE
MEDIUMtools/check_deps_version.py89 print(f'Error parsing wheel filename {filename}: {e}')CODE
LOWtools/check_deps_version.py285 except Exception as e: # noqa: BLE001CODE
MEDIUMtools/check_deps_version.py286 print(f'Error reading {pyproject_path}: {e}')CODE
MEDIUMtools/check_deps_version.py281def main(pyproject_path='pyproject.toml'):CODE
LOWsrc/napari_builtins/io/_read.py149 except Exception as e:CODE
LOWsrc/napari_builtins/io/_write.py320 except Exception:CODE
LOWsrc/napari/_main.py69 except Exception: # noqa: BLE001CODE
LOWsrc/napari/_main.py84 except Exception as e:CODE
LOWsrc/napari/_main.py92 except Exception as e:CODE
MEDIUMsrc/napari/_main.py80def main() -> None:CODE
LOWsrc/napari/settings/_base.py190 except Exception as err: # noqa: BLE001CODE
LOWsrc/napari/settings/_migrations.py38 except Exception as e: # noqa BLE001CODE
LOWsrc/napari/settings/_migrations.py46 except Exception: # noqa BLE001CODE
LOWsrc/napari/layers/shapes/_shapes_utils.py870 except Exception as e: # pragma: no coverCODE
LOWsrc/napari/layers/base/base.py2453 except Exception as exc:CODE
LOWsrc/napari/utils/translations.py696 except Exception as err: # noqa BLE001CODE
LOWsrc/napari/utils/notifications.py382 except Exception:CODE
LOWsrc/napari/utils/info.py217 except Exception as e: # noqa BLE001STRING
LOWsrc/napari/utils/info.py278 except Exception as e: # noqa BLE001STRING
LOWsrc/napari/utils/events/event.py780 except Exception as e: # noqa: BLE001CODE
LOWsrc/napari/utils/colormaps/vendored/colors.py311 except Exception:CODE
LOWsrc/napari/components/viewer_model.py1420 except Exception as e:CODE
LOWsrc/napari/components/viewer_model.py1655 except Exception as e:CODE
LOWsrc/napari/components/histogram.py301 except Exception: # noqa: BLE001CODE
LOWsrc/napari/_qt/qt_main_window.py1551 except Exception as err: # noqa: BLE001CODE
LOWsrc/napari/_qt/__init__.py7except Exception as e:CODE
LOWsrc/napari/_qt/threads/status_checker.py127 except Exception as e: # pragma: no cover # noqa: BLE001CODE
AI Slop Vocabulary16 hits · 30 pts
SeverityFileLineSnippetContext
MEDIUM.github/workflows/benchmarks.yml22# All the *_THREADS options is just to make the benchmarks more robust by not using parallelismCOMMENT
MEDIUMsrc/napari/viewer.py75 """Overload __new__ to facilitate temporary monkey-patching.STRING
LOWsrc/napari/__main__.py286 # just set stack to True similar to the previous store_true actionCOMMENT
LOWsrc/napari/layers/tracks/tracks.py364 # if we are visualizing all time, then just set to the maximumCOMMENT
LOW…napari/layers/shapes/_accelerated_triangulate_numba.py288 # otherwise, we just use the miter vector in either direction and add twoCOMMENT
MEDIUM…napari/layers/shapes/_accelerated_triangulate_numba.py692 # Without the fix, the code is not robust to orientation.COMMENT
LOWsrc/napari/layers/utils/_text_utils.py51 # if the data are a list of coordinates, just return the coord (e.g., points)COMMENT
LOWsrc/napari/layers/utils/_text_utils.py150 # if the data are a list of coordinates, just return the coord (e.g., points)COMMENT
LOWsrc/napari/layers/utils/_tests/test_text_manager.py745 # Cannot just use `rand(num_points, ndisplay)` because whenCOMMENT
LOWsrc/napari/layers/image/image.py644 # translucent is special: just return the first value, no matter whatCOMMENT
LOWsrc/napari/layers/image/image.py647 # iso is weird too: just return None alwaysCOMMENT
LOWsrc/napari/_tests/test_magicgui.py471 # it works fine to just return `data`COMMENT
LOWsrc/napari/utils/interactions.py169 # if not dragging simply call the mouse move callbacksCOMMENT
LOWsrc/napari/components/experimental/monitor/_service.py132 # Start with our environment and just add in the one variable.COMMENT
MEDIUMsrc/napari/_qt/qt_main_window.py123 # To track window instances and facilitate getting the "active" viewer...COMMENT
LOWsrc/napari/_qt/_qapp_model/qactions/_plugins.py30 # amended to be a napari plugin and simply add this menu item itself.COMMENT
AI Response Leakage3 hits · 26 pts
SeverityFileLineSnippetContext
HIGHexamples/magic_parameter_sweep.py25# In this example, because we have already imported napari anyway, it doesn'tCOMMENT
HIGHexamples/surface_multi_texture.py109# In this example the texture coordinates happen to be the same for eachCOMMENT
HIGHexamples/magic_image_arithmetic.py31# In this example, because we have already imported napari anyway, it doesn'tCOMMENT
AI Structural Patterns20 hits · 20 pts
SeverityFileLineSnippetContext
LOWsrc/napari/view_layers.py79CODE
LOWsrc/napari/view_layers.py120CODE
LOWsrc/napari/view_layers.py160CODE
LOWsrc/napari/settings/_base.py344CODE
LOWsrc/napari/layers/labels/labels.py359CODE
LOWsrc/napari/layers/tracks/tracks.py116CODE
LOWsrc/napari/layers/surface/surface.py217CODE
LOWsrc/napari/layers/shapes/shapes.py442CODE
LOW…c/napari/layers/shapes/_shapes_models/_polygon_base.py37CODE
LOWsrc/napari/layers/vectors/vectors.py204CODE
LOWsrc/napari/layers/image/image.py247CODE
LOWsrc/napari/layers/points/points.py372CODE
LOWsrc/napari/layers/_scalar_field/scalar_field.py212CODE
LOWsrc/napari/layers/base/_test_util_sample_layer.py18CODE
LOWsrc/napari/layers/base/base.py533CODE
LOWsrc/napari/plugins/utils.py98CODE
LOWsrc/napari/utils/transforms/transforms.py425CODE
LOWsrc/napari/utils/transforms/transforms.py825CODE
LOWsrc/napari/utils/colormaps/vendored/colors.py1524CODE
LOWsrc/napari/components/viewer_model.py1069CODE
Slop Phrases4 hits · 8 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/overlays/colorbar.py131 # we make sure to not update things when invisibleCOMMENT
MEDIUMsrc/napari/utils/tree/_tests/test_tree_model.py155 # If you need to know if an item is an immediate child, you can use parentCOMMENT
LOWsrc/napari/utils/colormaps/colormap_utils.py502 # make sure to add an alpha channel to the colorsCOMMENT
LOWsrc/napari/_qt/utils.py304 # let's make sure to remove the animation from the widget becauseCOMMENT
Fake / Example Data5 hits · 6 pts
SeverityFileLineSnippetContext
LOWexamples/theme_sample.py101<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit,CODE
LOWexamples/theme_sample.py101<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit,CODE
LOW…napari/_qt/_qapp_model/_tests/test_qapp_model_menus.py38 id='dummy_id',CODE
LOW…napari/_qt/_qapp_model/_tests/test_qapp_model_menus.py46 dummy_action = viewer.window.file_menu.findAction('dummy_id')CODE
LOW…napari/_qt/_qapp_model/_tests/test_qapp_model_menus.py48 assert 'dummy_id' in app.commandsCODE
Modern AI Meta-Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMsrc/napari/_qt/qt_main_window.py130 # provider for dependency injectionCOMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py1541 # in-n-out is used in napari for dependency injection.COMMENT
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/canvas.py870 # Step 1: Force immediate garbage collection of OpenGL resourcesCOMMENT
LOWsrc/napari/_vispy/canvas.py877 # Step 2: Synchronize the OpenGL command queueCOMMENT
Overly Generic Function Names3 hits · 2 pts
SeverityFileLineSnippetContext
LOWexamples/progress_bar_threading_.py68def my_function(*_):CODE
LOWexamples/magic_viewer.py16def my_function(viewer: napari.Viewer):CODE
LOWsrc/napari/utils/events/_tests/test_evented_model.py394 def my_function():CODE
Structural Annotation Overuse2 hits · 2 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/canvas.py870 # Step 1: Force immediate garbage collection of OpenGL resourcesCOMMENT
LOWsrc/napari/_vispy/canvas.py877 # Step 2: Synchronize the OpenGL command queueCOMMENT