The following issues were found

selfdrive/debug/uiview.py
2 issues
Unable to import 'cereal.messaging'
Error

Line: 3 Column: 1

              #!/usr/bin/env python3
import time
import cereal.messaging as messaging
from selfdrive.manager.process_config import managed_processes

if __name__ == "__main__":
  services = ['controlsState', 'deviceState', 'pandaState']  # the services needed to be spoofed to start ui offroad
  procs = ['camerad', 'ui', 'modeld', 'calibrationd']


            

Reported by Pylint.

No name 'messaging' in module 'cereal'
Error

Line: 3 Column: 1

              #!/usr/bin/env python3
import time
import cereal.messaging as messaging
from selfdrive.manager.process_config import managed_processes

if __name__ == "__main__":
  services = ['controlsState', 'deviceState', 'pandaState']  # the services needed to be spoofed to start ui offroad
  procs = ['camerad', 'ui', 'modeld', 'calibrationd']


            

Reported by Pylint.

tools/zookeeper/__init__.py
2 issues
Unable to import 'ft4222'
Error

Line: 5 Column: 1

              
# Python library to control Zookeeper

import ft4222
import ft4222.I2CMaster

DEBUG = False

INA231_ADDR = 0x40

            

Reported by Pylint.

Unable to import 'ft4222.I2CMaster'
Error

Line: 6 Column: 1

              # Python library to control Zookeeper

import ft4222
import ft4222.I2CMaster

DEBUG = False

INA231_ADDR = 0x40
INA231_REG_CONFIG = 0x00

            

Reported by Pylint.

common/ffi_wrapper.py
2 issues
Probable insecure usage of temp file/directory.
Security

Line: 14
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b108_hardcoded_tmp_directory.html

                else:
    return ".so"

def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None):
  if libraries is None:
    libraries = []

  cache = name + "_" + hashlib.sha1(c_code.encode('utf-8')).hexdigest()
  try:

            

Reported by Bandit.

Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Security blacklist

Line: 18
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5

                if libraries is None:
    libraries = []

  cache = name + "_" + hashlib.sha1(c_code.encode('utf-8')).hexdigest()
  try:
    os.mkdir(tmpdir)
  except OSError:
    pass


            

Reported by Bandit.

selfdrive/hardware/pc/hardware.py
2 issues
No name 'log' in module 'cereal'
Error

Line: 3 Column: 1

              import random

from cereal import log
from selfdrive.hardware.base import HardwareBase, ThermalConfig

NetworkType = log.DeviceState.NetworkType
NetworkStrength = log.DeviceState.NetworkStrength



            

Reported by Pylint.

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Security blacklist

Line: 27
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random

                  print("uninstall")

  def get_imei(self, slot):
    return "%015d" % random.randint(0, 1 << 32)

  def get_serial(self):
    return "cccccccc"

  def get_subscriber_info(self):

            

Reported by Bandit.

selfdrive/thermald/power_monitoring.py
2 issues
No name 'log' in module 'cereal'
Error

Line: 6 Column: 1

              import time
from statistics import mean

from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog


            

Reported by Pylint.

Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Security blacklist

Line: 128
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b311-random

                        # On a charging EON with black panda, or drawing more than 400mA out of a white/grey one
          # Only way to get the power draw is to turn off charging for a few sec and check what the discharging rate is
          # We shouldn't do this very often, so make sure it has been some long-ish random time interval
          self.next_pulsed_measurement_time = now + random.randint(120, 180)
          return
        else:
          # Do nothing
          return


            

Reported by Bandit.

selfdrive/test/process_replay/compare_logs.py
2 issues
Unable to import 'dictdiffer'
Error

Line: 6 Column: 1

              import os
import sys
import numbers
import dictdiffer
from collections import Counter

if "CI" in os.environ:
  def tqdm(x):
    return x

            

Reported by Pylint.

Unable to import 'tqdm'
Error

Line: 13 Column: 3

                def tqdm(x):
    return x
else:
  from tqdm import tqdm  # type: ignore

from tools.lib.logreader import LogReader

EPSILON = sys.float_info.epsilon


            

Reported by Pylint.

selfdrive/car/chrysler/carcontroller.py
2 issues
Unable to import 'opendbc.can.packer'
Error

Line: 5 Column: 1

              from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, \
                                               create_wheel_buttons
from selfdrive.car.chrysler.values import CAR, CarControllerParams
from opendbc.can.packer import CANPacker

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.apply_steer_last = 0
    self.ccframe = 0

            

Reported by Pylint.

No name 'can' in module 'opendbc'
Error

Line: 5 Column: 1

              from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, \
                                               create_wheel_buttons
from selfdrive.car.chrysler.values import CAR, CarControllerParams
from opendbc.can.packer import CANPacker

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.apply_steer_last = 0
    self.ccframe = 0

            

Reported by Pylint.

selfdrive/car/mazda/carcontroller.py
2 issues
No name 'can' in module 'opendbc'
Error

Line: 3 Column: 1

              from selfdrive.car.mazda import mazdacan
from selfdrive.car.mazda.values import CarControllerParams, Buttons
from opendbc.can.packer import CANPacker
from selfdrive.car import apply_std_steer_torque_limits

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.apply_steer_last = 0
    self.packer = CANPacker(dbc_name)

            

Reported by Pylint.

Unable to import 'opendbc.can.packer'
Error

Line: 3 Column: 1

              from selfdrive.car.mazda import mazdacan
from selfdrive.car.mazda.values import CarControllerParams, Buttons
from opendbc.can.packer import CANPacker
from selfdrive.car import apply_std_steer_torque_limits

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.apply_steer_last = 0
    self.packer = CANPacker(dbc_name)

            

Reported by Pylint.

selfdrive/car/tesla/carcontroller.py
2 issues
No name 'can' in module 'opendbc'
Error

Line: 3 Column: 1

              from common.numpy_fast import clip, interp
from selfdrive.car.tesla.teslacan import TeslaCAN
from opendbc.can.packer import CANPacker
from selfdrive.car.tesla.values import CANBUS, CarControllerParams

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.CP = CP
    self.last_angle = 0

            

Reported by Pylint.

Unable to import 'opendbc.can.packer'
Error

Line: 3 Column: 1

              from common.numpy_fast import clip, interp
from selfdrive.car.tesla.teslacan import TeslaCAN
from opendbc.can.packer import CANPacker
from selfdrive.car.tesla.values import CANBUS, CarControllerParams

class CarController():
  def __init__(self, dbc_name, CP, VM):
    self.CP = CP
    self.last_angle = 0

            

Reported by Pylint.

tools/replay/can_replay.py
2 issues
Unable to import 'tqdm'
Error

Line: 5 Column: 1

              import os
import time
import threading
from tqdm import tqdm

os.environ['FILEREADER_CACHE'] = '1'

from common.realtime import config_realtime_process, Ratekeeper, DT_CTRL
from selfdrive.boardd.boardd import can_capnp_to_can_list

            

Reported by Pylint.

No name 'Panda' in module 'panda'
Error

Line: 12 Column: 1

              from common.realtime import config_realtime_process, Ratekeeper, DT_CTRL
from selfdrive.boardd.boardd import can_capnp_to_can_list
from tools.lib.logreader import LogReader
from panda import Panda
try:
  from panda_jungle import PandaJungle  # pylint: disable=import-error
except Exception:
  PandaJungle = None  # type: ignore


            

Reported by Pylint.