nasa / nasa/CF

Audit CF for cyclomatic complexity compliance

Open
#369 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C
Stars
120
Forks
77
Avg merge
7d 18h
Merged PRs (30d)
3

Description

Checklist (Please check before submitting)

[x ] I reviewed the [Contributing Guide](https://github.com/nasa/FM/blob/main/CONTRIBUTING.md).
[x ] I reviewed the [README file](https://github.com/nasa/FM/blob/main/README.md) to see if the feature is in the major future work.
[x ] I performed a cursory search to see if the feature request is relevant, not redundant, nor in conflict with other tickets.

Is your feature request related to a problem? Please describe.
NASA guidelines in NPR 7150.2D recommends maintaining a cyclomatic complexity (cc) in software, in particular flight software of 15 or less.

cf_cmd.c:CF_CmdWriteQueue (cc of 18) and cf_cfdp_r.c:CF_CFDP_R_Tick (cc of 17) unnecessarily violate the recommendation of a cyclomatic complexity of 15 or less.

Describe the solution you'd like
Audit cf_cmd.c:CF_CmdWriteQueue and cf_cfdp_r.c:CF_CFDP_R_Tick to see if functions would benefit from simplification such that they comply with NPR 7150.2D recommendation.

Requester Info
Dan Knutsen

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting cf_cmd.c:CF_CmdWriteQueue and cf_cfdp_r.c:CF_CFDP_R_Tick, focusing on the branches that produce cyclomatic complexity values of 18 and 17. Review the surrounding flight-software behavior before simplifying either function. Done means both functions comply with the NPR 7150.2D recommendation of cyclomatic complexity 15 or less.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.