Repository Analysis

napari/napari

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

27.5 Moderate AI signal View on GitHub

Analysis Overview

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

27.5
Adjusted Score
27.5
Raw Score
100%
Time Factor
2026-08-25
Last Push
2.7K
Stars
Python
Language
217.0K
Lines of Code
1.1K
Files
3.7K
Pattern Hits
2026-08-29
Scan Date
0.22
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 123HIGH 124MEDIUM 77LOW 3385

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 3709 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 Identifiers2158 hits · 2180 pts
SeverityFileLineSnippetContext
LOWtools/create_pr_or_update_existing_one.py319def update_external_pr_comment(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.py97def test_read_python_source_uses_python_source_encoding(CODE
LOWsrc/napari_builtins/_tests/test_read.py143def test_read_wavefront_obj_lines(subject, vertices, faces):STRING
LOWsrc/napari_builtins/io/_read.py48def _git_provider_url_to_raw_url(filename: str) -> str:CODE
LOWsrc/napari_builtins/io/_read.py391def _guess_layer_type_from_column_names(CODE
LOWsrc/napari_builtins/io/_read.py534def _read_wavefront_obj_lines(CODE
LOWsrc/napari_builtins/io/_read.py642def 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.py235 def pytest_exception_interact(call):CODE
2098 more matches not shown…
Hallucination Indicators123 hits · 1652 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.py2149 value = self._slice.image.raw.dtype.type(value)CODE
CRITICALsrc/napari/layers/image/_image_key_bindings.py78 viewer.scene.camera.events.angles.connect(CODE
CRITICALsrc/napari/layers/image/_image_key_bindings.py83 viewer.scene.camera.events.angles.disconnect(CODE
CRITICALsrc/napari/_tests/test_multiple_viewers.py12 v1.window._qt_viewer.viewerButtons.gridViewButton.click()CODE
CRITICALsrc/napari/_vispy/canvas.py257 self.viewer.cursor.events.style.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py258 self.viewer.cursor.events.size.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py261 self.viewer.canvas.events.background_color_override.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py265 self.viewer.scene.camera.events.mouse_pan.connect(self._on_interactive)CODE
CRITICALsrc/napari/_vispy/canvas.py266 self.viewer.scene.camera.events.mouse_zoom.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py269 self.viewer.scene.camera.events.zoom.connect(self._on_cursor)CODE
CRITICALsrc/napari/_vispy/canvas.py271 self.viewer.canvas.overlays._zoom_box.events.zoom_area.connect(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.canvas.grid.events.stride.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py286 self.viewer.canvas.grid.events.shape.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py287 self.viewer.canvas.grid.events.enabled.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py288 self.viewer.canvas.grid.events.spacing.connect(self._update_scenegraph)CODE
CRITICALsrc/napari/_vispy/canvas.py289 self.viewer.scene.overlays.events.added.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py292 self.viewer.scene.overlays.events.removed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py295 self.viewer.scene.overlays.events.changed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py298 self.viewer.canvas.overlays.events.added.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py301 self.viewer.canvas.overlays.events.removed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py304 self.viewer.canvas.overlays.events.changed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py308 self.viewer.canvas.overlay_tiling.events.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py312 self.viewer.canvas.events._overlay_positions_changed.connect(CODE
CRITICALsrc/napari/_vispy/canvas.py316 self.viewer.canvas.events.size.connect(self._on_model_size_change)CODE
CRITICALsrc/napari/_vispy/canvas.py765 with self.viewer.canvas.events.size.blocker(CODE
CRITICALsrc/napari/_vispy/canvas.py804 self.viewer.scene.camera.events.angles.connect(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.py62 self.layer.plane.events.position.connect(CODE
CRITICALsrc/napari/_vispy/layers/scalar_field.py65 self.layer.plane.events.thickness.connect(CODE
CRITICALsrc/napari/_vispy/layers/scalar_field.py68 self.layer.plane.events.normal.connect(self._on_plane_normal_change)CODE
CRITICALsrc/napari/_vispy/layers/surface.py45 self.layer.wireframe.events.visible.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py48 self.layer.wireframe.events.width.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py51 self.layer.wireframe.events.color.connect(CODE
CRITICALsrc/napari/_vispy/layers/surface.py54 self.layer.normals.face.events.connect(self._on_face_normals_change)CODE
CRITICALsrc/napari/_vispy/layers/surface.py55 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
CRITICALsrc/napari/_vispy/overlays/colorbar.py109 self.viewer.canvas.events.background_color.connect(CODE
63 more matches not shown…
Unused Imports599 hits · 596 pts
SeverityFileLineSnippetContext
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.py16CODE
LOWsrc/napari_builtins/_tests/test_read.py17CODE
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__.py1CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/io/__init__.py11CODE
LOWsrc/napari_builtins/_qt/features_table.py1CODE
LOWsrc/napari/conftest.py32CODE
LOWsrc/napari/viewer.py13CODE
LOWsrc/napari/window.py13CODE
LOWsrc/napari/types.py25CODE
LOWsrc/napari/types.py26CODE
LOWsrc/napari/types.py27CODE
LOWsrc/napari/types.py28CODE
LOWsrc/napari/_event_loop.py2CODE
LOWsrc/napari/settings/_plugin_config_generator.py1CODE
LOWsrc/napari/settings/_base.py1CODE
LOWsrc/napari/settings/__init__.py8CODE
LOWsrc/napari/settings/_yaml.py1CODE
LOWsrc/napari/settings/_shortcuts.py1CODE
LOWsrc/napari/settings/_application.py1CODE
LOWsrc/napari/settings/_migrations.py1CODE
LOWsrc/napari/settings/_plugin_settings.py1CODE
LOWsrc/napari/settings/_tests/test_plugins.py6CODE
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
539 more matches not shown…
Cross-File Repetition91 hits · 455 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/surface/surface.py0make a points slice request based on the given dims and these data.STRING
HIGHsrc/napari/layers/vectors/vectors.py0make a points slice request based on the given dims and these data.STRING
HIGHsrc/napari/layers/points/points.py0make a points slice request based on the given dims and these data.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
31 more matches not shown…
Cross-Language Confusion30 hits · 198 pts
SeverityFileLineSnippetContext
HIGHsrc/napari/viewer.py121 self.window._qt_viewer.console.push(variables)CODE
HIGHsrc/napari/layers/labels/_tests/test_labels.py2297 with more colors is undefined, so we don't test it here.CODE
HIGHsrc/napari/layers/surface/_slice.py143 # a non-valid index is undefined, but shouldn't happenCOMMENT
HIGHsrc/napari/layers/vectors/vectors.py564 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.py392 return df1.equals(df2)CODE
HIGHsrc/napari/utils/io.py280 console.push(variables)CODE
HIGHsrc/napari/utils/events/evented_model.py450 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.py558 console.push(CODE
HIGHsrc/napari/_qt/qt_viewer.py566 console.push({'np': np})CODE
HIGHsrc/napari/_qt/qt_viewer.py569 console.push(CODE
HIGHsrc/napari/_qt/qt_viewer.py1339 filenames.append(url.toString())CODE
Modern Structural Boilerplate193 hits · 196 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__.py21__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__.py18__all__ = [CODE
LOWsrc/napari/settings/_experimental.py145def _update_triangulation_backend(event: Event) -> None:CODE
LOWsrc/napari/settings/_experimental.py151def _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.py276 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/tracks/tracks.py299 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/tracks/tracks.py676 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.py682 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/surface/surface.py818 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/surface/surface.py850 def _update_slice_response(self, response: _SurfaceSliceResponse) -> None:CODE
LOWsrc/napari/layers/shapes/shapes.py2700 def _set_highlight(self, force=False) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py749 def _update_displayed(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py1122 def _update_vertices(self, index: int) -> None:CODE
LOWsrc/napari/layers/shapes/_shape_list.py1149 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.py90 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/line.py69 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.py75 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py208 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py309 def _set_empty_edge(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/shape.py314 def _set_empty_face(self) -> None:CODE
LOWsrc/napari/layers/shapes/_shapes_models/ellipse.py83 def _update_displayed_data(self) -> None:CODE
LOWsrc/napari/layers/utils/layer_utils.py967 def set_values(self, values, *, num_data=None) -> None:CODE
LOWsrc/napari/layers/utils/layer_utils.py977 def set_defaults(self, defaults: dict[str, Any] | pd.DataFrame) -> None:CODE
LOWsrc/napari/layers/utils/stack_utils.py18logger = 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.py531 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.py627 def _set_data(self, data: np.ndarray | None) -> None:CODE
LOWsrc/napari/layers/points/points.py1850 def _set_highlight(self, force: bool = False) -> None:CODE
LOWsrc/napari/layers/points/points.py1917 def _update_thumbnail(self) -> None:CODE
LOWsrc/napari/layers/points/points.py2470 def _set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/points/points.py2502 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.py306 def _set_loaded(self, loaded: bool) -> None:CODE
LOWsrc/napari/layers/base/base.py312 def _set_unloaded_slice_id(self, slice_id: int) -> None:CODE
LOWsrc/napari/layers/base/base.py321 def _update_loaded_slice_id(self, slice_id: int) -> None:CODE
LOWsrc/napari/layers/base/base.py138 def set_view_slice(self) -> None:CODE
LOWsrc/napari/layers/base/base.py869 def _set_source(self, source: Source) -> None:CODE
LOWsrc/napari/layers/base/base.py1124 def _update_dims(self) -> None:CODE
LOWsrc/napari/layers/base/base.py1436 def set_view_slice(self) -> None:CODE
133 more matches not shown…
Over-Commented Block238 hits · 195 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==84.0.0.20260812COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt21attrs==26.1.0COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt41 # pyogrioCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt61comm==0.2.3COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt81 # distributedCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt101 # gdownCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt141 # via napari (pyproject.toml:gallery)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt161 # tifffileCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt181 # napari-consoleCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt201jsonschema-specifications==2025.9.1COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt221 # via numbaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt241 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt261 # via sympyCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt281 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt301 # geffCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt321 # ml-dtypesCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt341 # torchvisionCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt361nvidia-cufft==12.0.0.61COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt381 # nvidia-cusolverCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt401 # pyogrioCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt421partsegcore-compiled-backend==0.15.14COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt441 # napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt461propcache==0.5.2COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt481 # via stack-dataCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt501 # via napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt521pyproj==3.7.2COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt541 # pyside6COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt561pytest-rerunfailures==16.6COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt581 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt601referencing==0.37.0COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt621 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt641shapely==2.1.2COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt661 # via motileCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt681 # napari (pyproject.toml:gallery)COMMENT
LOWresources/constraints/constraints_py3.12_examples.txt701 # ipykernelCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt721 # viaCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt741 # pydantic-extra-typesCOMMENT
LOWresources/constraints/constraints_py3.12_examples.txt761 # via prompt-toolkitCOMMENT
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 # viaCOMMENT
LOWresources/constraints/constraints_py3.14.txt81frozenlist==1.8.0COMMENT
LOWresources/constraints/constraints_py3.14.txt101 # yarlCOMMENT
LOWresources/constraints/constraints_py3.14.txt121ipython-pygments-lexers==1.1.1COMMENT
LOWresources/constraints/constraints_py3.14.txt141 # qtconsoleCOMMENT
LOWresources/constraints/constraints_py3.14.txt161 # via napari (pyproject.toml)COMMENT
LOWresources/constraints/constraints_py3.14.txt181 # yarlCOMMENT
LOWresources/constraints/constraints_py3.14.txt201 # napari-plugin-managerCOMMENT
LOWresources/constraints/constraints_py3.14.txt221 # scikit-imageCOMMENT
LOWresources/constraints/constraints_py3.14.txt241nvidia-cudnn-cu13==9.20.0.48COMMENT
LOWresources/constraints/constraints_py3.14.txt261 # cuda-toolkitCOMMENT
LOWresources/constraints/constraints_py3.14.txt281 # qtpyCOMMENT
LOWresources/constraints/constraints_py3.14.txt301 # imageioCOMMENT
LOWresources/constraints/constraints_py3.14.txt321 # pytest-qtCOMMENT
178 more matches not shown…
Self-Referential Comments46 hits · 148 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.py1344 # 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
MEDIUM…c/napari/layers/shapes/_tests/test_shapes_selection.py47 # Create a shapes layer with a rectangleCOMMENT
MEDIUM…c/napari/layers/shapes/_tests/test_shapes_selection.py64 # Create a shapes layer with rectangles on different slicesCOMMENT
MEDIUM…c/napari/layers/shapes/_tests/test_shapes_selection.py84 # Create a shapes layerCOMMENT
MEDIUM…c/napari/layers/shapes/_tests/test_shapes_selection.py103 # Create a shapes layer with a rectangle only on slice 0COMMENT
MEDIUMsrc/napari/layers/shapes/_tests/test_shapes.py2453 # Create a layer with the first shapeCOMMENT
MEDIUMsrc/napari/layers/utils/text_manager.py354 # Create a new instance from the input to populate all fields.COMMENT
MEDIUMsrc/napari/layers/utils/style_encoding.py113# The following classes provide generic implementations of common waysCOMMENT
MEDIUMsrc/napari/layers/points/points.py2307 # Define a minimal set of coordinates where the mask could be presentCOMMENT
MEDIUMsrc/napari/layers/base/base.py594 # 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.py181 # 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.py218# 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.py172 # Create the API first. It will register our callbacks, thenCOMMENT
MEDIUMsrc/napari/_qt/qt_main_window.py801 """This function is only executed once at the startup of napariSTRING
MEDIUMsrc/napari/_qt/qt_viewer.py236 # Create the experimental QtPool for the monitor.COMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py239 # Create the experimental RemoteManager for the monitor.COMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py1567 # Create the remote manager and have monitor call its process_command()COMMENT
MEDIUMsrc/napari/_qt/_qapp_model/_tests/test_qproviders.py44 # 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 Nesting93 hits · 89 pts
SeverityFileLineSnippetContext
LOWtools/check_deps_version.py75CODE
LOWsrc/napari_builtins/_diffusion_4d.py46CODE
LOWsrc/napari_builtins/_measure_shapes.py67CODE
LOWsrc/napari_builtins/io/_read.py202CODE
LOWsrc/napari_builtins/io/_read.py313CODE
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.py726CODE
LOWsrc/napari/_main.py49CODE
LOWsrc/napari/_pydantic_util.py26CODE
LOWsrc/napari/__main__.py210CODE
LOWsrc/napari/settings/_base.py481CODE
LOWsrc/napari/settings/_fields.py145CODE
LOWsrc/napari/settings/_migrations.py29CODE
LOWsrc/napari/settings/_migrations.py141CODE
LOWsrc/napari/layers/_tests/test_layer_attributes.py71CODE
LOWsrc/napari/layers/shapes/shapes.py1114CODE
LOWsrc/napari/layers/shapes/shapes.py1440CODE
LOWsrc/napari/layers/shapes/shapes.py2454CODE
LOWsrc/napari/layers/shapes/shapes.py2542CODE
LOWsrc/napari/layers/shapes/shapes.py2602CODE
LOWsrc/napari/layers/shapes/shapes.py2723CODE
LOWsrc/napari/layers/shapes/shapes.py2832CODE
LOWsrc/napari/layers/shapes/shapes.py3008CODE
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.py782CODE
LOWsrc/napari/layers/utils/layer_utils.py790CODE
LOWsrc/napari/layers/utils/color_manager.py81CODE
LOWsrc/napari/layers/utils/color_manager.py494CODE
LOWsrc/napari/layers/utils/stack_utils.py56CODE
LOWsrc/napari/layers/vectors/vectors.py611CODE
LOWsrc/napari/layers/vectors/_vector_utils.py46CODE
LOWsrc/napari/layers/image/_slice.py16CODE
LOWsrc/napari/layers/points/points.py1282CODE
LOWsrc/napari/layers/points/points.py1850CODE
LOWsrc/napari/layers/points/points.py1988CODE
LOW…ari/layers/points/_tests/test_points_mouse_bindings.py686CODE
LOWsrc/napari/plugins/_npe2.py357CODE
LOWsrc/napari/_vispy/canvas.py385CODE
LOWsrc/napari/_vispy/canvas.py968CODE
LOWsrc/napari/_vispy/canvas.py1048CODE
LOWsrc/napari/_vispy/canvas.py1123CODE
LOWsrc/napari/_vispy/canvas.py1229CODE
LOWsrc/napari/_vispy/_tests/test_vispy_vectors_layer.py24CODE
LOWsrc/napari/_vispy/overlays/text.py64CODE
LOWsrc/napari/_vispy/visuals/axes.py202CODE
LOWsrc/napari/utils/action_manager.py319CODE
LOWsrc/napari/utils/_tracebacks.py100CODE
LOWsrc/napari/utils/transforms/transforms.py416CODE
33 more matches not shown…
Decorative Section Separators20 hits · 61 pts
SeverityFileLineSnippetContext
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.py2342 # ----------STRING
MEDIUM…apari/layers/_scalar_field/_tests/test_scalar_field.py178# ---------------------------------------------------------------------------COMMENT
MEDIUM…apari/layers/_scalar_field/_tests/test_scalar_field.py180# ---------------------------------------------------------------------------COMMENT
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
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 Comments35 hits · 58 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.py69 # Check if a font_size change is needed when changing theme:COMMENT
LOWsrc/napari/settings/_appearance.py81 # Check if a font_size change is needed when changing theme:COMMENT
LOWsrc/napari/layers/shapes/shapes.py3046 # Check if inside vertex of interaction box or rotation handleCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3050 # Check if any matching verticesCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3059 # Check if inside vertex of shapeCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3069 # Check if any matching verticesCOMMENT
LOWsrc/napari/layers/shapes/shapes.py2711 # Check if any shape or vertex ids have changed since last callCOMMENT
LOWsrc/napari/layers/shapes/shapes.py3086 # Check if mouse inside shapeCOMMENT
LOW…c/napari/layers/shapes/_tests/test_shapes_selection.py107 # Set mode to SELECTCOMMENT
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.py41 # Check if array is a zarr array and wrap it with daskCOMMENT
LOWsrc/napari/layers/utils/stack_utils.py324 # 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.py1860 # Check if any point ids have changed since last callCOMMENT
LOWsrc/napari/_vispy/layers/scalar_field.py136 # Check if ndisplay has changed current node type needs updatingCOMMENT
LOWsrc/napari/utils/transforms/transform_utils.py245 # 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
LOWsrc/napari/components/histogram.py465 # Check if the surface has vortex values, if yes return them, otherwise return None.COMMENT
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__.py285 # just set stack to True similar to the previous store_true actionCOMMENT
LOWsrc/napari/layers/tracks/tracks.py363 # 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.py50 # if the data are a list of coordinates, just return the coord (e.g., points)COMMENT
LOWsrc/napari/layers/utils/_text_utils.py146 # 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.py660 # translucent is special: just return the first value, no matter whatCOMMENT
LOWsrc/napari/layers/image/image.py663 # 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.py164 # 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.py124 # To track window instances and facilitate getting the "active" viewer...COMMENT
LOWsrc/napari/_qt/_qapp_model/qactions/_plugins.py29 # amended to be a napari plugin and simply add this menu item itself.COMMENT
Excessive Try-Catch Wrapping26 hits · 28 pts
SeverityFileLineSnippetContext
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.py154 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.py176 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.py863 except Exception as e: # pragma: no coverCODE
LOWsrc/napari/layers/base/base.py2481 except Exception as exc:CODE
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.py732 except Exception as e: # noqa: BLE001CODE
LOWsrc/napari/utils/colormaps/vendored/colors.py311 except Exception:CODE
LOWsrc/napari/components/viewer_model.py1441 except Exception as e:CODE
LOWsrc/napari/components/viewer_model.py1649 except Exception as e:CODE
LOWsrc/napari/components/histogram.py300 except Exception:CODE
LOWsrc/napari/_qt/qt_main_window.py1547 except Exception as err: # noqa: BLE001CODE
LOWsrc/napari/_qt/__init__.py5except Exception as e:CODE
LOWsrc/napari/_qt/threads/status_checker.py127 except Exception as e: # pragma: no cover # noqa: BLE001CODE
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.py122CODE
LOWsrc/napari/view_layers.py164CODE
LOWsrc/napari/settings/_base.py323CODE
LOWsrc/napari/layers/labels/labels.py357CODE
LOWsrc/napari/layers/tracks/tracks.py115CODE
LOWsrc/napari/layers/surface/surface.py237CODE
LOWsrc/napari/layers/shapes/shapes.py440CODE
LOW…c/napari/layers/shapes/_shapes_models/_polygon_base.py36CODE
LOWsrc/napari/layers/vectors/vectors.py206CODE
LOWsrc/napari/layers/image/image.py262CODE
LOWsrc/napari/layers/points/points.py374CODE
LOWsrc/napari/layers/_scalar_field/scalar_field.py211CODE
LOWsrc/napari/layers/base/_test_util_sample_layer.py18CODE
LOWsrc/napari/layers/base/base.py532CODE
LOWsrc/napari/plugins/utils.py98CODE
LOWsrc/napari/utils/transforms/transforms.py416CODE
LOWsrc/napari/utils/transforms/transforms.py805CODE
LOWsrc/napari/utils/colormaps/vendored/colors.py1524CODE
LOWsrc/napari/components/viewer_model.py1102CODE
Slop Phrases4 hits · 8 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/overlays/colorbar.py129 # 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.py468 # make sure to add an alpha channel to the colorsCOMMENT
LOWsrc/napari/_qt/utils.py298 # 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.py131 # provider for dependency injectionCOMMENT
MEDIUMsrc/napari/_qt/qt_viewer.py1591 # in-n-out is used in napari for dependency injection.COMMENT
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
Verbosity Indicators2 hits · 2 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/canvas.py872 # Step 1: Force immediate garbage collection of OpenGL resourcesCOMMENT
LOWsrc/napari/_vispy/canvas.py879 # Step 2: Synchronize the OpenGL command queueCOMMENT
Structural Annotation Overuse2 hits · 2 pts
SeverityFileLineSnippetContext
LOWsrc/napari/_vispy/canvas.py872 # Step 1: Force immediate garbage collection of OpenGL resourcesCOMMENT
LOWsrc/napari/_vispy/canvas.py879 # Step 2: Synchronize the OpenGL command queueCOMMENT