File graph_visualizer.py
has 4976 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Module with embedding visualization tools."""
import functools
import inspect
import itertools
import math
Function __init__
has 39 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function _plot_scatter
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_scatter(
Function _plot_types
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_types(
Function plot_node_types
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_types(
Function _plot_node_metric
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_node_metric(
Function plot_connected_components
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_connected_components(
Function plot_node_ontologies
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_ontologies(
Function plot_approximated_closeness_centrality
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_approximated_closeness_centrality(
Function plot_node_squares
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_squares(
Function plot_node_degrees
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_degrees(
Function plot_approximated_harmonic_centrality
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_approximated_harmonic_centrality(
Function plot_node_triangles
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_triangles(
Function _plot_positive_and_negative_edges_metric
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_positive_and_negative_edges_metric(
Function plot_edge_types
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_edge_types(
Function __init__
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
graph: Union[Graph, str],
support: Optional[Graph] = None,
subgraph_of_interest: Optional[Graph] = None,
Function __init__
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
graph: Union[Graph, str],
support: Optional[Graph] = None,
subgraph_of_interest: Optional[Graph] = None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function plot_nodes
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_nodes(
Function plot_positive_and_negative_edges_euclidean_distance
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_euclidean_distance(
Function plot_positive_and_negative_edges_cosine_similarity
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_cosine_similarity(
Function plot_positive_and_negative_edges_adamic_adar
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_adamic_adar(
Function plot_positive_and_negative_edges_resource_allocation_index
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_resource_allocation_index(
Function plot_positive_and_negative_edges_preferential_attachment
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_preferential_attachment(
Function plot_positive_and_negative_edges_jaccard_coefficient
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_jaccard_coefficient(
Function plot_edge_weights
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_edge_weights(
Function plot_edges
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_edges(
Function _handle_notebook_display
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _handle_notebook_display(
self, *args: List, caption: Optional[str] = None
) -> Optional[Union[Tuple[Figure, Axes], Tuple[Figure, Axes, str]]]:
"""Handles whether to display provided data in a Jupyter Notebook or return them.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function plot_positive_and_negative_edges
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges(
Function _plot_positive_and_negative_edges_distance_histogram
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_positive_and_negative_edges_distance_histogram(
Function _plot_positive_and_negative_edges_metric_histogram
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_positive_and_negative_edges_metric_histogram(
Function fit_and_plot_all
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def fit_and_plot_all(
Function _plot_node_metric_distribution
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_node_metric_distribution(
Function plot_positive_and_negative_edges_euclidean_distance_histogram
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_euclidean_distance_histogram(
Function plot_positive_and_negative_edges_cosine_similarity_histogram
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_edges_cosine_similarity_histogram(
Function _get_edge_embedding
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_edge_embedding(
Function plot_triangle_distribution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_triangle_distribution(
Function plot_approximated_harmonic_centrality_distribution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_approximated_harmonic_centrality_distribution(
Function plot_node_degree_distribution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_node_degree_distribution(
Function plot_approximated_closeness_centrality_distribution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_approximated_closeness_centrality_distribution(
Function _fit_and_plot_all
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _fit_and_plot_all(
Function _plot_positive_and_negative_edges_distance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _plot_positive_and_negative_edges_distance(
Function plot_square_distribution
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_square_distribution(
Function plot_positive_and_negative_adamic_adar_histogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_adamic_adar_histogram(
Function _set_legend
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _set_legend(
Function plot_edge_segments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_edge_segments(
Function _get_negative_edge_embedding
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_negative_edge_embedding(
Function plot_positive_and_negative_resource_allocation_index_histogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_resource_allocation_index_histogram(
Function _get_positive_edges_embedding
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_positive_edges_embedding(
Function fit_edges
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fit_edges(
Function fit_negative_and_positive_edges
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fit_negative_and_positive_edges(
Function plot_positive_and_negative_jaccard_coefficient_histogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_jaccard_coefficient_histogram(
Function plot_positive_and_negative_preferential_attachment_histogram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_positive_and_negative_preferential_attachment_histogram(
Function plot_edge_weight_distribution
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_edge_weight_distribution(
Function get_heatmaps_comments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_heatmaps_comments(self, letters: Optional[List[str]] = None) -> str:
"""Returns description of the heatmaps for the provided letters."""
if (
not self._show_heatmaps_description
or letters is not None
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"