monarch-initiative/N2V

View on GitHub

Showing 367 of 369 total issues

File graph_visualizer.py has 4976 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Module with embedding visualization tools."""
import functools
import inspect
import itertools
import math
Severity: Major
Found in embiggen/visualizations/graph_visualizer.py - About 2 wks to fix

    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

      File edge_prediction_model.py has 1870 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Module providing abstract edge prediction model."""
      import math
      import gc
      import warnings
      from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, Union
      Severity: Major
      Found in embiggen/edge_prediction/edge_prediction_model.py - About 5 days to fix

        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

          File abstract_edge_gcn.py has 838 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """GCN model for edge prediction."""
          from typing import Any, Dict, List, Optional, Type, Union
          
          import numpy as np
          import pandas as pd
          Severity: Major
          Found in embiggen/utils/abstract_edge_gcn.py - About 2 days to fix

            File abstract_model.py has 720 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Module providing generic abstract model."""
            from typing import Callable
            from embiggen.utils.abstract_models.list_formatting import format_list
            from typing import Dict, Any, Type, List, Optional
            from dict_hash import Hashable, sha256
            Severity: Major
            Found in embiggen/utils/abstract_models/abstract_model.py - About 1 day to fix

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

                  def __init__(

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

                    def __init__(

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

                      def __init__(

                    File edge_transformer.py has 606 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """EdgeTransformer class to convert edges to edge embeddings."""
                    from typing import List, Optional, Union, Optional
                    
                    import numpy as np
                    import pandas as pd
                    Severity: Major
                    Found in embiggen/embedding_transformers/edge_transformer.py - About 1 day to fix

                      Function _build_model has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _build_model(
                              self,
                              graph: Graph,
                              graph_convolution_model: Model,
                              edge_type_features: List[np.ndarray],
                      Severity: Minor
                      Found in embiggen/utils/abstract_edge_gcn.py - About 1 day 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

                      File sklearn_like_edge_prediction_adapter.py has 535 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Module providing adapter class making edge prediction possible in sklearn models."""
                      from typing import Type, List, Optional, Dict, Any, Union, Tuple
                      import numpy as np
                      import math
                      import compress_pickle
                      Severity: Major
                      Found in embiggen/edge_prediction/sklearn_like_edge_prediction_adapter.py - About 1 day to fix

                        Function predict_proba has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def predict_proba(
                                self,
                                graph: Graph,
                                support: Optional[Graph] = None,
                                node_features: Optional[
                        Severity: Minor
                        Found in embiggen/edge_prediction/edge_prediction_model.py - About 1 day 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

                        File hyper_sketching.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """Module providing HyperSketching implementation."""
                        import json
                        import warnings
                        from typing import Any, Dict, List, Optional, Tuple
                        
                        
                        Severity: Minor
                        Found in embiggen/embedders/ensmallen_embedders/hyper_sketching.py - About 6 hrs to fix

                          File dag_resnik.py has 399 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          from typing import List, Optional, Union, Dict, Tuple
                          import pandas as pd
                          import numpy as np
                          from ensmallen import models, Graph
                          
                          
                          Severity: Minor
                          Found in embiggen/similarities/dag_resnik.py - About 5 hrs to fix

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

                            """GCN model for edge prediction."""
                            from typing import List, Union, Optional, Dict, Any, Type
                            
                            import numpy as np
                            from tensorflow.keras.optimizers import (
                            Severity: Minor
                            Found in embiggen/edge_prediction/edge_prediction_tensorflow/gcn.py - About 5 hrs to fix

                              File gcn_edge_prediction_sequence.py has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              """Keras Sequence for Open-world assumption GCN."""
                              from typing import List, Optional, Tuple, Type, Union
                              
                              import numpy as np
                              import tensorflow as tf

                                File sklearn_like_edge_label_prediction_adapter.py has 381 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                """Module providing adapter class making edge-label prediction possible in sklearn models."""
                                from typing import Type, List, Dict, Optional, Any, Union
                                import numpy as np
                                import copy
                                import compress_pickle

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

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

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

                                        def __init__(
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language