embiggen/utils/abstract_gcn.py
File abstract_gcn.py
has 1116 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Kipf GCN model for node-label prediction."""
import copy
import warnings
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
Function __init__
has 30 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function _predict
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _predict(
Function _get_model_prediction_input
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _get_model_prediction_input(
Function compile
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def compile(
Function _predict_proba
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _predict_proba(
Function _fit
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _fit(
Function _get_model_training_input
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _get_model_training_input(
Function _build_model
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _build_model(
Function graph_to_sparse_tensor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def graph_to_sparse_tensor(
graph: Graph,
kernel: str,
handling_multi_graph: str = "warn",
) -> tf.SparseTensor:
- 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"