monarch-initiative/N2V

View on GitHub

Showing 369 of 369 total issues

Function __init__ has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
        self,
        graph: Graph,
        support: Graph,
        kernels: Optional[List[tf.SparseTensor]],

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 __init__ has 39 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in embiggen/visualizations/graph_visualizer.py - About 4 hrs to fix

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

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

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

          def __init__(

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

            def __init__(
        Severity: Major
        Found in embiggen/edge_prediction/edge_prediction_tensorflow/kipf_gcn.py - About 4 hrs to fix

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

              def __init__(
          Severity: Major
          Found in embiggen/edge_prediction/edge_prediction_tensorflow/graph_sage.py - About 4 hrs to fix

            File perceptron.py has 355 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Module providing Perceptron for edge prediction."""
            import json
            from typing import Any, Dict, List, Optional, Union
            
            import compress_json
            Severity: Minor
            Found in embiggen/edge_prediction/edge_prediction_ensmallen/perceptron.py - About 4 hrs to fix

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

                  def __init__(

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

                    def __init__(

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

                      def __init__(

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

                        def __init__(
                    Severity: Major
                    Found in embiggen/edge_prediction/edge_prediction_tensorflow/gnn.py - About 4 hrs to fix

                      File gcn.py has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """GCN model for edge-label prediction."""
                      from typing import Dict, List, Optional, Type, Union, Any
                      
                      import numpy as np
                      from ensmallen import Graph

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

                            def __init__(

                          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 edge_prediction_evaluation has 31 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def edge_prediction_evaluation(
                            Severity: Major
                            Found in embiggen/edge_prediction/edge_prediction_evaluation.py - About 3 hrs 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 __init__ has 29 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(

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

                                      def __init__(

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

                                        def __init__(

                                      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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language