monarch-initiative/N2V

View on GitHub
embiggen/utils/abstract_gcn.py

Summary

Maintainability
F
4 days
Test Coverage

File abstract_gcn.py has 1116 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Kipf GCN model for node-label prediction."""
import copy
import warnings
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union

Severity: Major
Found in embiggen/utils/abstract_gcn.py - About 2 days to fix

    Function __init__ has 30 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in embiggen/utils/abstract_gcn.py - About 3 hrs to fix

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

          def _predict(
      Severity: Major
      Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

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

            def _get_model_prediction_input(
        Severity: Major
        Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

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

              def compile(
          Severity: Major
          Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

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

                def _predict_proba(
            Severity: Major
            Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

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

                  def _fit(
              Severity: Major
              Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

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

                    def _get_model_training_input(
                Severity: Major
                Found in embiggen/utils/abstract_gcn.py - About 50 mins to fix

                  Function _build_model has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def _build_model(
                  Severity: Minor
                  Found in embiggen/utils/abstract_gcn.py - About 35 mins to fix

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

                    def graph_to_sparse_tensor(
                        graph: Graph,
                        kernel: str,
                        handling_multi_graph: str = "warn",
                    ) -> tf.SparseTensor:
                    Severity: Minor
                    Found in embiggen/utils/abstract_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