stellargraph/stellargraph

View on GitHub

Showing 10 of 107 total issues

Consider simplifying this complex logical expression.
Open

if __name__ == "__main__":

    parser = argparse.ArgumentParser(
        description="Format and clean Jupyter notebooks by removing TensorFlow warnings "
        "and stderr outputs, formatting and numbering the code cells, and setting the kernel. "
Severity: Critical
Found in scripts/format_notebooks.py - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                            if len(neighbours) == 0:
                                # if no neighbours of the required type as dictated by the metapath exist, then stop.
                                break
                            # select one of the neighbours uniformly at random
                            current_node = rs.choice(
    Severity: Major
    Found in stellargraph/data/explorer.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                      with open(file_loc) as f:
                          original = f.read()
      
      
      Severity: Major
      Found in scripts/format_notebooks.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                with builder.element("td"):
                                    self._render_cell(builder, algorithm.columns[heading])
        
        
        Severity: Major
        Found in scripts/demo_indexing.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          with open(f"{nb_file_loc}.ipynb") as f:
                              updated = f.read()
          
          
          Severity: Major
          Found in scripts/format_notebooks.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if dv == d:
                                        u_v_edge_type = (nodes_dict[u[0]], nodes_dict[v])
                                        # if no edge between u and next_node[0] then this is the sample, so record and stop
                                        # searching
                                        # Note: The if statement below is very expensive to evaluate because it need to checks
            Severity: Major
            Found in stellargraph/data/edge_splitter.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      for et in current_edge_types:
                                          neigh_et = adj[et][current_node]
              
                                          # If there are no neighbours of this type then we return None
                                          # in the place of the nodes that would have been sampled
              Severity: Major
              Found in stellargraph/data/explorer.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if dv == d:
                                            # if no edge between u and next_node[0] then this is the sample, so record and stop
                                            # searching
                                            if (
                                                (u != v)
                Severity: Major
                Found in stellargraph/data/edge_splitter.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                  if original != updated:
                                      check_failed.append(str(file_loc))
                  
                                      if on_ci:
                                          # CI doesn't provide enough state to diagnose a peculiar or
                  Severity: Major
                  Found in scripts/format_notebooks.py - About 45 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return T(inp)
                    Severity: Major
                    Found in scripts/demo_indexing.py - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language