File edge_prediction_model.py
has 1870 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Module providing abstract edge prediction model."""
import math
import gc
import warnings
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
Function predict_proba
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def predict_proba(
self,
graph: Graph,
support: Optional[Graph] = None,
node_features: Optional[
- 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 _evaluate
has 21 arguments (exceeds 4 allowed). Consider refactoring. Open
def _evaluate(
Function _prepare_evaluation
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def _prepare_evaluation(
Function __iterate_negative_graphs
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def __iterate_negative_graphs(
Function predict_proba_bipartite_graph_from_edge_node_types
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_bipartite_graph_from_edge_node_types(
Function predict_proba_bipartite_graph_from_edge_node_names
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_bipartite_graph_from_edge_node_names(
Function predict_proba_bipartite_graph_from_edge_node_prefixes
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_bipartite_graph_from_edge_node_prefixes(
Function predict_proba_bipartite_graph_from_edge_node_ids
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_bipartite_graph_from_edge_node_ids(
Function predict_proba_clique_graph_from_node_ids
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_clique_graph_from_node_ids(
Function predict_proba_clique_graph_from_node_prefixes
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_clique_graph_from_node_prefixes(
Function predict_proba_clique_graph_from_node_type_names
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_clique_graph_from_node_type_names(
Function predict_proba_clique_graph_from_node_names
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba_clique_graph_from_node_names(
Function predict_bipartite_graph_from_edge_node_names
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_bipartite_graph_from_edge_node_names(
Function predict_bipartite_graph_from_edge_node_ids
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_bipartite_graph_from_edge_node_ids(
Function predict_bipartite_graph_from_edge_node_prefixes
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_bipartite_graph_from_edge_node_prefixes(
Function predict_bipartite_graph_from_edge_node_types
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_bipartite_graph_from_edge_node_types(
Function predict_proba
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_proba(
Function predict
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def predict(
self,
graph: Graph,
support: Optional[Graph] = None,
node_features: Optional[
- 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 predict_clique_graph_from_node_ids
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_clique_graph_from_node_ids(
Function predict_clique_graph_from_node_type_names
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_clique_graph_from_node_type_names(
Function predict_clique_graph_from_node_prefixes
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_clique_graph_from_node_prefixes(
Function predict_clique_graph_from_node_names
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict_clique_graph_from_node_names(
Function predict
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def predict(
Function _evaluate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _evaluate(
self,
graph: Graph,
train: Graph,
test: Graph,
- 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 fit
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def fit(
Function split_graph_following_evaluation_schema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def split_graph_following_evaluation_schema(
Avoid deeply nested control flow statements. Open
if separator in dst:
dst = dst.replace("\"", "\\\"")
dst = f"\"{dst}\""
else:
Avoid deeply nested control flow statements. Open
if separator in src:
src = src.replace("\"", "\\\"")
src = f"\"{src}\""
if separator in dst: