monarch-initiative/N2V

View on GitHub
embiggen/utils/abstract_models/abstract_classifier_model.py

Summary

Maintainability
F
1 wk
Test Coverage

File abstract_classifier_model.py has 2643 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Module providing abstract classes for classification models."""
import functools
import json
import os
import platform
Severity: Major
Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 wk to fix

    Consider simplifying this complex logical expression.
    Open

            if issubclass(type(node_feature), AbstractEmbeddingModel):
                if skip_evaluation_biased_feature and (
                    cls.task_involves_edge_types()
                    and node_feature.can_use_edge_types()
                    and node_feature.is_using_edge_types()
    Severity: Critical
    Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 3 hrs to fix

      Function _evaluate_on_single_holdout has 24 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _evaluate_on_single_holdout(
      Severity: Major
      Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 3 hrs to fix

        Function evaluate has 22 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def evaluate(
        Severity: Major
        Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 2 hrs to fix

          Function _train_and_evaluate_model has 19 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _train_and_evaluate_model(
          Severity: Major
          Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                    if issubclass(type(edge_feature), AbstractEmbeddingModel):
                        if skip_evaluation_biased_feature and (
                            cls.task_involves_edge_types()
                            and edge_feature.is_using_edge_types()
                            or cls.task_involves_node_types()
            Severity: Critical
            Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 2 hrs to fix

              Consider simplifying this complex logical expression.
              Open

                      if issubclass(edge_type_feature.__class__, AbstractEmbeddingModel):
                          if skip_evaluation_biased_feature and (
                              cls.task_involves_edge_types()
                              and edge_type_feature.is_using_edge_types()
                              or cls.task_involves_edge_types()
              Severity: Critical
              Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                        if issubclass(node_type_feature.__class__, AbstractEmbeddingModel):
                            if skip_evaluation_biased_feature and (
                                cls.task_involves_edge_types()
                                and node_type_feature.is_using_edge_types()
                                or cls.task_involves_node_types()
                Severity: Critical
                Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 2 hrs to fix

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

                      def _evaluate(
                  Severity: Major
                  Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                    Function normalize_node_feature has 10 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def normalize_node_feature(
                    Severity: Major
                    Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                      Function normalize_node_features has 10 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def normalize_node_features(
                      Severity: Major
                      Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

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

                            def _prepare_evaluation(
                        Severity: Major
                        Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                          Function normalize_node_type_features has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def normalize_node_type_features(
                          Severity: Major
                          Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                            Function normalize_node_type_feature has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def normalize_node_type_feature(
                            Severity: Major
                            Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                              Function normalize_edge_type_features has 9 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def normalize_edge_type_features(
                              Severity: Major
                              Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                                Function normalize_edge_feature has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def normalize_edge_feature(
                                Severity: Major
                                Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                                  Function normalize_edge_type_feature has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def normalize_edge_type_feature(
                                  Severity: Major
                                  Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

                                    Function normalize_edge_features has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def normalize_edge_features(
                                    Severity: Major
                                    Found in embiggen/utils/abstract_models/abstract_classifier_model.py - About 1 hr to fix

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

                                          def _predict(
                                      Severity: Major
                                      Found in embiggen/utils/abstract_models/abstract_classifier_model.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_models/abstract_classifier_model.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_models/abstract_classifier_model.py - About 50 mins to fix

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

                                                def _handle_potentially_misparametrized_features(
                                            Severity: Major
                                            Found in embiggen/utils/abstract_models/abstract_classifier_model.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_models/abstract_classifier_model.py - About 50 mins to fix

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

                                                    def predict(
                                                Severity: Major
                                                Found in embiggen/utils/abstract_models/abstract_classifier_model.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_models/abstract_classifier_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/utils/abstract_models/abstract_classifier_model.py - About 45 mins to fix

                                                      There are no issues that match your filters.

                                                      Category
                                                      Status