The following issues were found
common/kalman/simple_kalman.py
1 issues
Line: 3
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
# pylint: skip-file
from common.kalman.simple_kalman_impl import KF1D as KF1D
assert KF1D
Reported by Bandit.
common/kalman/tests/test_simple_kalman.py
1 issues
Line: 44
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random
def test_old_equal_new(self):
for _ in range(1000):
v_wheel = random.uniform(0, 200)
x_old = self.kf_old.update(v_wheel)
x = self.kf.update(v_wheel)
# Compare the output x, verify that the error is less than 1e-4
Reported by Bandit.
common/tests/test_file_helpers.py
1 issues
Line: 11
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b108_hardcoded_tmp_directory.html
class TestFileHelpers(unittest.TestCase):
def run_atomic_write_func(self, atomic_write_func):
path = "/tmp/tmp{}".format(uuid4())
with atomic_write_func(path) as f:
f.write("test")
with open(path) as f:
self.assertEqual(f.read(), "test")
Reported by Bandit.
installer/installer.c
1 issues
Line: 128
CWE codes:
570
FILE *of = fopen("/data/data/com.termux/files/continue.sh.new", "wb");
if(of == NULL) return 1;
size_t num = str_continue_end - str_continue;
size_t num_written = fwrite(str_continue, 1, num, of);
if (num != num_written) return 1;
fclose(of);
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/acados_mex_create.in.c
1 issues
Line: 50
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
long long *l_ptr;
int status = 0;
// create solver
nlp_solver_capsule *acados_ocp_capsule = {{ model.name }}_acados_create_capsule();
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/acados_sim_solver.in.c
1 issues
Line: 267
tmp_bool = {{ solver_options.output_z }};
sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "output_z", &tmp_bool);
{% else %} {# num_stages and num_steps of first shooting interval are used #}
tmp_int = {{ solver_options.sim_method_num_stages[0] }};
sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_stages", &tmp_int);
tmp_int = {{ solver_options.sim_method_num_steps[0] }};
sim_opts_set({{ model.name }}_sim_config, {{ model.name }}_sim_opts, "num_steps", &tmp_int);
{% endif %}
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/acados_solver.in.c
1 issues
Line: 1810
{%- if dims.np > 0 %}
if (stage < {{ dims.N }} && stage >= 0)
{
{%- if solver_options.integrator_type == "IRK" %}
capsule->impl_dae_fun[stage].set_param(capsule->impl_dae_fun+stage, p);
capsule->impl_dae_fun_jac_x_xdot_z[stage].set_param(capsule->impl_dae_fun_jac_x_xdot_z+stage, p);
capsule->impl_dae_jac_x_xdot_u_z[stage].set_param(capsule->impl_dae_jac_x_xdot_u_z+stage, p);
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/main.in.c
1 issues
Line: 47
int main()
{
nlp_solver_capsule *acados_ocp_capsule = {{ model.name }}_acados_create_capsule();
int status = {{ model.name }}_acados_create(acados_ocp_capsule);
if (status)
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/main_mex.in.c
1 issues
Line: 99
// initial condition
int idxbx0[{{ dims.nbx_0 }}];
{% for i in range(end=dims.nbx_0) %}
idxbx0[{{ i }}] = {{ constraints.idxbx_0[i] }};
{%- endfor %}
double lbx0[{{ dims.nbx_0 }}];
double ubx0[{{ dims.nbx_0 }}];
Reported by Cppcheck.
pyextra/acados_template/c_templates_tera/main_sim.in.c
1 issues
Line: 46
int main()
{
int status = 0;
sim_solver_capsule *capsule = {{ model.name }}_acados_sim_solver_create_capsule();
status = {{ model.name }}_acados_sim_create(capsule);
if (status)
Reported by Cppcheck.