Skip to content

Conversation

@thnkslprpt
Copy link
Contributor

Checklist

Describe the contribution

Testing performed
GitHub CI actions all passing successfully (incl. Build + Run, Coverage/Functional Tests etc.).
Local tests confirm the modified commands are working as expected:
Screenshot 2023-05-19 19 49 12
Net coverage is unchanged (total lines reduced by 22, total branches reduced by 4).

Expected behavior changes
Behavior/logic is unchanged.
Code duplication reduced, easing future maintenance.

System(s) tested on
Debian GNU/Linux 11 (bullseye)
Current main branch of cFS bundle.

Contributor Info
Avi Weiss @thnkslprpt

NewTime.Subseconds = CFE_TIME_Micro2SubSecs(CommandPtr->MicroSeconds);

CFE_TIME_SetTime(NewTime);
SetTimeFunc(NewTime);

Check notice

Code scanning / CodeQL

Use of non-constant function pointer

This call does not go through a const function pointer.
*
*-----------------------------------------------------------------*/
int32 CFE_TIME_SetTimeCmd(const CFE_TIME_SetTimeCmd_t *data)
static void CFE_TIME_SetCommand(const CFE_TIME_TimeCmd_Payload_t *CommandPtr, void (*SetTimeFunc)(CFE_TIME_SysTime_t),

Check notice

Code scanning / CodeQL

Long function without assertion

All functions of more than 10 lines should have at least one assertion.
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.

Refactor common logic out of CFE_TIME_SetTime/MET/STCFCmd()

1 participant