Showing 107 of 107 total issues
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert raw.shape == filtered.shape == (num_tested, 2)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert len(targets) == len(s_iloc)
- Exclude checks
Rename function "g" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def g(groups):
- 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): ...
Rename function "m" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def m(movies):
- 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): ...
Rename function "y" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def y(vector):
- 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): ...
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: # ...
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"
Rename function "Ensemble" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def Ensemble(*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): ...
Starting a process with a partial executable path Open
subprocess.run(
[
"buildkite-agent",
"annotate",
"--style=error",
- Exclude checks
subprocess call with shell=True identified, security issue. Open
procout = subprocess.run(
cmd_line,
shell=True,
check=False,
env=environ,
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert isinstance(data, (IndexedArray, np.ndarray))
- 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(kind, LinkKind)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert matrix.shape == (num_nodes, size)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert len(biases) == n
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert len(s_iloc) == len(r_iloc) == len(o_iloc)
- 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"
Rename function "PPNP_Aadj_feats_op" to match the regular expression ^[a-z_][a-z0-9_]{2,}$. Open
def PPNP_Aadj_feats_op(features, A, teleport_probability=0.1):
- 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): ...
Using xml.etree.ElementTree.parse to parse untrusted XML data is known to be vulnerable to XML attacks. Replace xml.etree.ElementTree.parse with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called Open
tree = ET.parse(args.file)
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
assert check_notebook, "things failed check without check being enabled"
- Exclude checks