monarch-initiative/N2V

View on GitHub
embiggen/node_label_prediction/node_label_prediction_model.py

Summary

Maintainability
C
1 day
Test Coverage

File node_label_prediction_model.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Module providing abstract node label prediction model."""
from typing import Optional, Union, List, Dict, Any, Tuple
import pandas as pd
import numpy as np
import warnings
Severity: Minor
Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 2 hrs to fix

    Function _evaluate has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def _evaluate(
    Severity: Major
    Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 1 hr to fix

      Function _evaluate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _evaluate(
              self,
              graph: Graph,
              train: Graph,
              test: Graph,
      Severity: Minor
      Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 1 hr 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

      Function _prepare_evaluation has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _prepare_evaluation(
      Severity: Major
      Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 1 hr to fix

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

            def fit(
        Severity: Major
        Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 50 mins to fix

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

              def split_graph_following_evaluation_schema(
          Severity: Minor
          Found in embiggen/node_label_prediction/node_label_prediction_model.py - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status