Repository Analysis

networkx/networkx

Network Analysis in Python

19.8 Moderate AI signal View on GitHub
19.8
Adjusted Score
19.8
Raw Score
100%
Time Factor
2026-05-30
Last Push
16,968
Stars
Python
Language
206,168
Lines of Code
747
Files
3173
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 160MEDIUM 115LOW 2898

Pattern Findings

3173 matches across 14 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers2069 hits · 2194 pts
SeverityFileLineSnippet
LOWnetworkx/conftest.py78def pytest_collection_modifyitems(config, items):
LOWnetworkx/relabel.py227def convert_node_labels_to_integers(
LOWnetworkx/readwrite/gexf.py707 def alter_graph_mode_timeformat(self, start_or_end):
LOWnetworkx/readwrite/multiline_adjlist.py39def generate_multiline_adjlist(G, delimiter=" "):
LOWnetworkx/readwrite/json_graph/tests/test_adjacency.py61 def test_input_data_is_not_modified_when_building_graph(self):
LOWnetworkx/readwrite/json_graph/tests/test_adjacency.py69 def test_adjacency_form_json_serialisable(self):
LOWnetworkx/readwrite/json_graph/tests/test_node_link.py52 def test_graph_with_tuple_nodes(self):
LOWnetworkx/readwrite/json_graph/tests/test_cytoscape.py16def test_input_data_is_not_modified_when_building_graph():
LOWnetworkx/readwrite/tests/test_graph6.py40 def test_read_equals_from_bytes(self):
LOWnetworkx/readwrite/tests/test_graph6.py78 def test_large_complete_graph(self):
LOWnetworkx/readwrite/tests/test_graph6.py88 def test_complete_bipartite_graph(self):
LOWnetworkx/readwrite/tests/test_graph6.py96 def test_no_directed_or_multi_graphs(self, G):
LOWnetworkx/readwrite/tests/test_graph6.py146 def test_large_complete_graph(self):
LOWnetworkx/readwrite/tests/test_graph6.py154 def test_complete_bipartite_graph(self):
LOWnetworkx/readwrite/tests/test_graph6.py159 def test_no_directed_or_multi_graphs(self, G):
LOWnetworkx/readwrite/tests/test_gexf.py44def test_dynamic_graph_has_timeformat(time_attr, dyn_attr, tmp_path):
LOWnetworkx/readwrite/tests/test_gexf.py191 def test_read_simple_directed_graphml(self):
LOWnetworkx/readwrite/tests/test_gexf.py199 def test_write_read_simple_directed_graphml(self):
LOWnetworkx/readwrite/tests/test_gexf.py210 def test_read_simple_undirected_graphml(self):
LOWnetworkx/readwrite/tests/test_gexf.py219 def test_read_attribute_graphml(self):
LOWnetworkx/readwrite/tests/test_gexf.py230 def test_directed_edge_in_undirected(self):
LOWnetworkx/readwrite/tests/test_gexf.py247 def test_undirected_edge_in_directed(self):
LOWnetworkx/readwrite/tests/test_gexf.py324 def test_serialize_ints_to_strings(self):
LOWnetworkx/readwrite/tests/test_gexf.py334 def test_write_with_node_attributes(self):
LOWnetworkx/readwrite/tests/test_gexf.py518 def test_multigraph_with_missing_attributes(self):
LOWnetworkx/readwrite/tests/test_gexf.py534 def test_missing_viz_attributes(self):
LOWnetworkx/readwrite/tests/test_gexf.py616 def test_round_trip_mixed_type_float_to_string(self):
LOWnetworkx/readwrite/tests/test_gexf.py628 def test_round_trip_mixed_type_int_to_string(self):
LOWnetworkx/readwrite/tests/test_gexf.py640 def test_type_promotion_integer_to_integer(self):
LOWnetworkx/readwrite/tests/test_gexf.py655 def test_type_promotion_float_to_float(self):
LOWnetworkx/readwrite/tests/test_gexf.py670 def test_meta_description_keywords_round_trip(self):
LOWnetworkx/readwrite/tests/test_sparse6.py50 def test_from_bytes_multigraph_graph(self):
LOWnetworkx/readwrite/tests/test_sparse6.py110 def test_very_large_empty_graph(self):
LOWnetworkx/readwrite/tests/test_gml.py59 def test_parse_gml_cytoscape_bug(self):
LOWnetworkx/readwrite/tests/test_gml.py640 def test_writing_graph_with_multi_element_property_list(self):
LOWnetworkx/readwrite/tests/test_gml.py664 def test_writing_graph_with_one_element_property_list(self):
LOWnetworkx/readwrite/tests/test_gml.py684 def test_reading_graph_with_list_property(self):
LOWnetworkx/readwrite/tests/test_gml.py706 def test_reading_graph_with_single_element_list_property(self):
LOWnetworkx/readwrite/tests/test_gml.py728def test_stringize_empty_list_tuple(coll):
LOWnetworkx/readwrite/tests/test_edgelist.py80def test_read_edgelist_no_data(data, extra_kwargs):
LOWnetworkx/readwrite/tests/test_edgelist.py86def test_read_weighted_edgelist():
LOWnetworkx/readwrite/tests/test_edgelist.py104def test_read_edgelist_with_data(data, extra_kwargs, expected):
LOWnetworkx/readwrite/tests/test_edgelist.py117def test_parse_edgelist_no_data(example_graph):
LOWnetworkx/readwrite/tests/test_edgelist.py124def test_parse_edgelist_with_data_dict(example_graph):
LOWnetworkx/readwrite/tests/test_edgelist.py133def test_parse_edgelist_with_data_list(example_graph):
LOWnetworkx/readwrite/tests/test_edgelist.py293 def test_edgelist_multidigraph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_edgelist.py304def test_edgelist_consistent_strip_handling():
LOWnetworkx/readwrite/tests/test_adjlist.py59 def test_multiple_edges_undirected(self):
LOWnetworkx/readwrite/tests/test_adjlist.py69 def test_multiple_edges_directed(self):
LOWnetworkx/readwrite/tests/test_adjlist.py83 def test_multiple_edges_with_data(self):
LOWnetworkx/readwrite/tests/test_adjlist.py209 def test_adjlist_multidigraph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py243 def test_parse_multiline_adjlist(self):
LOWnetworkx/readwrite/tests/test_adjlist.py270 def test_multiline_adjlist_graph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py280 def test_multiline_adjlist_digraph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py290 def test_multiline_adjlist_integers(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py300 def test_multiline_adjlist_multigraph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py312 def test_multiline_adjlist_multidigraph(self, tmp_path):
LOWnetworkx/readwrite/tests/test_adjlist.py326 def test_multiline_adjlist_delimiter(self):
LOWnetworkx/readwrite/tests/test_adjlist.py351def test_adjlist_rstrip_parsing(lines, delim):
LOWnetworkx/readwrite/tests/test_text.py10def test_generate_network_text_forest_directed():
2009 more matches not shown…
Cross-Language Confusion118 hits · 590 pts
SeverityFileLineSnippet
HIGHnetworkx/algorithms/simple_paths.py539 listB.push(length, path)
HIGHnetworkx/algorithms/simple_paths.py559 listB.push(root_length + length, path)
HIGHnetworkx/algorithms/operators/tests/test_unary.py26 nullcc = nx.complement(nx.complement(null))
HIGHnetworkx/algorithms/operators/tests/test_unary.py27 assert nx.is_isomorphic(null, nullcc)
HIGHnetworkx/algorithms/operators/tests/test_product.py20 G = nx.tensor_product(null, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py21 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py23 G = nx.tensor_product(null, empty10)
HIGHnetworkx/algorithms/operators/tests/test_product.py24 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py25 G = nx.tensor_product(null, K3)
HIGHnetworkx/algorithms/operators/tests/test_product.py26 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py27 G = nx.tensor_product(null, K10)
HIGHnetworkx/algorithms/operators/tests/test_product.py28 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py29 G = nx.tensor_product(null, P3)
HIGHnetworkx/algorithms/operators/tests/test_product.py30 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py31 G = nx.tensor_product(null, P10)
HIGHnetworkx/algorithms/operators/tests/test_product.py32 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py33 G = nx.tensor_product(empty10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py34 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py35 G = nx.tensor_product(K3, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py36 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py37 G = nx.tensor_product(K10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py38 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py39 G = nx.tensor_product(P3, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py40 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py41 G = nx.tensor_product(P10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py42 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py138 G = nx.cartesian_product(null, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py139 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py141 G = nx.cartesian_product(null, empty10)
HIGHnetworkx/algorithms/operators/tests/test_product.py142 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py143 G = nx.cartesian_product(null, K3)
HIGHnetworkx/algorithms/operators/tests/test_product.py144 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py145 G = nx.cartesian_product(null, K10)
HIGHnetworkx/algorithms/operators/tests/test_product.py146 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py147 G = nx.cartesian_product(null, P3)
HIGHnetworkx/algorithms/operators/tests/test_product.py148 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py149 G = nx.cartesian_product(null, P10)
HIGHnetworkx/algorithms/operators/tests/test_product.py150 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py151 G = nx.cartesian_product(empty10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py152 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py153 G = nx.cartesian_product(K3, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py154 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py155 G = nx.cartesian_product(K10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py156 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py157 G = nx.cartesian_product(P3, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py158 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py159 G = nx.cartesian_product(P10, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py160 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py222 G = nx.lexicographic_product(null, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py223 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py225 G = nx.lexicographic_product(null, empty10)
HIGHnetworkx/algorithms/operators/tests/test_product.py226 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py227 G = nx.lexicographic_product(null, K3)
HIGHnetworkx/algorithms/operators/tests/test_product.py228 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py229 G = nx.lexicographic_product(null, K10)
HIGHnetworkx/algorithms/operators/tests/test_product.py230 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py231 G = nx.lexicographic_product(null, P3)
HIGHnetworkx/algorithms/operators/tests/test_product.py232 assert nx.is_isomorphic(G, null)
HIGHnetworkx/algorithms/operators/tests/test_product.py233 G = nx.lexicographic_product(null, P10)
HIGHnetworkx/algorithms/operators/tests/test_product.py234 assert nx.is_isomorphic(G, null)
58 more matches not shown…
Unused Imports418 hits · 354 pts
SeverityFileLineSnippet
LOWnetworkx/conftest.py137
LOWnetworkx/conftest.py144
LOWnetworkx/conftest.py151
LOWnetworkx/conftest.py158
LOWnetworkx/conftest.py165
LOWnetworkx/conftest.py172
LOWnetworkx/conftest.py179
LOWnetworkx/convert.py161
LOWnetworkx/__init__.py15
LOWnetworkx/__init__.py17
LOWnetworkx/__init__.py20
LOWnetworkx/__init__.py20
LOWnetworkx/__init__.py26
LOWnetworkx/__init__.py27
LOWnetworkx/__init__.py28
LOWnetworkx/__init__.py30
LOWnetworkx/__init__.py31
LOWnetworkx/__init__.py33
LOWnetworkx/__init__.py34
LOWnetworkx/__init__.py36
LOWnetworkx/__init__.py37
LOWnetworkx/__init__.py39
LOWnetworkx/__init__.py40
LOWnetworkx/__init__.py42
LOWnetworkx/__init__.py43
LOWnetworkx/__init__.py46
LOWnetworkx/__init__.py47
LOWnetworkx/__init__.py49
LOWnetworkx/__init__.py50
LOWnetworkx/__init__.py52
LOWnetworkx/__init__.py53
LOWnetworkx/readwrite/__init__.py6
LOWnetworkx/readwrite/__init__.py7
LOWnetworkx/readwrite/__init__.py8
LOWnetworkx/readwrite/__init__.py9
LOWnetworkx/readwrite/__init__.py10
LOWnetworkx/readwrite/__init__.py11
LOWnetworkx/readwrite/__init__.py12
LOWnetworkx/readwrite/__init__.py13
LOWnetworkx/readwrite/__init__.py14
LOWnetworkx/readwrite/__init__.py15
LOWnetworkx/readwrite/__init__.py16
LOWnetworkx/readwrite/__init__.py17
LOWnetworkx/readwrite/json_graph/__init__.py16
LOWnetworkx/readwrite/json_graph/__init__.py17
LOWnetworkx/readwrite/json_graph/__init__.py18
LOWnetworkx/readwrite/json_graph/__init__.py19
LOWnetworkx/readwrite/tests/test_graphml.py1103
LOWnetworkx/drawing/__init__.py3
LOWnetworkx/drawing/__init__.py4
LOWnetworkx/drawing/__init__.py5
LOWnetworkx/drawing/__init__.py6
LOWnetworkx/drawing/__init__.py7
LOWnetworkx/drawing/nx_pylab.py1483
LOWnetworkx/drawing/nx_pylab.py1953
LOWnetworkx/drawing/nx_pylab.py1954
LOWnetworkx/drawing/nx_pylab.py2959
LOWnetworkx/drawing/nx_pylab.py2960
LOWnetworkx/drawing/nx_pylab.py1627
LOWnetworkx/drawing/nx_pylab.py1551
358 more matches not shown…
Deep Nesting276 hits · 275 pts
SeverityFileLineSnippet
LOWnetworkx/relabel.py130
LOWnetworkx/relabel.py193
LOWnetworkx/relabel.py227
LOWnetworkx/convert.py34
LOWnetworkx/convert.py213
LOWnetworkx/convert.py253
LOWnetworkx/convert.py374
LOWnetworkx/convert_matrix.py496
LOWnetworkx/convert_matrix.py893
LOWnetworkx/readwrite/gexf.py440
LOWnetworkx/readwrite/gexf.py508
LOWnetworkx/readwrite/gexf.py707
LOWnetworkx/readwrite/gexf.py1035
LOWnetworkx/readwrite/gexf.py441
LOWnetworkx/readwrite/gml.py298
LOWnetworkx/readwrite/gml.py528
LOWnetworkx/readwrite/gml.py629
LOWnetworkx/readwrite/gml.py301
LOWnetworkx/readwrite/gml.py377
LOWnetworkx/readwrite/gml.py553
LOWnetworkx/readwrite/gml.py714
LOWnetworkx/readwrite/sparse6.py105
LOWnetworkx/readwrite/multiline_adjlist.py39
LOWnetworkx/readwrite/multiline_adjlist.py196
LOWnetworkx/readwrite/text.py73
LOWnetworkx/readwrite/pajek.py167
LOWnetworkx/readwrite/graphml.py506
LOWnetworkx/readwrite/graphml.py961
LOWnetworkx/readwrite/edgelist.py43
LOWnetworkx/readwrite/edgelist.py177
LOWnetworkx/readwrite/json_graph/adjacency.py8
LOWnetworkx/readwrite/tests/test_text.py1672
LOWnetworkx/drawing/layout.py1608
LOWnetworkx/drawing/nx_agraph.py119
LOWnetworkx/drawing/nx_pylab.py257
LOWnetworkx/drawing/nx_pylab.py170
LOWnetworkx/linalg/algebraicconnectivity.py256
LOWnetworkx/linalg/attrmatrix.py55
LOWnetworkx/linalg/attrmatrix.py147
LOWnetworkx/linalg/attrmatrix.py312
LOWnetworkx/classes/graph.py2012
LOWnetworkx/classes/multigraph.py538
LOWnetworkx/classes/reportviews.py1089
LOWnetworkx/classes/reportviews.py1502
LOWnetworkx/classes/function.py621
LOWnetworkx/classes/function.py760
LOWnetworkx/classes/function.py797
LOWnetworkx/classes/function.py979
LOWnetworkx/classes/function.py1308
LOWnetworkx/classes/tests/dispatch_interface.py67
LOWnetworkx/algorithms/planarity.py449
LOWnetworkx/algorithms/planarity.py502
LOWnetworkx/algorithms/planarity.py535
LOWnetworkx/algorithms/planarity.py584
LOWnetworkx/algorithms/planarity.py694
LOWnetworkx/algorithms/planarity.py1009
LOWnetworkx/algorithms/planarity.py1084
LOWnetworkx/algorithms/bridges.py146
LOWnetworkx/algorithms/regular.py76
LOWnetworkx/algorithms/smallworld.py28
216 more matches not shown…
Cross-File Repetition40 hits · 200 pts
SeverityFileLineSnippet
HIGHnetworkx/readwrite/tests/test_text.py0walk through the cases going from a disconnected to fully connected graph
HIGHnetworkx/readwrite/tests/test_text.py0walk through the cases going from a disconnected to fully connected graph
HIGHnetworkx/readwrite/tests/test_text.py0walk through the cases going from a disconnected to fully connected graph
HIGHnetworkx/readwrite/tests/test_graphml.py0test that a detailed exception is raised when an attribute is of a type not supported by graphml, e.g. a list
HIGHnetworkx/readwrite/tests/test_graphml.py0test that a detailed exception is raised when an attribute is of a type not supported by graphml, e.g. a list
HIGHnetworkx/readwrite/tests/test_graphml.py0test that a detailed exception is raised when an attribute is of a type not supported by graphml, e.g. a list
HIGHnetworkx/classes/graph.py0returns true if graph is a multigraph, false otherwise.
HIGHnetworkx/classes/multigraph.py0returns true if graph is a multigraph, false otherwise.
HIGHnetworkx/classes/multidigraph.py0returns true if graph is a multigraph, false otherwise.
HIGHnetworkx/classes/digraph.py0returns true if graph is a multigraph, false otherwise.
HIGHnetworkx/classes/graph.py0returns true if graph is directed, false otherwise.
HIGHnetworkx/classes/multigraph.py0returns true if graph is directed, false otherwise.
HIGHnetworkx/classes/multidigraph.py0returns true if graph is directed, false otherwise.
HIGHnetworkx/classes/digraph.py0returns true if graph is directed, false otherwise.
HIGHnetworkx/classes/tests/test_multigraph.py0tests that adding a node to the original graph does not affect the nodes of the subgraph.
HIGHnetworkx/classes/tests/test_graph.py0tests that adding a node to the original graph does not affect the nodes of the subgraph.
HIGHnetworkx/classes/tests/test_subgraphviews.py0tests that adding a node to the original graph does not affect the nodes of the subgraph.
HIGHnetworkx/classes/tests/test_multigraph.py0tests that the node attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_graph.py0tests that the node attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_subgraphviews.py0tests that the node attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_multigraph.py0tests that the edge attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_graph.py0tests that the edge attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_subgraphviews.py0tests that the edge attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_multigraph.py0tests that the graph attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_graph.py0tests that the graph attribute dictionary of the two graphs is the same object.
HIGHnetworkx/classes/tests/test_subgraphviews.py0tests that the graph attribute dictionary of the two graphs is the same object.
HIGHnetworkx/algorithms/tests/test_structuralholes.py0behavior consistent with isolated node without self-loop. see gh-6916
HIGHnetworkx/algorithms/tests/test_structuralholes.py0behavior consistent with isolated node without self-loop. see gh-6916
HIGHnetworkx/algorithms/tests/test_structuralholes.py0behavior consistent with isolated node without self-loop. see gh-6916
HIGHnetworkx/generators/tests/test_geometric.py0tests that pairs of vertices adjacent if and only if they are within the prescribed radius.
HIGHnetworkx/generators/tests/test_geometric.py0tests that pairs of vertices adjacent if and only if they are within the prescribed radius.
HIGHnetworkx/generators/tests/test_geometric.py0tests that pairs of vertices adjacent if and only if they are within the prescribed radius.
HIGHnetworkx/generators/tests/test_geometric.py0tests for providing an alternate distance metric to the generator.
HIGHnetworkx/generators/tests/test_geometric.py0tests for providing an alternate distance metric to the generator.
HIGHnetworkx/generators/tests/test_geometric.py0tests for providing an alternate distance metric to the generator.
HIGHnetworkx/generators/tests/test_geometric.py0tests for providing an alternate distance metric to the generator.
HIGHnetworkx/generators/tests/test_geometric.py0tests for providing an alternate distance metric to the generator.
HIGHnetworkx/generators/tests/test_geometric.py0tests using values other than sequential numbers as node ids.
HIGHnetworkx/generators/tests/test_geometric.py0tests using values other than sequential numbers as node ids.
HIGHnetworkx/generators/tests/test_geometric.py0tests using values other than sequential numbers as node ids.
Self-Referential Comments73 hits · 196 pts
SeverityFileLineSnippet
MEDIUMnetworkx/convert_matrix.py861 # Create an iterable over (u, v, w) triples and for each triple, add an
MEDIUMnetworkx/readwrite/tests/test_text.py11 # Create a directed forest with labels
MEDIUMnetworkx/readwrite/tests/test_text.py225 # Create a directed forest
MEDIUMnetworkx/readwrite/tests/test_text.py1375 # Create a directed forest with labels
MEDIUMnetworkx/drawing/nx_pylab.py1346 # Create a set with all valid keywords across the three functions and
MEDIUMnetworkx/drawing/tests/test_agraph.py64 # Create an AGraph from an existing (non-multi) Graph
MEDIUM…workx/drawing/tests/test_image_comparison_pylab_mpl.py173 # Create a list of edges in the shortest path
MEDIUMnetworkx/drawing/tests/test_pylab.py1200 # Create a single axis object to get consistent pixel coords across
MEDIUMnetworkx/drawing/tests/test_pylab.py1247 # Create a single axis object to get consistent pixel coords across
MEDIUMnetworkx/linalg/spectrum.py48 >>> G = nx.Graph() # Create a graph with 5 nodes and 3 connected components
MEDIUMnetworkx/classes/graph.py1829 # Create a subgraph SG based on a (possibly multigraph) G
MEDIUMnetworkx/classes/tests/test_multidigraph.py399 # Create a quadruply-linked path graph on five nodes.
MEDIUMnetworkx/classes/tests/test_multigraph.py413 # Create a doubly-linked path graph on five nodes.
MEDIUMnetworkx/classes/tests/dispatch_interface.py1# This file contains utilities for testing the dispatching feature
MEDIUMnetworkx/classes/tests/test_graph.py860 # Create a path graph on five nodes.
MEDIUMnetworkx/classes/tests/test_subgraphviews.py276 # Create a path graph on five nodes.
MEDIUMnetworkx/classes/tests/test_digraph.py307 # Create a doubly-linked path graph on five nodes.
MEDIUMnetworkx/algorithms/richclub.py118 # Create a sorted list of pairs of edge endpoint degrees.
MEDIUMnetworkx/algorithms/chains.py85 # Create a directed graph from the depth-first search tree with
MEDIUMnetworkx/algorithms/chains.py149 # Create a directed version of H that has the DFS edges directed
MEDIUMnetworkx/algorithms/chains.py169 # Create the cycle or cycle prefix starting with the
MEDIUMnetworkx/algorithms/node_classification.py1"""This module provides the functions for node classification problem.
MEDIUMnetworkx/algorithms/tree/branchings.py543 # Create a new graph of the same class as the input graph
MEDIUMnetworkx/algorithms/isomorphism/vf2pp.py573 # Create the labels dicts based on node_label and default_label
MEDIUMnetworkx/algorithms/isomorphism/vf2pp.py578 # Create the degree dicts based on graph type
MEDIUMnetworkx/algorithms/link_analysis/pagerank_alg.py130 # Create a copy in (right) stochastic form
MEDIUMnetworkx/algorithms/connectivity/disjoint_paths.py7# Define the default maximum flow function to use for the underlying
MEDIUMnetworkx/algorithms/connectivity/connectivity.py10# Define the default maximum flow function to use in all flow based
MEDIUMnetworkx/algorithms/connectivity/edge_kcomponents.py376 # This class is a container the holds the auxiliary graph A and
MEDIUMnetworkx/algorithms/connectivity/edge_kcomponents.py408 # Create a relevant graph with the auxiliary edges with weights >= k
MEDIUMnetworkx/algorithms/connectivity/edge_kcomponents.py444 # Create a relevant graph with the auxiliary edges with weights >= k
MEDIUMnetworkx/algorithms/connectivity/kcomponents.py11# Define the default maximum flow function.
MEDIUMnetworkx/algorithms/connectivity/cuts.py9# Define the default maximum flow function to use in all flow based
MEDIUMnetworkx/algorithms/approximation/steinertree.py107 # Create a complete graph H from the metric edges
MEDIUMnetworkx/algorithms/approximation/steinertree.py130 # Create an iterator over each edge in each shortest path; repeats are okay
MEDIUMnetworkx/algorithms/approximation/traveling_salesman.py465 # Create the undirected support of z_star
MEDIUMnetworkx/algorithms/approximation/traveling_salesman.py472 # Create the exponential distribution of spanning trees
MEDIUMnetworkx/algorithms/approximation/traveling_salesman.py577 # Create a copy of G without vertex 1.
MEDIUMnetworkx/algorithms/approximation/traveling_salesman.py885 # Create the laplacian matrices
MEDIUM…kx/algorithms/approximation/tests/test_vertex_cover.py17 # Create a star graph in which half the nodes are directed in
MEDIUM…/algorithms/approximation/tests/test_dominating_set.py36 # Create a star graph in which the center node has the highest
MEDIUMnetworkx/algorithms/tests/test_dag.py51 # Create the directed path graph on four nodes in a diamond shape,
MEDIUMnetworkx/algorithms/tests/test_core.py44 # Create the graph H resulting from the degree sequence
MEDIUMnetworkx/algorithms/tests/test_matching.py536 # Create the path graph with two self-loops.
MEDIUMnetworkx/algorithms/bipartite/matrix.py191 # Create an iterable over (u, v, w) triples and for each triple, add an
MEDIUMnetworkx/algorithms/bipartite/__init__.py1r"""This module provides functions and operations for bipartite
MEDIUMnetworkx/algorithms/bipartite/tests/test_matching.py160 # Create a bipartite graph based on the transitive closure of G
MEDIUMnetworkx/algorithms/shortest_paths/tests/test_astar.py234 # Create the cycle graph on four nodes, with nodes represented
MEDIUM…workx/algorithms/shortest_paths/tests/test_weighted.py363 # Create a triangle in which the edge from node 0 to node 2 has
MEDIUM…workx/algorithms/shortest_paths/tests/test_weighted.py429 # Create a triangle in which the edge from node 0 to node 2 has
MEDIUMnetworkx/algorithms/community/label_propagation.py268 # Create a unique label for each node in the graph
MEDIUMnetworkx/algorithms/flow/maxflow.py14# Define the default flow function for computing maximum flow.
MEDIUMnetworkx/generators/social.py47 # Create the set of all members, and the members of each club.
MEDIUMnetworkx/generators/geometric.py1021 # Create an edge with a certain connection probability
MEDIUMnetworkx/generators/line.py141 # Create a graph specific edge function.
MEDIUMnetworkx/generators/trees.py496# The following functions support generation of unlabeled trees and forests.
MEDIUMexamples/3d_drawing/plot_3d_animation_walk.py21# Define a graph to plot.
MEDIUMexamples/3d_drawing/plot_basic.py24# Create the 3D figure
MEDIUMexamples/3d_drawing/plot_3d_animation_basic.py19# Define a graph to plot.
MEDIUMexamples/drawing/plot_ego_graph.py15# Create a BA model graph - use seed for reproducibility
13 more matches not shown…
Decorative Section Separators40 hits · 117 pts
SeverityFileLineSnippet
MEDIUMnetworkx/drawing/nx_pylab.py2102 # ---------------------------------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py10# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py12# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py132# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py134# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py188# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py190# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py422# ----------------
MEDIUM…algorithms/connectivity/tests/test_edge_kcomponents.py424# ----------------
MEDIUMnetworkx/algorithms/tests/test_max_weight_clique.py168# --------------------------------------------------------------------------
MEDIUMnetworkx/algorithms/coloring/tests/test_coloring.py785# --------------------------------------------------------------------------
MEDIUMnetworkx/algorithms/coloring/tests/test_coloring.py797# --------------------------------------------------------------------------
MEDIUMnetworkx/algorithms/coloring/tests/test_coloring.py829# --------------------------------------------------------------------------
MEDIUMnetworkx/generators/classic.py45# -------------------------------------------------------------------
MEDIUMnetworkx/generators/classic.py47# -------------------------------------------------------------------
MEDIUMnetworkx/generators/small.py141# -------------------------------------------------------------------------------
MEDIUMnetworkx/generators/small.py143# -------------------------------------------------------------------------------
MEDIUMexamples/3d_drawing/plot_3d_animation_walk.py22# -----------------------
MEDIUMexamples/3d_drawing/plot_3d_animation_walk.py33# -------------------------------------------
MEDIUMexamples/3d_drawing/plot_3d_animation_basic.py20# -----------------------
MEDIUMexamples/3d_drawing/plot_3d_animation_basic.py31# ----------------------------
MEDIUM…ms/plot_image_segmentation_spectral_graph_partition.py27# -----------------------------------------
MEDIUM…ms/plot_image_segmentation_spectral_graph_partition.py52# ---------------------------------
MEDIUM…ms/plot_image_segmentation_spectral_graph_partition.py66# --------------------------------------------------
MEDIUM…ms/plot_image_segmentation_spectral_graph_partition.py92# -------------------------------
MEDIUM…ms/plot_image_segmentation_spectral_graph_partition.py140# --------------------------------
MEDIUMexamples/algorithms/plot_circuits.py60# ----------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py81# ---------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py108# ------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py122# ------------------------------------------------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py128# ---------------------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py143# ---------------------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py154# --------------------------------------------------------------------------
MEDIUMexamples/algorithms/plot_subgraphs.py160# -----------------------------
MEDIUMexamples/algorithms/plot_beam_search.py75# ---------------------------------------
MEDIUMexamples/external/plot_igraph.py16# ------------------
MEDIUMexamples/external/plot_igraph.py46# ------------------
MEDIUMdoc/conf.py12# ---------------------
MEDIUMdoc/conf.py133# -----------------------
MEDIUMdoc/conf.py213# ------------------------
Over-Commented Block62 hits · 60 pts
SeverityFileLineSnippet
LOWnetworkx/convert_matrix.py861 # Create an iterable over (u, v, w) triples and for each triple, add an
LOWnetworkx/readwrite/text.py341 # (1) children to traverse into after showing this node.
LOWnetworkx/drawing/layout.py681
LOWnetworkx/linalg/attrmatrix.py121 else:
LOWnetworkx/algorithms/chains.py81
LOWnetworkx/algorithms/chains.py141 visited.add(v)
LOWnetworkx/algorithms/distance_regular.py261 # Here is an alternate implementation based directly on the
LOWnetworkx/algorithms/matching.py381 # The algorithm is taken from "Efficient Algorithms for Finding Maximum
LOWnetworkx/algorithms/matching.py441 mate = {}
LOWnetworkx/algorithms/matching.py461
LOWnetworkx/algorithms/matching.py481 # If b is a (possibly trivial) top-level S-blossom,
LOWnetworkx/algorithms/cycles.py601 # must not construct longer cycles along (u, v).
LOWnetworkx/algorithms/tree/branchings.py281 # These are the buckets from the paper.
LOWnetworkx/algorithms/tree/branchings.py301
LOWnetworkx/algorithms/tree/branchings.py521
LOWnetworkx/algorithms/tree/mst.py101 minwt = wt
LOWnetworkx/algorithms/tree/mst.py121 # component was empty, so that part of the forest has been
LOWnetworkx/algorithms/tree/mst.py841 # The result is a MultiGraph version of G so that parallel edges are
LOWnetworkx/algorithms/tree/mst.py901 # There are two cases for the total spanning tree additive weight.
LOWnetworkx/algorithms/tree/tests/test_mst.py621 # expect to see each tree. This test uses a near minimum sample size where
LOWnetworkx/algorithms/tree/tests/test_mst.py741
LOWnetworkx/algorithms/isomorphism/tree_isomorphism.py141 # each node has a label, initially set to 0
LOWnetworkx/algorithms/isomorphism/isomorphvf2.py501 This function returns True if it is adding the candidate pair
LOWnetworkx/algorithms/isomorphism/isomorphvf2.py701 # core_1[n] contains the index of the node paired with n, which is m,
LOWnetworkx/algorithms/isomorphism/isomorphvf2.py741 # Basically, when we test the look-ahead rules R_pred and R_succ, we
LOWnetworkx/algorithms/isomorphism/vf2pp.py481
LOWnetworkx/algorithms/isomorphism/tests/test_common.py41# vf2pp_subgraph_isomorphism()
LOWnetworkx/algorithms/isomorphism/tests/test_ismags.py101 id="katebi-paper-fig2",
LOWnetworkx/algorithms/connectivity/edge_augmentation.py761 >>> G = nx.Graph([(0, 1), (0, 2), (1, 2)])
LOWnetworkx/algorithms/connectivity/edge_augmentation.py941
LOWnetworkx/algorithms/connectivity/kcutsets.py141 # and step 5: build the associated residual network R
LOW…orithms/approximation/tests/test_traveling_salesman.py781 )
LOW…kx/algorithms/centrality/tests/test_load_centrality.py261 for n in sorted(G):
LOWnetworkx/algorithms/tests/test_cycles.py621 }
LOWnetworkx/algorithms/tests/test_dag.py741 assert not nx.is_arborescence(B)
LOWnetworkx/algorithms/tests/test_richclub.py141# T = nx.balanced_tree(2,10)
LOWnetworkx/algorithms/tests/test_wiener.py21 # In P_n, there are n - 1 pairs of vertices at distance one, n -
LOWnetworkx/algorithms/bipartite/matching.py281 # for u in G:
LOWnetworkx/algorithms/traversal/beamsearch.py81 #
LOWnetworkx/algorithms/community/leiden.py601 continue
LOWnetworkx/algorithms/community/leiden.py621
LOWnetworkx/algorithms/community/tests/test_quality.py481 # (0,1)=2, (1,2)=3, (0,2)=1
LOWnetworkx/algorithms/flow/utils.py121 ]
LOWnetworkx/algorithms/flow/tests/test_maxflow.py121 # H
LOWnetworkx/algorithms/flow/tests/test_maxflow.py401 # flow solution using capacity=my_cap
LOWnetworkx/utils/backends.py1# Notes about NetworkX namespace objects set up here:
LOWnetworkx/utils/backends.py821 # ##########################
LOWnetworkx/utils/backends.py841 # `backend_priority` before running with the default "networkx" implementation.
LOWnetworkx/utils/backends.py861 # +-------+-------+
LOWnetworkx/utils/backends.py901 group3 = graph_backend_names - seen
LOWnetworkx/utils/decorators.py961 # in addition to some try-blocks if needed.
LOWnetworkx/generators/expanders.py21#
LOWnetworkx/generators/atlas.py21#: This is the absolute path of the gzipped text file containing the
LOWnetworkx/generators/atlas.py41#: import gzip
LOWexamples/algorithms/plot_subgraphs.py141###############################################################################
LOWexamples/algorithms/plot_beam_search.py61 width = initial_width * pow(2, i)
LOWexamples/geospatial/plot_points.py21# are a format for storing geographic data that is backed
LOWexamples/geospatial/plot_polygons.py21# used as a file format for geographic data.
LOWexamples/geospatial/plot_delaunay.py21# read in example data from a geopackage file. Geopackages
LOWexamples/geospatial/plot_delaunay.py41# the bounding box of the point pattern. This is controlled by the "clip" argument.
2 more matches not shown…
Redundant / Tautological Comments39 hits · 44 pts
SeverityFileLineSnippet
LOWnetworkx/readwrite/gexf.py580 # Check if the type of the attribute value is consistent with the type of the attribute
LOWnetworkx/drawing/nx_pylab.py2034 # Check if edge_color is an array of floats and map to edge_cmap.
LOWnetworkx/algorithms/planarity.py1114 # Check if opposite half-edge exists
LOWnetworkx/algorithms/chains.py145 # Check if the root is in the graph G. If not, raise NodeNotFound
LOWnetworkx/algorithms/smallworld.py108 # Check if the graph is still connected
LOWnetworkx/algorithms/smallworld.py232 # Check if the graph is still connected
LOWnetworkx/algorithms/similarity.py1583 # Check if k is provided and validate it against the number of nodes
LOWnetworkx/algorithms/dominating.py221 # Check if u's unseen-degree changed while in the heap
LOWnetworkx/algorithms/structuralholes.py149 # Check if scipy is available
LOWnetworkx/algorithms/structuralholes.py265 # Check if scipy is available
LOWnetworkx/algorithms/matching.py615 # Set label to S.
LOWnetworkx/algorithms/graphical.py179 # Add back to the list any non-zero stubs that were removed
LOWnetworkx/algorithms/graphical.py261 if dk < k + 1: # Check if already past Durfee index
LOWnetworkx/algorithms/graphical.py265 if dk < k + run_size: # Check if end of run is past Durfee index
LOWnetworkx/algorithms/graphical.py469 # Check if target is now totally connected
LOWnetworkx/algorithms/planar_drawing.py428 # Check if the face has already been calculated
LOWnetworkx/algorithms/isomorphism/vf2pp.py493 # Check if SG and FG have the same labels, and check that the
LOW…workx/algorithms/isomorphism/tests/test_isomorphvf2.py370 # Check if StopIteration exception returns False
LOWnetworkx/algorithms/link_analysis/pagerank_alg.py263 # Assign dangling_weights to any dangling nodes (nodes with no out links)
LOWnetworkx/algorithms/connectivity/kcutsets.py130 # Check if X is a k-node-cutset
LOWnetworkx/algorithms/approximation/traveling_salesman.py933 # Check if the for loop terminated without changing any gamma
LOW…workx/algorithms/approximation/tests/test_treewidth.py24 # Check if each connected pair of nodes are at least once together in a bag
LOW…workx/algorithms/approximation/tests/test_treewidth.py33 # Check if the nodes associated with vertex v form a connected subset of T
LOWnetworkx/algorithms/tests/test_planar_drawing.py134 # Check if float numbers are basically equal, for python >=3.5 there is
LOWnetworkx/algorithms/tests/test_planar_drawing.py164 # Check if end points are different
LOWnetworkx/algorithms/tests/test_planar_drawing.py181 # Check if intersection lies between the points
LOWnetworkx/algorithms/tests/test_planarity.py387 # Check if we can remove the node
LOWnetworkx/algorithms/assortativity/connectivity.py105 # Check if `source_nodes` is actually a single node in the graph.
LOWnetworkx/algorithms/community/local.py113 # Check if nbr should be removed from boundary nodes
LOWnetworkx/algorithms/community/modularity_max.py199 # Check if replaced dq is row max
LOWnetworkx/algorithms/community/modularity_max.py430 # Check if strictly better or tie
LOWnetworkx/utils/backends.py593 # Check if any graph comes from a backend
LOWnetworkx/utils/backends.py2059 # Iterate over the items in `cache` to see if any are compatible.
LOWnetworkx/utils/mapped_queue.py252 # Set child_pos to index of smaller child.
LOWnetworkx/generators/degree_seq.py525 # Add back to the list any nonzero stubs that were removed
LOWnetworkx/generators/degree_seq.py628 # Check if source is now totally connected
LOWnetworkx/generators/community.py577 # Check if dimensions match
LOWexamples/algorithms/plot_blockmodel.py70# Set positions to mean of positions of internal nodes from original graph
LOWexamples/algorithms/plot_greedy_coloring.py22# Assign colors to nodes based on the greedy coloring
Excessive Try-Catch Wrapping22 hits · 22 pts
SeverityFileLineSnippet
LOWnetworkx/convert.py90 except Exception as err:
LOWnetworkx/convert.py99 except Exception as err1:
LOWnetworkx/convert.py106 except Exception as err2:
LOWnetworkx/convert.py120 except Exception as err:
LOWnetworkx/convert.py131 except Exception as err:
LOWnetworkx/convert.py139 except Exception as err:
LOWnetworkx/convert.py152 except Exception as err:
LOWnetworkx/convert.py166 except Exception as err:
LOWnetworkx/convert.py180 except Exception as err:
LOWnetworkx/convert_matrix.py212 except Exception as err:
LOWnetworkx/convert_matrix.py1274 except Exception as err:
LOWnetworkx/readwrite/gml.py413 except Exception:
LOWnetworkx/readwrite/edgelist.py260 except Exception as err:
LOWnetworkx/readwrite/edgelist.py276 except Exception as err:
LOWnetworkx/readwrite/edgelist.py290 except Exception as err:
LOWnetworkx/readwrite/tests/test_text.py1740 except Exception:
LOWnetworkx/classes/multigraph.py375 except Exception as err:
LOWnetworkx/classes/multidigraph.py366 except Exception as err:
LOW…lgorithms/connectivity/tests/test_edge_augmentation.py385 except Exception:
LOWnetworkx/utils/backends.py87 except Exception as exc:
LOWnetworkx/utils/backends.py1447 except Exception:
LOWnetworkx/utils/backends.py1467 except Exception:
AI Slop Vocabulary10 hits · 16 pts
SeverityFileLineSnippet
MEDIUMnetworkx/classes/tests/dispatch_interface.py6# This is comprehensive, but only tests the `test_override_dispatch`
LOWnetworkx/algorithms/threshold.py341 # if type is 'i' just add nodea
LOWnetworkx/algorithms/centrality/reaching.py198 # If the graph is unweighted, simply return the proportion of nodes
LOWnetworkx/algorithms/bipartite/basic.py141 # this should maybe just return False?
LOW…kx/algorithms/assortativity/tests/test_connectivity.py140 # just return the connectivity value itself?
MEDIUMnetworkx/algorithms/community/lukes.py115 # - brevity: we can leverage global "safe_G"
LOWnetworkx/algorithms/community/centrality.py123 # If the graph is already empty, simply return its connected
LOWnetworkx/generators/line.py475 # in this case either triangle works, so just use T
LOWnetworkx/generators/harary_graph.py145 # In case of connectivity 1, simply return the path graph.
LOWnetworkx/generators/random_graphs.py797 # For simplicity, if p == 0 or 1, just return BA
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippet
HIGHbenchmarks/benchmarks/utils.py9Generate a string name for a graph-generating function and its arguments. This function takes a graph constructor (
HIGHbenchmarks/benchmarks/utils.py45 Generate a graph using the given function and assign random edge weights. Parameters: weight_seed (int
Overly Generic Function Names3 hits · 2 pts
SeverityFileLineSnippet
LOWnetworkx/classes/tests/test_graphviews.py39 def my_method(self):
LOWnetworkx/classes/tests/test_graphviews.py337 def my_method(self):
LOWnetworkx/generators/random_graphs.py1382 def my_function(b):
Verbosity Indicators1 hit · 0 pts
SeverityFileLineSnippet
LOWnetworkx/algorithms/isomorphism/vf2pp.py902 and node1 is mapped to node2. The purpose of this function is to avoid brute