Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #132, Adds CheckStatus helper functions #137

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

chillfig
Copy link

@chillfig chillfig commented Aug 3, 2023

Describe the contribution

  • Fixes main - cyclomatic complexity of 21 #132, This improvement reduces the cyclomatic complexity of the main() function from 21 to 8 which is less than the recommended 15 cyclomatic complexity upper limit. The change accomplishes this improvement by adding two new status-checking helper functions.

Testing performed
CI

Expected behavior changes

  • No impact to behavior. This change distributes complexity to newly created helper functions.

System(s) tested on

  • OS: Ubuntu 20.04

Additional context

  • Note, that this improvement doesn't reduce the overall complexity of the elf2cfetbl program. It just distributes the complexity across the two new helper functions which each have 1 cyclomatic complexity, potentially making the code easier to understand and maintain.
  • Also note that the multiple return() statements are replaced with exit()via the two new helper functions. Calling return() from main() when no other non-daemon threads are running, will have the same effect as calling exit(). It will terminate the process. I chose to use exit() to make use of the new helper functions since elf2cfetbl does not appear to use multi-threading.

Third party code
N/A

Contributor Info - All information REQUIRED for consideration of pull request
Justin Figueroa, Vantage Systems

@chillfig chillfig added the enhancement New feature or request label Aug 3, 2023
@chillfig chillfig self-assigned this Aug 3, 2023
@chillfig chillfig force-pushed the refactorMain branch 4 times, most recently from 3f29a4b to 03dd2d1 Compare August 3, 2023 06:13
@chillfig chillfig changed the title Fix 132, Adds CheckStatus helper functions Fix #132, Adds CheckStatus helper functions Aug 3, 2023
@dzbaker dzbaker added CCB:Approved Indicates code approval by CCB Equuleus-rc2 and removed CCB:Ready labels Aug 3, 2023
dzbaker added a commit to nasa/cFS that referenced this pull request Sep 1, 2023
*Combines:*

cFE v7.0.0-rc4+dev384
psp v1.6.0-rc4+dev90
osal v6.0.0-rc4+dev229
elf2cfetbl v3.3.0-rc4+dev36
ci_lab v2.5.0-rc4+dev47

**Includes:**

*cFE*
- nasa/cFE#2401
- nasa/cFE#2403
- nasa/cFE#2380
- nasa/cFE#2400
- nasa/cFE#2420

*psp*
- nasa/PSP#395
- nasa/PSP#400

*osal*
- nasa/osal#1409

*elf2cfetbl*
- nasa/elf2cfetbl#137
- nasa/elf2cfetbl#136

*ci_lab*
- nasa/ci_lab#143

Co-authored by: Justin Figueroa <chillfig@users.noreply.github.com>
Co-authored by: Jacob Hageman  <skliper@users.noreply.github.com>
Co-authored by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored by: Jacob Killelea <jkillelea@users.noreply.github.com>
Co-authored by: Dylan Z. Baker <dzbaker@users.noreply.github.com>
@dzbaker dzbaker mentioned this pull request Sep 1, 2023
2 tasks
dzbaker added a commit to nasa/cFS that referenced this pull request Sep 1, 2023
*Combines:*

cFE v7.0.0-rc4+dev384
psp v1.6.0-rc4+dev90
osal v6.0.0-rc4+dev229
elf2cfetbl v3.3.0-rc4+dev36
ci_lab v2.5.0-rc4+dev47

**Includes:**

*cFE*
- nasa/cFE#2401
- nasa/cFE#2403
- nasa/cFE#2380
- nasa/cFE#2400
- nasa/cFE#2420

*psp*
- nasa/PSP#395
- nasa/PSP#400

*osal*
- nasa/osal#1409

*elf2cfetbl*
- nasa/elf2cfetbl#137
- nasa/elf2cfetbl#136

*ci_lab*
- nasa/ci_lab#143

Co-authored by: Justin Figueroa <chillfig@users.noreply.github.com>
Co-authored by: Jacob Hageman  <skliper@users.noreply.github.com>
Co-authored by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored by: Jacob Killelea <jkillelea@users.noreply.github.com>
Co-authored by: Dylan Z. Baker <dzbaker@users.noreply.github.com>
dzbaker added a commit to nasa/cFS that referenced this pull request Sep 1, 2023
*Combines:*

cFE v7.0.0-rc4+dev384
psp v1.6.0-rc4+dev90
osal v6.0.0-rc4+dev229
elf2cfetbl v3.3.0-rc4+dev36
ci_lab v2.5.0-rc4+dev47

**Includes:**

*cFE*
- nasa/cFE#2401
- nasa/cFE#2403
- nasa/cFE#2380
- nasa/cFE#2400
- nasa/cFE#2420

*psp*
- nasa/PSP#395
- nasa/PSP#400

*osal*
- nasa/osal#1409

*elf2cfetbl*
- nasa/elf2cfetbl#137
- nasa/elf2cfetbl#136

*ci_lab*
- nasa/ci_lab#143

Co-authored by: Justin Figueroa <chillfig@users.noreply.github.com>
Co-authored by: Jacob Hageman  <skliper@users.noreply.github.com>
Co-authored by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored by: Jacob Killelea <jkillelea@users.noreply.github.com>
Co-authored by: Dylan Z. Baker <dzbaker@users.noreply.github.com>
dzbaker added a commit to nasa/cFS that referenced this pull request Sep 1, 2023
*Combines:*

cFE v7.0.0-rc4+dev384
psp v1.6.0-rc4+dev90
osal v6.0.0-rc4+dev229
elf2cfetbl v3.3.0-rc4+dev36
ci_lab v2.5.0-rc4+dev47

**Includes:**

*cFE*
- nasa/cFE#2401
- nasa/cFE#2403
- nasa/cFE#2380
- nasa/cFE#2400
- nasa/cFE#2420

*psp*
- nasa/PSP#395
- nasa/PSP#400

*osal*
- nasa/osal#1409

*elf2cfetbl*
- nasa/elf2cfetbl#137
- nasa/elf2cfetbl#136

*ci_lab*
- nasa/ci_lab#143

Co-authored by: Justin Figueroa <chillfig@users.noreply.github.com>
Co-authored by: Jacob Hageman  <skliper@users.noreply.github.com>
Co-authored by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored by: Jacob Killelea <jkillelea@users.noreply.github.com>
Co-authored by: Dylan Z. Baker <dzbaker@users.noreply.github.com>
@dzbaker dzbaker merged commit b80af84 into nasa:main Sep 1, 2023
10 checks passed
dzbaker added a commit to nasa/cFS that referenced this pull request Sep 1, 2023
*Combines:*

cFE v7.0.0-rc4+dev384
psp v1.6.0-rc4+dev90
osal v6.0.0-rc4+dev229
elf2cfetbl v3.3.0-rc4+dev36
ci_lab v2.5.0-rc4+dev47

**Includes:**

*cFE*
- nasa/cFE#2401
- nasa/cFE#2403
- nasa/cFE#2380
- nasa/cFE#2400
- nasa/cFE#2420

*psp*
- nasa/PSP#395
- nasa/PSP#400

*osal*
- nasa/osal#1409

*elf2cfetbl*
- nasa/elf2cfetbl#137
- nasa/elf2cfetbl#136

*ci_lab*
- nasa/ci_lab#143

Co-authored by: Justin Figueroa <chillfig@users.noreply.github.com>
Co-authored by: Jacob Hageman  <skliper@users.noreply.github.com>
Co-authored by: Joseph Hickey <jphickey@users.noreply.github.com>
Co-authored by: Jacob Killelea <jkillelea@users.noreply.github.com>
Co-authored by: Dylan Z. Baker <dzbaker@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CCB:Approved Indicates code approval by CCB enhancement New feature or request Equuleus-rc2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

main - cyclomatic complexity of 21
2 participants