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(data, pd.DataFrame)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert adj_to_samples[next_key][0] == et.n2
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert raw_rank.shape == filtered_rank.shape == (batch_size,)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert (
batch_feats.shape
== (this_batch_size, self._num_nodes, self._window_size)
+ self._num_sequence_variates
)
- Exclude checks
Merge this if statement with the enclosing one. Open
if num_edges_to_sample > limit_samples:
- Read upRead up
- Exclude checks
Merging collapsible if
statements increases the code's readability.
Noncompliant Code Example
if condition1: if condition2: # ...
Compliant Solution
if condition1 and condition2: # ...
Use of exec detected. Open
exec(fh.read(), version)
- Exclude checks
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
- Exclude checks
Remove this commented out code. Open
# edgelist = nx.to_edgelist(self.to_nx(graph_id, directed))
- Read upRead up
- Exclude checks
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
# __all__ = ["graphsage", "hinsage", "link_inference"]
- Read upRead up
- Exclude checks
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"
Using xml.etree.ElementTree to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.etree.ElementTree with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called. Open
import xml.etree.ElementTree as ET
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert len(columns) == 0
- Exclude checks
subprocess call - check for execution of untrusted input. Open
subprocess.run(
[
"buildkite-agent",
"annotate",
"--style=error",
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert isinstance(dataset, (Cora, CiteSeer))
- Exclude checks
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]], ...])
- Exclude checks
Rename function "u" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def u(users):
- Read upRead up
- Exclude checks
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): ...
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert isinstance(self._output_embedding, Embedding)
- Exclude checks
Rename function "BaggingEnsemble" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def BaggingEnsemble(*args, **kwargs):
- Read upRead up
- Exclude checks
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): ...
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert isinstance(kind, LinkKind)
- Exclude checks
Starting a process with a partial executable path Open
subprocess.run(
[
"buildkite-agent",
"annotate",
"--style=error",
- Exclude checks
Consider possible security implications associated with subprocess module. Open
import subprocess
- Exclude checks