embiggen/node_label_prediction/node_label_prediction_tensorflow/gcn.py
File gcn.py
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""GCN model for node-label prediction."""
from typing import List, Union, Optional, Dict, Type, Tuple, Any
import numpy as np
from tensorflow.keras.layers import Dense, Concatenate # pylint: disable=import-error,no-name-in-module
Function __init__
has 29 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(
Function _get_model_prediction_input
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _get_model_prediction_input(
Function _get_model_training_input
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _get_model_training_input(
Function _get_model_training_input
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def _get_model_training_input(
self,
graph: Graph,
support: Graph,
node_features: Optional[List[np.ndarray]],
- 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"