Skip to content

Conversation

@dzbaker
Copy link
Contributor

@dzbaker dzbaker commented Jan 15, 2026

NASA Docket No. GSC-19,200-1, and identified as "cFS Draco"
Batch update of latest cFS software release

Reflects commit 9712a6105855aaa6036545daecf66d2f2c43d38f from NASA internal development repo

@jphickey jphickey force-pushed the draco-integration branch 2 times, most recently from 8f1fc1f to 5dd9250 Compare January 22, 2026 23:16
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Batch update of latest cFS software release

Reflects commit 9712a6105855aaa6036545daecf66d2f2c43d38f from NASA internal development repo
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
void FM_ProcessCmd(const CFE_SB_Buffer_t *BufPtr)
void FM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr)

Check warning

Code scanning / CodeQL

Poorly documented large function Warning

Poorly documented function: fewer than 2% comments for a function of 141 lines.

Copilot Autofix

AI about 23 hours ago

In general, the best fix is to add a clear, structured comment block documenting FM_ProcessGroundCommand, including its purpose, how it processes commands, expectations on the input buffer, and its error-handling behavior. This raises the comment density within the function’s region and provides maintainers with important context, without altering any functionality.

Concretely, we should add a Doxygen-style function header comment immediately above the definition of FM_ProcessGroundCommand (line 84) in fsw/src/fm_dispatch.c. The comment should briefly describe that this is the ground command dispatcher for the FM application, that it extracts the function code from the incoming software bus buffer, verifies command length for each specific command type, and invokes the corresponding handler. It should also describe the BufPtr parameter and note that invalid or malformed commands will result in an error event and increment of the command error counter by the called verification routine. No new imports or code changes are needed—just the documentation.

Suggested changeset 1
fsw/src/fm_dispatch.c

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/fsw/src/fm_dispatch.c b/fsw/src/fm_dispatch.c
--- a/fsw/src/fm_dispatch.c
+++ b/fsw/src/fm_dispatch.c
@@ -81,6 +81,24 @@
 /* FM application -- command packet processor                      */
 /*                                                                 */
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/**
+ * @brief Process a ground command message for the File Manager (FM) application.
+ *
+ * This routine is the central dispatcher for all FM ground commands received
+ * on the software bus. It extracts the FM function code from the incoming
+ * message buffer and, based on the code, verifies the command message length
+ * and invokes the corresponding FM command handler.
+ *
+ * The command-specific length checks are performed via #FM_VerifyCmdLength
+ * prior to calling each handler. If a length mismatch is detected, an error
+ * event is generated and the FM command error counter is incremented; the
+ * associated handler is not called in that case.
+ *
+ * @param[in] BufPtr Pointer to the software bus buffer that contains the
+ *                   FM ground command message to be processed. This pointer
+ *                   is expected to reference a valid, fully-populated
+ *                  CFE_SB_Buffer_t structure received from the software bus.
+ */
 void FM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr)
 {
     CFE_MSG_FcnCode_t CommandCode = 0;
EOF
@@ -81,6 +81,24 @@
/* FM application -- command packet processor */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* @brief Process a ground command message for the File Manager (FM) application.
*
* This routine is the central dispatcher for all FM ground commands received
* on the software bus. It extracts the FM function code from the incoming
* message buffer and, based on the code, verifies the command message length
* and invokes the corresponding FM command handler.
*
* The command-specific length checks are performed via #FM_VerifyCmdLength
* prior to calling each handler. If a length mismatch is detected, an error
* event is generated and the FM command error counter is incremented; the
* associated handler is not called in that case.
*
* @param[in] BufPtr Pointer to the software bus buffer that contains the
* FM ground command message to be processed. This pointer
* is expected to reference a valid, fully-populated
* CFE_SB_Buffer_t structure received from the software bus.
*/
void FM_ProcessGroundCommand(const CFE_SB_Buffer_t *BufPtr)
{
CFE_MSG_FcnCode_t CommandCode = 0;
Copilot is powered by AI and may make mistakes. Always verify output.
@jphickey jphickey marked this pull request as ready for review January 23, 2026 12:42
@dzbaker dzbaker merged commit 558a776 into main Jan 23, 2026
13 checks passed
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.

3 participants