stellargraph/stellargraph

View on GitHub

Showing 107 of 107 total issues

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

    assert isinstance(dataset, (Cora, CiteSeer))

Severity: Info
Found in stellargraph/datasets/datasets.py by bandit

Remove this commented out code.
Open

            A = A ** k  # return scipy.sparse.csr_matrix
Severity: Major
Found in stellargraph/core/utils.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

    # html_exporter.template_file = 'basic'
Severity: Major
Found in scripts/format_notebooks.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

    assert unmodified_node_ilocs.shape == true_rel_ilocs.shape == (batch_size,)

    # the score of the true edge, for each edge in the batch (this indexes in lock-step,
    # i.e. [pred[true_modified_node_ilocs[0], range(batch_size)[0]], ...])

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

            assert (
                batch_targets.shape
                == (this_batch_size, self._num_nodes) + self._num_sequence_variates
Severity: Info
Found in stellargraph/mapper/sliding.py by bandit

Rename function "u" to match the regular expression ^[a-z_][a-z0-9_]{2,}$.
Open

        def u(users):

Shared coding conventions allow teams to collaborate efficiently. This rule checks that all function names match a provided regular expression.

Noncompliant Code Example

With the default provided regular expression: ^[a-z_][a-z0-9_]{2,30}$

def MyFunction(a,b):
    ...

Compliant Solution

def my_function(a,b):
    ...

Remove this commented out code.
Open

    T_0 = f  # If = f

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Either remove or fill this block of code.
Open

            pass

Most of the time a block of code is empty when a piece of code is really missing. So such empty block must be either filled or removed.

Noncompliant Code Example

for i in range(3):
    pass

Exceptions

When a block contains a comment, this block is not considered to be empty.

subprocess call - check for execution of untrusted input.
Open

        subprocess.run(
            [
                "buildkite-agent",
                "annotate",
                "--style=error",
Severity: Info
Found in scripts/demo_indexing.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

    assert len(columns) == 0
Severity: Info
Found in stellargraph/core/convert.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

            assert step == 1

Severity: Info
Found in stellargraph/mapper/sliding.py by bandit

Merge this if statement with the enclosing one.
Open

            if num_edges_to_sample > limit_samples:

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Consider possible security implications associated with subprocess module.
Open

import subprocess
Severity: Info
Found in scripts/notebook_text_checker.py by bandit

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert len(type_sequence) == 1
Severity: Info
Found in stellargraph/core/graph.py by bandit

Merge this if statement with the enclosing one.
Open

            if num_edges_to_sample > limit_samples:

Merging collapsible if statements increases the code's readability.

Noncompliant Code Example

if condition1:
    if condition2:
        # ...

Compliant Solution

if condition1 and condition2:
    # ...

Remove this commented out code.
Open

    # def adjacency_sans_nx(self, graph_id, directed=False):
Severity: Major
Found in stellargraph/data/epgm.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

    # def adjacency_from_edgelist(self, graph_id, directed=False):
Severity: Major
Found in stellargraph/data/epgm.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

subprocess call - check for execution of untrusted input.
Open

            subprocess.run(
                [
                    "buildkite-agent",
                    "annotate",
                    "--style=error",
Severity: Info
Found in scripts/notebook_text_checker.py by bandit

Remove this commented out code.
Open

        # self.dtype = dtype
Severity: Major
Found in stellargraph/layer/misc.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Use of exec detected.
Open

    exec(fh.read(), version)
Severity: Minor
Found in docs/conf.py by bandit
Severity
Category
Status
Source
Language