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 len(targets) == len(s_iloc)

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

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

        def g(groups):

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):
    ...

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):
    ...

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

def Ensemble(*args, **kwargs):
Severity: Major
Found in stellargraph/__init__.py by sonar-python

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):
    ...

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