Repository Analysis

netbox-community/netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/products/free-netbox-cloud/

13.3 Low AI signal View on GitHub
13.3
Adjusted Score
13.3
Raw Score
100%
Time Factor
2026-05-30
Last Push
20,730
Stars
Python
Language
262,134
Lines of Code
1745
Files
2598
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 61HIGH 26MEDIUM 135LOW 2376

Pattern Findings

2598 matches across 17 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers1269 hits · 1243 pts
SeverityFileLineSnippet
LOWnetbox/netbox/denormalized.py31def update_denormalized_fields(sender, instance, created, raw, **kwargs):
LOWnetbox/netbox/utils.py60def register_request_processor(func):
LOWnetbox/netbox/middleware.py43 def should_redirect_with_slash(self, request):
LOWnetbox/netbox/forms/mixins.py77 def _append_customfield_fields(self):
LOWnetbox/netbox/plugins/registration.py20def register_template_extensions(class_list):
LOWnetbox/netbox/plugins/registration.py81def register_user_preferences(plugin_name, preferences):
LOWnetbox/netbox/plugins/registration.py88def register_serializer_resolver(app_label, resolver):
LOWnetbox/netbox/tests/test_forms.py35 def test_empty_string_to_none_nullable_charfield(self):
LOWnetbox/netbox/tests/test_forms.py48 def test_empty_string_to_none_nullable_integerfield(self):
LOWnetbox/netbox/tests/test_forms.py61 def test_empty_string_to_none_nullable_smallintegerfield(self):
LOWnetbox/netbox/tests/test_forms.py74 def test_empty_string_to_none_nullable_decimalfield(self):
LOWnetbox/netbox/tests/test_forms.py89 def test_empty_string_to_none_nullable_foreignkey(self):
LOWnetbox/netbox/tests/test_forms.py108 def test_empty_string_preserved_non_nullable_charfield(self):
LOWnetbox/netbox/tests/test_forms.py124 def test_empty_string_not_converted_for_required_fields(self):
LOWnetbox/netbox/tests/test_forms.py138 def test_non_string_none_value_preserved(self):
LOWnetbox/netbox/tests/test_forms.py153 def test_non_string_numeric_values_preserved(self):
LOWnetbox/netbox/tests/test_forms.py168 def test_manytomany_fields_skipped(self):
LOWnetbox/netbox/tests/test_forms.py181 def test_fields_not_in_cleaned_data_skipped(self):
LOWnetbox/netbox/tests/test_forms.py195 def test_valid_string_values_preserved(self):
LOWnetbox/netbox/tests/test_forms.py213 def test_multiple_nullable_fields_with_empty_strings(self):
LOWnetbox/netbox/tests/test_forms.py237 def test_mixed_nullable_and_non_nullable_empty_strings(self):
LOWnetbox/netbox/tests/test_forms.py258 def test_wireless_fields_nullable(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py168 def test_api_test_cases_exist_for_api_models(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py183 def test_view_test_cases_exist_for_ui_models(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py198 def test_filterset_test_cases_exist_for_registered_filtersets(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py225 def test_import_optional_returns_module_when_present(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py230 def test_import_optional_returns_none_for_missing_submodule(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py234 def test_import_optional_returns_none_for_missing_parent(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py238 def test_import_optional_propagates_unrelated_find_spec_error(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py252 def test_import_optional_propagates_import_module_errors(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py272 def test_has_tests_detects_test_methods(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py284 def test_get_queryset_model_prefers_queryset(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py290 def test_get_queryset_model_falls_back_to_filterset(self):
LOWnetbox/netbox/tests/test_model_test_coverage.py296 def test_get_queryset_model_returns_none_when_unset(self):
LOWnetbox/netbox/tests/test_model_features.py65 def test_cloningmixin_injects_gfk_attribute(self):
LOWnetbox/netbox/tests/test_model_features.py90 def test_cloningmixin_does_not_inject_gfk_attribute_if_incomplete(self):
LOWnetbox/netbox/tests/test_object_actions.py23 def test_get_url_plugin_model(self):
LOWnetbox/netbox/tests/test_object_actions.py35 def test_bulk_edit_get_context_child_object(self):
LOWnetbox/netbox/tests/test_plugins.py244 def test_plugin_menu_item_independent_permissions(self):
LOWnetbox/netbox/tests/test_plugins.py254 def test_plugin_menu_item_independent_buttons(self):
LOWnetbox/netbox/tests/test_plugins.py266 def test_plugin_menu_button_independent_permissions(self):
LOWnetbox/netbox/tests/test_plugins.py276 def test_explicit_permissions_remain_independent(self):
LOWnetbox/netbox/tests/test_tables.py18 def test_prefetch_visible_columns(self):
LOWnetbox/netbox/tests/test_tables.py50 def test_prefetch_all_columns_for_export(self):
LOWnetbox/netbox/tests/test_tables.py82 def test_configure_anonymous_user_with_ordering(self):
LOWnetbox/netbox/tests/test_search.py69 def test_cache_multiple_objects(self):
LOWnetbox/netbox/tests/test_graphql.py31 def test_graphql_max_query_depth_disabled_by_default(self):
LOWnetbox/netbox/tests/test_graphql.py38 def test_graphql_max_query_depth_disabled_when_zero(self):
LOWnetbox/netbox/tests/test_graphql.py45 def test_graphql_max_query_depth_disabled_when_negative(self):
LOWnetbox/netbox/tests/test_graphql.py52 def test_graphql_max_query_depth_enforced(self):
LOWnetbox/netbox/tests/test_graphql.py107 def test_graphql_filter_objects(self):
LOWnetbox/netbox/tests/test_graphql.py188 def test_graphql_integer_range_lookup(self):
LOWnetbox/netbox/tests/test_graphql.py222 def test_graphql_tableconfig_object_type_exposes_id(self):
LOWnetbox/netbox/tests/test_ui.py185 def test_related_object_list_attr_direct_accessor(self):
LOWnetbox/netbox/tests/test_ui.py195 def test_related_object_list_attr_related_accessor(self):
LOWnetbox/netbox/tests/test_ui.py205 def test_related_object_list_attr_empty_related_accessor(self):
LOWnetbox/netbox/tests/test_ui.py213 def test_related_object_list_attr_max_items(self):
LOWnetbox/netbox/tests/test_ui.py230 def test_get_value_with_format_string(self):
LOWnetbox/netbox/tests/test_ui.py235 def test_get_value_without_format_string(self):
LOWnetbox/netbox/tests/test_ui.py240 def test_get_value_none_skips_format_string(self):
1209 more matches not shown…
Unused Imports925 hits · 902 pts
SeverityFileLineSnippet
LOWnetbox/netbox/settings.py1021
LOWnetbox/netbox/settings.py344
LOWnetbox/netbox/tables/__init__.py1
LOWnetbox/netbox/tables/__init__.py2
LOWnetbox/netbox/tables/tables.py17
LOWnetbox/netbox/tables/tables.py27
LOWnetbox/netbox/forms/model_forms.py7
LOWnetbox/netbox/forms/mixins.py5
LOWnetbox/netbox/forms/mixins.py6
LOWnetbox/netbox/forms/filtersets.py4
LOWnetbox/netbox/forms/__init__.py1
LOWnetbox/netbox/forms/__init__.py2
LOWnetbox/netbox/forms/__init__.py3
LOWnetbox/netbox/forms/__init__.py4
LOWnetbox/netbox/forms/__init__.py5
LOWnetbox/netbox/forms/__init__.py6
LOWnetbox/netbox/forms/bulk_import.py5
LOWnetbox/netbox/forms/bulk_edit.py5
LOWnetbox/netbox/plugins/__init__.py14
LOWnetbox/netbox/plugins/__init__.py15
LOWnetbox/netbox/plugins/__init__.py16
LOWnetbox/netbox/plugins/__init__.py17
LOWnetbox/netbox/tests/test_import.py2
LOWnetbox/netbox/tests/test_jobs.py14
LOWnetbox/netbox/tests/dummy_plugin/__init__.py27
LOWnetbox/netbox/tests/dummy_plugin/__init__.py27
LOWnetbox/netbox/tests/dummy_plugin/__init__.py27
LOWnetbox/netbox/tests/dummy_plugin/views.py14
LOWnetbox/netbox/navigation/menu.py7
LOWnetbox/netbox/models/mixins.py5
LOWnetbox/netbox/models/__init__.py10
LOWnetbox/netbox/models/features.py15
LOWnetbox/netbox/graphql/enums.py3
LOWnetbox/netbox/graphql/filter_mixins.py20
LOWnetbox/netbox/graphql/filter_mixins.py21
LOWnetbox/netbox/graphql/filter_mixins.py23
LOWnetbox/netbox/graphql/filters.py12
LOWnetbox/netbox/api/serializers/__init__.py1
LOWnetbox/netbox/api/serializers/__init__.py2
LOWnetbox/netbox/api/serializers/__init__.py3
LOWnetbox/netbox/api/serializers/__init__.py4
LOWnetbox/netbox/api/serializers/__init__.py6
LOWnetbox/netbox/api/serializers/__init__.py7
LOWnetbox/netbox/views/__init__.py1
LOWnetbox/netbox/views/__init__.py2
LOWnetbox/netbox/views/generic/__init__.py1
LOWnetbox/netbox/views/generic/__init__.py2
LOWnetbox/netbox/views/generic/__init__.py3
LOWnetbox/core/signals.py15
LOWnetbox/core/filtersets.py12
LOWnetbox/core/filtersets.py13
LOWnetbox/core/apps.py8
LOWnetbox/core/apps.py24
LOWnetbox/core/apps.py25
LOWnetbox/core/apps.py25
LOWnetbox/core/apps.py26
LOWnetbox/core/apps.py29
LOWnetbox/core/apps.py29
LOWnetbox/core/apps.py29
LOWnetbox/core/views.py69
865 more matches not shown…
Hallucination Indicators61 hits · 610 pts
SeverityFileLineSnippet
CRITICALnetbox/netbox/models/mixins.py1from django.core.exceptions import ValidationError
CRITICALnetbox/core/tests/test_signals.py6from django.core.exceptions import ValidationError
CRITICALnetbox/core/tests/test_management_commands.py293 data_source_model.objects.filter.return_value.update.assert_called_once_with(
CRITICALnetbox/core/models/files.py6from django.core.exceptions import ValidationError
CRITICALnetbox/core/models/change_logging.py5from django.core.exceptions import ValidationError
CRITICALnetbox/core/models/jobs.py10from django.core.exceptions import ValidationError
CRITICALnetbox/core/models/data.py10from django.core.exceptions import ValidationError
CRITICALnetbox/virtualization/forms/model_forms.py5from django.core.exceptions import ValidationError
CRITICALnetbox/virtualization/tests/test_models.py3from django.core.exceptions import ValidationError
CRITICALnetbox/virtualization/models/clusters.py3from django.core.exceptions import ValidationError
CRITICALnetbox/virtualization/models/virtualmachines.py4from django.core.exceptions import ValidationError
CRITICALnetbox/circuits/models/virtual_circuits.py4from django.core.exceptions import ValidationError
CRITICALnetbox/circuits/models/circuits.py3from django.core.exceptions import ValidationError
CRITICALnetbox/tenancy/models/contacts.py2from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/forms/model_forms.py2from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/forms/bulk_import.py1from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/tests/test_models.py1from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/models/tunnels.py2from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/models/crypto.py1from django.core.exceptions import ValidationError
CRITICALnetbox/vpn/models/l2vpn.py2from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/fields.py2from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/cable_profiles.py3from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/svg/racks.py5from django.core.exceptions import FieldError
CRITICALnetbox/dcim/tests/test_models.py1from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/mixins.py3from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/device_component_templates.py2from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/sites.py4from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/modules.py3from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/racks.py7from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/cables.py10from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/cables.py658 termination = self.termination._meta.model.objects.get(pk=self.termination_id)
CRITICALnetbox/dcim/models/cables.py666 termination = self.termination._meta.model.objects.get(pk=self.termination_id)
CRITICALnetbox/dcim/models/devices.py7from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/power.py1from django.core.exceptions import ValidationError
CRITICALnetbox/dcim/models/base.py1from django.core.exceptions import ValidationError
CRITICALnetbox/utilities/password_validation.py1from django.core.exceptions import ValidationError
CRITICALnetbox/utilities/validators.py4from django.core.exceptions import ValidationError
CRITICALnetbox/utilities/jsonschema.py7from django.core.exceptions import ValidationError
CRITICALnetbox/utilities/filters.py5from django.core.exceptions import ValidationError
CRITICALnetbox/utilities/templatetags/form_helpers.py54 return field.field.widget.__class__.__name__.lower()
CRITICALnetbox/utilities/forms/fields/csv.py3from django.core.exceptions import FieldError, MultipleObjectsReturned, ObjectDoesNotExist
CRITICALnetbox/wireless/models.py1from django.core.exceptions import ValidationError
CRITICALnetbox/users/views.py1from django.core.exceptions import ValidationError
CRITICALnetbox/users/forms/model_forms.py8from django.core.exceptions import FieldError
CRITICALnetbox/users/tests/test_models.py3from django.core.exceptions import ValidationError
CRITICALnetbox/users/models/users.py13from django.core.exceptions import ValidationError
CRITICALnetbox/users/models/tokens.py8from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/formfields.py2from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/fields.py1from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/filtersets.py4from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/validators.py1from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/tests/test_models.py2from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/models/asns.py1from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/models/ip.py5from django.core.exceptions import ValidationError
CRITICALnetbox/ipam/models/vlans.py4from django.core.exceptions import ValidationError
CRITICALnetbox/extras/validators.py4from django.core.exceptions import ValidationError
CRITICALnetbox/extras/tests/test_signals.py5from django.core.exceptions import ValidationError
CRITICALnetbox/extras/tests/test_customfields.py5from django.core.exceptions import ValidationError
CRITICALnetbox/extras/tests/test_customvalidators.py2from django.core.exceptions import ValidationError
CRITICALnetbox/extras/models/mixins.py7from django.core.exceptions import ValidationError
1 more matches not shown…
Self-Referential Comments123 hits · 360 pts
SeverityFileLineSnippet
MEDIUMupgrade.sh50# Create a new virtual environment
MEDIUMnetbox/netbox/configuration_example.py71# Define a mapping of cryptographic peppers to use when hashing API tokens. A minimum of one pepper is required to
MEDIUMnetbox/netbox/tables/columns.py320 # Create the actions dropdown menu
MEDIUMnetbox/netbox/tables/tables.py268 # Create a copy to avoid modifying the original Column
MEDIUMnetbox/netbox/tests/test_authentication.py27 # Create a v1 token
MEDIUMnetbox/netbox/tests/test_authentication.py49 # Create a v2 token
MEDIUMnetbox/netbox/tests/test_authentication.py630 # Create a permitted object
MEDIUMnetbox/netbox/tests/test_config.py36 # Create a config but don't load it into the cache
MEDIUMnetbox/netbox/tests/test_config.py46 # Create a config and load it into the cache
MEDIUMnetbox/netbox/tests/test_config.py58 # Create a config and load it into the cache
MEDIUMnetbox/netbox/models/deletion.py53 # Create a unique key for this relation
MEDIUMnetbox/netbox/api/viewsets/mixins.py65 # Creating a single object
MEDIUMnetbox/netbox/views/generic/object_views.py588 # Create the new components
MEDIUMnetbox/netbox/authentication/__init__.py105 # Create a dictionary mapping permissions to their constraints
MEDIUMnetbox/netbox/authentication/__init__.py307# Create a new instance of django-auth-ldap's LDAPBackend with our own ObjectPermissions
MEDIUMnetbox/core/tests/test_changelog.py46 # Create a custom field on the Site model
MEDIUMnetbox/core/tests/test_changelog.py56 # Create a select custom field on the Site model
MEDIUMnetbox/core/tests/test_changelog.py234 # Create a Site
MEDIUMnetbox/core/tests/test_changelog.py264 # Create a Site
MEDIUMnetbox/core/tests/test_changelog.py335 # Create a cable between the interfaces
MEDIUMnetbox/core/tests/test_changelog.py405 # Create a custom field on the Site model
MEDIUMnetbox/core/tests/test_changelog.py415 # Create a select custom field on the Site model
MEDIUMnetbox/core/tests/test_changelog.py654 # Create a new Module
MEDIUMnetbox/core/tests/test_changelog.py666 # Create an Interface on the Module
MEDIUMnetbox/core/tests/test_api.py186 # Create the test user and assign permissions
MEDIUMnetbox/virtualization/tests/test_views.py666 # Create a child interface
MEDIUMnetbox/virtualization/tests/test_models.py62 # Create the first VM
MEDIUMnetbox/virtualization/tests/test_models.py71 # Create the second VM
MEDIUMnetbox/virtualization/tests/test_models.py108 # Create the cluster type
MEDIUMnetbox/virtualization/tests/test_models.py647 # Create a VM pinned to device_in_cluster
MEDIUMnetbox/virtualization/tests/test_models.py665 # Create a VM pinned to a device
MEDIUMnetbox/virtualization/tests/test_api.py707 # Create a child interface
MEDIUMnetbox/tenancy/tests/test_models.py10 # Create a tree of contact groups:
MEDIUMnetbox/dcim/views.py118 # Create a new Form class from ConfirmationForm
MEDIUMnetbox/dcim/svg/cables.py429 # Create the connector
MEDIUMnetbox/dcim/tests/test_cablepaths2.py1245 # Create a 2-connector trunk cable with both A-side connectors
MEDIUMnetbox/dcim/tests/test_cablepaths2.py1988 # Create a PortMapping between frontport1 and rearport1
MEDIUMnetbox/dcim/tests/test_signals.py312 # Creating a PortMapping connecting the front and rear ports should retrace paths
MEDIUMnetbox/dcim/tests/test_views.py2658 # Create a module *without* replicating components
MEDIUMnetbox/dcim/tests/test_views.py2667 # Create a second module (in the next bay) with replicated components
MEDIUMnetbox/dcim/tests/test_views.py977 # Create the manufacturer and platform
MEDIUMnetbox/dcim/tests/test_views.py1511 # Create the manufacturer
MEDIUMnetbox/dcim/tests/test_views.py2695 # Create a module *without* replicating components
MEDIUMnetbox/dcim/tests/test_views.py2716 # Create a second module (in the next bay) with replicated components
MEDIUMnetbox/dcim/tests/test_views.py2754 # Create an interface to be adopted
MEDIUMnetbox/dcim/tests/test_views.py2761 # Create a module with adopted components
MEDIUMnetbox/dcim/tests/test_views.py2798 # Create an interface to be adopted
MEDIUMnetbox/dcim/tests/test_views.py2805 # Create a module with adopted components
MEDIUMnetbox/dcim/tests/test_views.py3321 # Create a child interface
MEDIUMnetbox/dcim/tests/test_models.py1614 # Create a module type with a rear port template
MEDIUMnetbox/dcim/tests/test_models.py1620 # Create a rear port template with 12 positions (splice)
MEDIUMnetbox/dcim/tests/test_models.py1699 # Create a module type without any port template mappings
MEDIUMnetbox/dcim/tests/test_models.py1705 # Create a rear port template
MEDIUMnetbox/dcim/tests/test_models.py456 # Create a CustomField with a default value & assign it to all component models
MEDIUMnetbox/dcim/tests/test_models.py864 # Create a disabled device bay with a device being installed
MEDIUMnetbox/dcim/tests/test_models.py905 # Create an enabled device bay with a device installed
MEDIUMnetbox/dcim/tests/test_models.py934 # Create a CustomField with a default value & assign it to all component models
MEDIUMnetbox/dcim/tests/test_models.py1749 # Create a disabled module bay
MEDIUMnetbox/dcim/tests/test_models.py2120 # Create a VirtualChassis with two member devices
MEDIUMnetbox/dcim/tests/test_models.py2165 # Create a VirtualChassis
63 more matches not shown…
Deep Nesting101 hits · 99 pts
SeverityFileLineSnippet
LOWnetbox/netbox/filtersets.py102
LOWnetbox/netbox/filtersets.py167
LOWnetbox/netbox/filtersets.py373
LOWnetbox/netbox/jobs.py99
LOWnetbox/netbox/tables/tables.py119
LOWnetbox/netbox/models/__init__.py83
LOWnetbox/netbox/models/features.py139
LOWnetbox/netbox/models/deletion.py15
LOWnetbox/netbox/search/backends.py118
LOWnetbox/netbox/search/backends.py199
LOWnetbox/netbox/graphql/pagination.py29
LOWnetbox/netbox/api/fields.py65
LOWnetbox/netbox/api/pagination.py115
LOWnetbox/netbox/views/generic/object_views.py270
LOWnetbox/netbox/views/generic/object_views.py553
LOWnetbox/netbox/views/generic/bulk_views.py314
LOWnetbox/netbox/views/generic/bulk_views.py407
LOWnetbox/netbox/views/generic/bulk_views.py475
LOWnetbox/netbox/views/generic/bulk_views.py593
LOWnetbox/netbox/views/generic/bulk_views.py686
LOWnetbox/netbox/views/generic/bulk_views.py778
LOWnetbox/netbox/views/generic/bulk_views.py912
LOWnetbox/netbox/views/generic/bulk_views.py946
LOWnetbox/netbox/views/generic/bulk_views.py1049
LOWnetbox/netbox/views/generic/bulk_views.py1172
LOWnetbox/core/signals.py88
LOWnetbox/core/signals.py165
LOWnetbox/core/models/data.py180
LOWnetbox/virtualization/forms/model_forms.py142
LOWnetbox/virtualization/forms/bulk_edit.py293
LOWnetbox/virtualization/models/virtualmachines.py288
LOWnetbox/circuits/models/circuits.py417
LOWnetbox/vpn/forms/model_forms.py462
LOWnetbox/dcim/views.py130
LOWnetbox/dcim/svg/cables.py152
LOWnetbox/dcim/svg/cables.py336
LOWnetbox/dcim/forms/model_forms.py1390
LOWnetbox/dcim/forms/model_forms.py1876
LOWnetbox/dcim/forms/connections.py12
LOWnetbox/dcim/forms/connections.py16
LOWnetbox/dcim/forms/object_create.py57
LOWnetbox/dcim/forms/common.py74
LOWnetbox/dcim/forms/bulk_edit.py1611
LOWnetbox/dcim/models/mixins.py105
LOWnetbox/dcim/models/modules.py327
LOWnetbox/dcim/models/racks.py487
LOWnetbox/dcim/models/racks.py550
LOWnetbox/dcim/models/cables.py275
LOWnetbox/dcim/models/cables.py372
LOWnetbox/dcim/models/cables.py841
LOWnetbox/dcim/api/serializers_/devices.py198
LOWnetbox/utilities/fields.py77
LOWnetbox/utilities/fields.py237
LOWnetbox/utilities/prefetch.py11
LOWnetbox/utilities/choices.py19
LOWnetbox/utilities/tracking.py62
LOWnetbox/utilities/templatetags/tabs.py20
LOWnetbox/utilities/templatetags/form_helpers.py113
LOWnetbox/utilities/templatetags/navigation.py14
LOWnetbox/utilities/templatetags/helpers.py451
41 more matches not shown…
Cross-File Repetition18 hits · 90 pts
SeverityFileLineSnippet
HIGHnetbox/netbox/tests/test_authentication.py0test enabling remote authentication with the default configuration.
HIGHnetbox/netbox/tests/test_authentication.py0test enabling remote authentication with the default configuration.
HIGHnetbox/netbox/tests/test_authentication.py0test enabling remote authentication with the default configuration.
HIGHnetbox/netbox/tests/test_authentication.py0test enabling remote authentication with the default configuration.
HIGHnetbox/netbox/views/generic/object_views.py0get request handler. args: request: the current request
HIGHnetbox/netbox/views/generic/object_views.py0get request handler. args: request: the current request
HIGHnetbox/netbox/views/generic/bulk_views.py0get request handler. args: request: the current request
HIGHnetbox/dcim/tests/test_forms.py0test that saving invalid interface mode and tagged/untagged vlans works properly
HIGHnetbox/dcim/tests/test_forms.py0test that saving invalid interface mode and tagged/untagged vlans works properly
HIGHnetbox/dcim/tests/test_forms.py0test that saving invalid interface mode and tagged/untagged vlans works properly
HIGHnetbox/dcim/tests/test_forms.py0test that saving invalid interface mode and tagged/untagged vlans works properly
HIGHnetbox/dcim/tests/test_views.py0custom import test for yaml-based imports (versus csv)
HIGHnetbox/dcim/tests/test_views.py0custom import test for yaml-based imports (versus csv)
HIGHnetbox/ipam/tests/test_views.py0custom import test for yaml-based imports (versus csv)
HIGHnetbox/ipam/fields.py0return asdot notation for as numbers greater than 16 bits.
HIGHnetbox/ipam/models/asns.py0return asdot notation for as numbers greater than 16 bits.
HIGHnetbox/ipam/models/asns.py0return asdot notation for as numbers greater than 16 bits.
HIGHnetbox/ipam/models/asns.py0return asdot notation for as numbers greater than 16 bits.
Cross-Language Confusion7 hits · 42 pts
SeverityFileLineSnippet
HIGHnetbox/netbox/api/pagination.py26 offset-based pagination. In cursor mode, `count` is omitted (null) for performance.
HIGHnetbox/dcim/forms/bulk_edit.py1629 # Query for VLANs assigned to the same site and VLANs with no site assigned (null).
HIGHnetbox/dcim/models/cables.py894 # If not null, push cable positions onto the stack
HIGHnetbox/utilities/tests/test_filter_modifiers.py113 # Simulate a query for objects with no tenant assigned (?tenant_id=null)
HIGHnetbox/extras/lookups.py55 A key is considered empty if it is "", null, or does not exist.
HIGHnetbox/extras/tests/test_models.py1236 clean() should accept a JSON object (or null) as action_data.
HIGHnetbox/extras/models/models.py146 # action_data must be a JSON object (or null)
Excessive Try-Catch Wrapping33 hits · 36 pts
SeverityFileLineSnippet
LOWnetbox/netbox/jobs.py117 except Exception as e:
LOWnetbox/netbox/tables/columns.py593 except Exception as e:
LOWnetbox/netbox/tables/columns.py602 except Exception:
MEDIUMnetbox/netbox/tables/columns.py589def render(self, record, table, **kwargs):
MEDIUMnetbox/netbox/tables/columns.py598def value(self, record, table, **kwargs):
LOWnetbox/netbox/views/misc.py47 except Exception:
LOWnetbox/netbox/views/misc.py59 except Exception:
LOWnetbox/netbox/views/generic/bulk_views.py137 except Exception as e:
LOWnetbox/core/checks.py67 except Exception:
LOWnetbox/core/apps.py47 except Exception:
LOWnetbox/core/jobs.py53 except Exception as e:
LOWnetbox/core/tables/tasks.py110 except Exception as e:
MEDIUMnetbox/core/tables/tasks.py107def render_callable(self, value, record):
LOWnetbox/core/tests/test_data_backends.py78 except Exception:
LOWnetbox/core/management/commands/syncdatasource.py41 except Exception as e:
LOWnetbox/utilities/request.py117 except Exception as e:
LOWnetbox/utilities/api.py66 except Exception:
LOWnetbox/utilities/rqworker.py45 except Exception:
MEDIUMnetbox/utilities/rqworker.py32def heartbeat(self, *args, **kwargs):
LOWnetbox/utilities/templatetags/plugins.py45 except Exception as e:
LOWnetbox/extras/jobs.py68 except Exception as e:
LOWnetbox/extras/scripts.py611 except Exception as e:
LOWnetbox/extras/webhooks.py78 except Exception as e:
LOWnetbox/extras/views.py1307 except Exception as e:
LOWnetbox/extras/templatetags/dashboard.py14 except Exception as e:
LOWnetbox/extras/templatetags/custom_links.py68 except Exception as e:
LOWnetbox/extras/templatetags/custom_links.py83 except Exception as e:
LOWnetbox/extras/forms/scripts.py89 except Exception as e:
LOWnetbox/extras/models/scripts.py140 except Exception as e:
LOWnetbox/extras/api/mixins.py50 except Exception as e:
MEDIUMnetbox/extras/api/mixins.py47def render_configtemplate(self, request, configtemplate, context):
LOWnetbox/extras/api/serializers_/scripts.py48 except Exception as e:
LOWnetbox/extras/api/serializers_/scripts.py74 except Exception:
Redundant / Tautological Comments17 hits · 26 pts
SeverityFileLineSnippet
LOWnetbox/netbox/configuration_example.py41 # Set this to True to skip TLS certificate verification
LOWnetbox/netbox/configuration_example.py57 # Set this to True to skip TLS certificate verification
LOWnetbox/netbox/plugins/urls.py25 # Check if the plugin specifies any base URLs
LOWnetbox/netbox/plugins/urls.py32 # Check if the plugin specifies any API URLs
LOWnetbox/netbox/plugins/views.py55 # Check if the plugin specifies any API URLs
LOWnetbox/netbox/views/generic/bulk_views.py614 # Iterate through data and bind each record to a new model form instance.
LOWnetbox/dcim/tests/test_models.py1591 # Assign bay2 to module1 and verify parent is now set to bay1 (module1's bay)
LOWnetbox/dcim/models/modules.py367 # Check if there's a component with the same name already
LOWnetbox/dcim/models/modules.py369 # Assign it to the module
LOWnetbox/utilities/fields.py106 # Check if the content type actually exists
LOWnetbox/utilities/templatetags/buttons.py42 # Check if this user has already bookmarked the object
LOWnetbox/utilities/templatetags/buttons.py77 # Check if this user has already subscribed to the object
LOWnetbox/utilities/templatetags/helpers.py494 # Check if this is a modifier-enhanced field
LOWnetbox/utilities/forms/fields/csv.py27 # Check if value is omitted using parent behavior
LOWnetbox/ipam/forms/model_forms.py553 # Check if we need to create a new IPAddress for the group
LOWnetbox/ipam/tests/test_filtersets.py2101 # Assign VLANs to device interfaces
LOWnetbox/ipam/tests/test_filtersets.py2109 # Assign VLANs to VM interfaces
Over-Commented Block17 hits · 17 pts
SeverityFileLineSnippet
LOWbase_requirements.txt21# Django Debug Toolbar extension for GraphiQL
LOWbase_requirements.txt41
LOWbase_requirements.txt141# Requests
LOWbase_requirements.txt161
LOWnetbox/netbox/configuration_example.py1#########################
LOWnetbox/netbox/configuration_example.py41 # Set this to True to skip TLS certificate verification
LOWnetbox/netbox/configuration_example.py61 # 'CA_CERT_PATH': '/etc/ssl/certs/ca.crt',
LOWnetbox/netbox/configuration_example.py81
LOWnetbox/netbox/configuration_example.py141}
LOWnetbox/netbox/configuration_example.py181# the default value of this setting is derived from the installed location.
LOWnetbox/netbox/configuration_example.py221
LOWnetbox/netbox/configuration_example.py241# following configuration is used:
LOWnetbox/netbox/authentication/misc.py1# Copyright (c) 2009, Peter Sagerson
LOWnetbox/core/signals.py201 objectchange.user = request.user
LOWnetbox/core/signals.py221 continue
LOWnetbox/templates/graphql/graphiql.html61
LOWnetbox/ipam/constants.py1from django.db.models import Q
Verbosity Indicators8 hits · 16 pts
SeverityFileLineSnippet
LOWnetbox/dcim/models/cables.py890 # Step 1: Record the near-end termination object(s)
LOWnetbox/dcim/models/cables.py898 # Step 2: Determine the attached links (Cable or WirelessLink), if any
LOWnetbox/dcim/models/cables.py914 # Step 3: Record asymmetric paths as split
LOWnetbox/dcim/models/cables.py920 # Step 4: Record the links, keeping cables in order to allow for SVG rendering
LOWnetbox/dcim/models/cables.py927 # Step 5: Update the path status if a link is not connected
LOWnetbox/dcim/models/cables.py932 # Step 6: Determine the far-end terminations
LOWnetbox/dcim/models/cables.py1022 # Step 7: Record the far-end termination object(s)
LOWnetbox/dcim/models/cables.py1027 # Step 8: Determine the "next hop" terminations, if applicable
AI Slop Vocabulary6 hits · 15 pts
SeverityFileLineSnippet
MEDIUMnetbox/netbox/search/backends.py190 # Omit any results pertaining to an object the user does not have permission to view
MEDIUMnetbox/core/signals.py120 # This will impact changes that utilize clear() however so we may want to give consideration for this branch
MEDIUMnetbox/core/models/data.py356 # TODO: Something more robust
LOWnetbox/core/api/schema.py137 # if not bulk - just return normal id
MEDIUMnetbox/dcim/models/cables.py226 # Query self.terminations.all() to leverage cached results
LOWnetbox/utilities/paginator.py48 # When dealing with five or fewer pages, simply return the whole list.
Fake / Example Data7 hits · 9 pts
SeverityFileLineSnippet
LOWnetbox/netbox/configuration_example.py91 # ('John Doe', 'jdoe@example.com'),
LOWnetbox/netbox/tests/test_search.py23 comments='Lorem ipsum etcetera'
LOWnetbox/netbox/tests/test_search.py32 comments='Lorem ipsum etcetera'
LOWnetbox/netbox/tests/test_search.py41 comments='Lorem ipsum etcetera'
LOWnetbox/netbox/tests/test_search.py104 comments='Lorem ipsum etcetera'
LOWnetbox/extras/tests/test_management_commands.py251 email='admin@example.com',
LOWdocs/plugins/development/index.md167 {name = "John Doe", email = "test@netboxlabs.com"},
Decorative Section Separators2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMnetbox/project-static/styles/custom/_misc.scss100// ── Sticky action bars ──────────────────────────────────────
MEDIUMnetbox/project-static/styles/custom/_misc.scss182// ── /Sticky action bars ─────────────────────────────────────
Docstring Block Structure1 hit · 5 pts
SeverityFileLineSnippet
HIGHnetbox/utilities/templatetags/helpers.py98 Render the action URL node. Args: context: The template context Returns:
Slop Phrases2 hits · 3 pts
SeverityFileLineSnippet
LOWupgrade.sh150echo "Upgrade complete! Don't forget to restart the NetBox services:"
MEDIUMnetbox/extras/constants.py109 'This is your personal dashboard. Feel free to customize it by rearranging, resizing, or removing '
Overly Generic Function Names1 hit · 2 pts
SeverityFileLineSnippet
LOWnetbox/netbox/tests/test_model_test_coverage.py278 def helper(self):