Skip to content

Conversation

JordanYates
Copy link
Contributor

Fix a variety of SonarQube issues

Reduce the implementation complexity by adding a fallback struct which
can be used to eliminate NULL checks.

Signed-off-by: Jordan Yates <[email protected]>
Reduce the number of `infuse_security_derive_key` arguments by turning
them into a struct.

Signed-off-by: Jordan Yates <[email protected]>
Extract the core read loop logic into a dedicated function to simplify
`epacket_udp_loop`.

Signed-off-by: Jordan Yates <[email protected]>
Simplify `cartesian_point_in_polygon` by reducing nesting levels.

Signed-off-by: Jordan Yates <[email protected]>
`bt_gatt_read` returns a full integer, so cannot use the `uint8_t` input
variable for storage.

Signed-off-by: Jordan Yates <[email protected]>
Simplify `opcode_run` by extracting the patch instruction implementation
as already done in `do_copy` and `do_write`.

Signed-off-by: Jordan Yates <[email protected]>
Validate the reconstructed payload matches the input buffer, in addition
to checking the generation of the buffer.

Signed-off-by: Jordan Yates <[email protected]>
Simplify the reconstructor function by extracting logic and reducing
nesting.

Signed-off-by: Jordan Yates <[email protected]>
Copy link

sonarqubecloud bot commented Sep 2, 2025

@JordanYates JordanYates merged commit ad7bb09 into main Sep 2, 2025
16 checks passed
@JordanYates JordanYates deleted the improve/func_complexity branch September 2, 2025 03:32
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