Skip to content

refector: monitor.c#33

Closed
damachine wants to merge 1 commit into
mainfrom
patch-3
Closed

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

Conversation

@damachine
Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/monitor.c
{
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
Comment thread src/monitor.c
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
Comment thread src/monitor.c
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
Comment thread src/monitor.c
*/
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
Comment thread src/monitor.c
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
Comment thread src/monitor.c
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
Comment thread src/monitor.c
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
Comment thread src/monitor.c
{
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
Comment thread src/monitor.c

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
Comment thread src/monitor.c
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.

2 participants