monarch-initiative/N2V

View on GitHub

Showing 369 of 369 total issues

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

    def __init__(

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    Severity: Major
    Found in embiggen/edge_label_prediction/__init__.py and 1 other location - About 2 hrs to fix
    embiggen/edge_prediction/__init__.py on lines 0..14

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 56.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        def __init__(

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      Severity: Major
      Found in embiggen/edge_prediction/__init__.py and 1 other location - About 2 hrs to fix
      embiggen/edge_label_prediction/__init__.py on lines 0..14

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 56.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

          def __init__(

        Function node_label_prediction_evaluation has 20 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def node_label_prediction_evaluation(
        Severity: Major
        Found in embiggen/node_label_prediction/node_label_prediction_evaluation.py - About 2 hrs to fix

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

              def __init__(

            Function _trasform_graph_into_edge_embedding has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                def _trasform_graph_into_edge_embedding(
                    self,
                    graph: Union[Graph, Tuple[np.ndarray]],
                    node_features: List[np.ndarray],
                    support: Graph,
            Severity: Minor
            Found in embiggen/edge_prediction/sklearn_like_edge_prediction_adapter.py - About 2 hrs 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 __init__ has 19 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in embiggen/embedders/ensmallen_embedders/hyper_sketching.py - About 2 hrs to fix

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

                  def __init__(

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

                    def plot_node_types(
                Severity: Major
                Found in embiggen/visualizations/graph_visualizer.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

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

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

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

                          def __init__(

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

                                  def __init__(

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

                                    def __init__(
                                Severity: Major
                                Found in embiggen/embedders/pykeen_embedders/conve.py - About 2 hrs to fix

                                  Function plot_connected_components has 18 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def plot_connected_components(
                                  Severity: Major
                                  Found in embiggen/visualizations/graph_visualizer.py - About 2 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language