Skip to content

refector: monitor.c#33

Closed
damachine wants to merge 1 commit intomainfrom
patch-3
Closed

refector: monitor.c#33
damachine wants to merge 1 commit intomainfrom
patch-3

Conversation

@damachine
Copy link
Owner

No description provided.

{
if (strcmp(device_type, "CPU") == 0 && strcmp(sensor_name, "temp1") == 0)
{
return 1;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
return 1;
}

if (strcmp(device_type, "GPU") == 0 &&

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
if (strcmp(device_type, "GPU") == 0 &&
(strstr(sensor_name, "GPU") || strstr(sensor_name, "gpu")))
{
return 1;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
*/
static int is_temperature_valid(float temperature)
{
return temperature >= -50.0f && temperature <= 150.0f;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
const char *sensor_name = json_string_value(name_val);
float temperature = (float)json_number_value(temp_val);

if (!is_temperature_valid(temperature))

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.6 rule Note

MISRA 15.6 rule
if (!devices || !json_is_array(devices))
{
json_decref(root);
return NULL;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule
float *temperature, int *found_flag)
{
const char *device_type = extract_device_type_from_json(device);
if (!device_type || *found_flag)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.6 rule Note

MISRA 15.6 rule
{
const char *device_type = extract_device_type_from_json(device);
if (!device_type || *found_flag)
return;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.5 rule Note

MISRA 15.5 rule

if (strcmp(device_type, target_type) == 0)
{
if (temperature)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 14.4 rule Note

MISRA 14.4 rule
initialize_temperature_outputs(temp_cpu, temp_gpu);

json_t *root = parse_json_and_get_devices(json);
if (!root)

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.6 rule Note

MISRA 15.6 rule
@damachine damachine closed this Sep 14, 2025
@damachine damachine deleted the patch-3 branch September 14, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant