scripts/format_notebooks.py
subprocess call - check for execution of untrusted input. Open
Open
subprocess.run(
[
"buildkite-agent",
"annotate",
"--style=error",
- Exclude checks
Starting a process with a partial executable path Open
Open
subprocess.run(
[
"buildkite-agent",
"annotate",
"--style=error",
- Exclude checks
Consider possible security implications associated with subprocess module. Open
Open
import subprocess
- Exclude checks
Use of assert detected. The enclosed code will be removed when compiling to optimised byte code. Open
Open
assert check_notebook, "things failed check without check being enabled"
- Exclude checks
Use of exec detected. Open
Open
exec(fh.read(), version)
- Exclude checks
Consider simplifying this complex logical expression. Open
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. "
Avoid deeply nested control flow statements. Open
Open
if original != updated:
check_failed.append(str(file_loc))
if on_ci:
# CI doesn't provide enough state to diagnose a peculiar or
Avoid deeply nested control flow statements. Open
Open
with open(file_loc) as f:
original = f.read()
Avoid deeply nested control flow statements. Open
Open
with open(f"{nb_file_loc}.ipynb") as f:
updated = f.read()
Remove this commented out code. Open
Open
# html_exporter.template_file = 'basic'
- 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"