monarch-initiative/N2V

View on GitHub
embiggen/node_label_prediction/node_label_prediction_tensorflow/gcn.py

Summary

Maintainability
C
1 day
Test Coverage

File gcn.py has 329 lines of code (exceeds 250 allowed). Consider refactoring.
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

        def __init__(

      Function _get_model_prediction_input has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _get_model_prediction_input(
      Severity: Major
      Found in embiggen/node_label_prediction/node_label_prediction_tensorflow/gcn.py - About 50 mins to fix

        Function _get_model_training_input has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _get_model_training_input(
        Severity: Minor
        Found in embiggen/node_label_prediction/node_label_prediction_tensorflow/gcn.py - About 45 mins to fix

          Function _get_model_training_input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def _get_model_training_input(
                  self,
                  graph: Graph,
                  support: Graph,
                  node_features: Optional[List[np.ndarray]],
          Severity: Minor
          Found in embiggen/node_label_prediction/node_label_prediction_tensorflow/gcn.py - About 35 mins to fix

          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

          There are no issues that match your filters.

          Category
          Status