diff --git a/.github/workflows/static-analysis-misra.yml b/.github/workflows/static-analysis-misra.yml index a3dd0347c..d21a497e7 100644 --- a/.github/workflows/static-analysis-misra.yml +++ b/.github/workflows/static-analysis-misra.yml @@ -46,7 +46,7 @@ jobs: with: submodules: true - - name: get MISRA addon + - name: Get MISRA addon run: | sudo apt-get install git -y git clone https://github.com/danmar/cppcheck.git @@ -57,32 +57,70 @@ jobs: - name: Run bundle cppcheck if: ${{matrix.cppcheck =='bundle'}} run: | + cppcheck --addon=misra --force --inline-suppr --quiet . --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml cppcheck --addon=misra --force --inline-suppr --quiet . 2> ${{matrix.cppcheck}}_cppcheck_err.txt - + # Run strict static analysis for embedded portions of cfe, osal, and psp - name: cfe strict cppcheck if: ${{matrix.cppcheck =='cfe'}} run: | cd ${{matrix.cppcheck}} - cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER 2> ../${{matrix.cppcheck}}_cppcheck_err.txt + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./modules/core_api/fsw ./modules/core_private/fsw ./modules/es/fsw ./modules/evs/fsw ./modules/fs/fsw ./modules/msg/fsw ./modules/resourceid/fsw ./modules/sb/fsw ./modules/sbr/fsw ./modules/tbl/fsw ./modules/time/fsw -UCFE_PLATFORM_TIME_CFG_CLIENT -DCFE_PLATFORM_TIME_CFG_SERVER 2> ${{matrix.cppcheck}}_cppcheck_err.txt - name: osal strict cppcheck if: ${{matrix.cppcheck =='osal'}} run: | cd ${{matrix.cppcheck}} - cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os 2> ../${{matrix.cppcheck}}_cppcheck_err.txt + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./src/bsp ./src/os 2> ${{matrix.cppcheck}}_cppcheck_err.txt - name: psp strict cppcheck if: ${{matrix.cppcheck =='psp'}} run: | cd ${{matrix.cppcheck}} - cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw 2> ../${{matrix.cppcheck}}_cppcheck_err.txt + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw --xml 2> ${{matrix.cppcheck}}_cppcheck_err.xml + cppcheck --addon=misra --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ./fsw 2> ${{matrix.cppcheck}}_cppcheck_err.txt + + - name: Convert bundle cppcheck to sarif + uses: airtower-luna/convert-to-sarif@v0.2.0 + if: ${{matrix.cppcheck =='bundle'}} + with: + tool: 'CppCheck' + input_file: '${{matrix.cppcheck}}_cppcheck_err.xml' + sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif' - - name: Archive Static Analysis Artifacts - uses: actions/upload-artifact@v2 + - name: Convert cfe, osal, psp cppcheck to sarif + uses: airtower-luna/convert-to-sarif@v0.2.0 + if: ${{matrix.cppcheck !='bundle'}} + with: + tool: 'CppCheck' + input_file: '${{matrix.cppcheck}}/${{matrix.cppcheck}}_cppcheck_err.xml' + sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif' + + - name: Define workspace + run: | + echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV} + + - name: Archive bundle static analysis artifacts + uses: actions/upload-artifact@v3 + if: ${{matrix.cppcheck =='bundle'}} with: name: ${{matrix.cppcheck}}-cppcheck-err - path: ./*cppcheck_err.txt + path: ./*cppcheck_err.* + + - name: Archive osal, cfe, and psp static analysis artifacts + uses: actions/upload-artifact@v3 + if: ${{matrix.cppcheck !='bundle'}} + with: + name: ${{matrix.cppcheck}}-cppcheck-err + path: ./${{matrix.cppcheck}}/*cppcheck_err.* + + - name: Upload sarif results + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: '${{matrix.cppcheck}}_cppcheck_err.sarif' + checkout_path: ${{ env.CONTAINER_WORKSPACE }} - name: Check for errors run: | diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index decb2fda6..d6f5e1237 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -48,9 +48,56 @@ jobs: with: submodules: true - - name: Run general cppcheck - run: cppcheck --force --inline-suppr . 2> general_cppcheck_err.txt + - name: Run general cppcheck + run: | + cppcheck --force --inline-suppr . --xml 2> general_cppcheck_err.xml + cppcheck --force --inline-suppr . 2> general_cppcheck_err.txt + + - name: Convert general cppcheck + uses: airtower-luna/convert-to-sarif@v0.2.0 + with: + tool: 'CppCheck' + input_file: 'general_cppcheck_err.xml' + sarif_file: 'general_cppcheck_err.sarif' + + - name: Define workspace + run: | + echo "CONTAINER_WORKSPACE=${PWD}" >> ${GITHUB_ENV} + + - name: Upload general SARIF results + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: 'general_cppcheck_err.sarif' + checkout_path: ${{ env.CONTAINER_WORKSPACE }} + # Run strict static analysis for embedded portions of cfe, osal, and psp + - name: Strict cppcheck + if: ${{ inputs.strict-dir-list !='' }} + run: | + cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ${{ inputs.strict-dir-list }} --xml 2> strict_cppcheck_err.xml + cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ${{ inputs.strict-dir-list }} 2> strict_cppcheck_err.txt + + - name: Convert strict cppcheck + uses: airtower-luna/convert-to-sarif@v0.2.0 + if: ${{ inputs.strict-dir-list !='' }} + with: + tool: 'CppCheck' + input_file: 'strict_cppcheck_err.xml' + sarif_file: 'strict_cppcheck_err.sarif' + + - name: Archive static analysis artifacts + uses: actions/upload-artifact@v3 + with: + name: cppcheck-errors + path: ./*cppcheck_err.* + + - name: Upload strict SARIF results + uses: github/codeql-action/upload-sarif@v2 + if: ${{ inputs.strict-dir-list !='' }} + with: + sarif_file: 'strict_cppcheck_err.sarif' + checkout_path: ${{ env.CONTAINER_WORKSPACE }} + - name: Check for general errors run: | if [[ -s general_cppcheck_err.txt ]]; @@ -58,12 +105,6 @@ jobs: cat general_cppcheck_err.txt exit -1 fi - - # Run strict static analysis for embedded portions of cfe, osal, and psp - - name: Strict cppcheck - if: ${{ inputs.strict-dir-list !='' }} - run: cppcheck --force --inline-suppr --std=c99 --language=c --enable=warning,performance,portability,style --suppress=variableScope --inconclusive ${{ inputs.strict-dir-list }} 2> strict_cppcheck_err.txt - - name: Check for strict errors if: ${{ inputs.strict-dir-list !='' }} run: | @@ -72,9 +113,3 @@ jobs: cat strict_cppcheck_err.txt exit -1 fi - - - name: Archive Static Analysis Artifacts - uses: actions/upload-artifact@v2 - with: - name: cppcheck-errors - path: ./*cppcheck_err.txt diff --git a/README.md b/README.md index 3fe23f35c..afc619b74 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ [![Build Linux](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml/badge.svg)](https://github.com/nasa/cfs/actions/workflows/build-cfs.yml) [![Build RTEMS 5](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml/badge.svg)](https://github.com/nasa/cFS/actions/workflows/build-cfs-rtems5.yml) -[![LGTM Alerts](https://img.shields.io/lgtm/alerts/github/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/alerts/?mode=list) -[![LGTM Grade](https://img.shields.io/lgtm/grade/cpp/g/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/context:cpp) -[![LGTM Grade](https://img.shields.io/lgtm/grade/python/g/nasa/cFS.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/nasa/cFS/context:python) # Core Flight System - BUNDLE diff --git a/SECURITY.md b/SECURITY.md index 59dc33bed..8116df2e3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -24,14 +24,6 @@ CodeQL is ran for every push and pull-request on all branches of cFS in GitHub A For the CodeQL GitHub Actions setup, visit https://github.com/github/codeql-action. -### LGTM - -LGTM [results](https://lgtm.com/projects/g/nasa/cFS?mode=list) are available to the public. Since suppression comments are not used, many warnings and errors may not be accurate. Therefore, the results may contain false positives and other inapplicable warnings and errors. - -LGTM is ran for every pull-request on all branches of cFS. - -For more information about LGTM, visit https://lgtm.com/. - ### Cppcheck The [cFS Cppcheck GitHub Actions workflow and results](https://github.com/nasa/cFS/actions/workflows/static-analysis.yml) are available to the public. To view the results, select a workflow and download the artifacts. diff --git a/apps/ci_lab b/apps/ci_lab index 0ea953f29..a5e8b4b01 160000 --- a/apps/ci_lab +++ b/apps/ci_lab @@ -1 +1 @@ -Subproject commit 0ea953f296c5836ee3a482a922ab15edf388f5a4 +Subproject commit a5e8b4b013c59f073ca065f325e40bfebba1e8a0 diff --git a/apps/sample_app b/apps/sample_app index 3c2c9cb6f..a410436f9 160000 --- a/apps/sample_app +++ b/apps/sample_app @@ -1 +1 @@ -Subproject commit 3c2c9cb6f59d02cfb65b9857f1f17974d8bbc3d1 +Subproject commit a410436f97e4ffdfffcc6a7eba806800f5d29671 diff --git a/apps/sch_lab b/apps/sch_lab index 3b13636ac..7bb334284 160000 --- a/apps/sch_lab +++ b/apps/sch_lab @@ -1 +1 @@ -Subproject commit 3b13636ac5d9f5bea084afbcea75795d43f0f359 +Subproject commit 7bb334284b673f918e186b6e7c3368560e200ede diff --git a/apps/to_lab b/apps/to_lab index a6ab386af..9e2ad8ccc 160000 --- a/apps/to_lab +++ b/apps/to_lab @@ -1 +1 @@ -Subproject commit a6ab386afba7fe3a3d429006c987d1dda2fde3ed +Subproject commit 9e2ad8cccafaad6d09902213971344d9e277e9f9 diff --git a/cfe b/cfe index 749444164..f0703a7c7 160000 --- a/cfe +++ b/cfe @@ -1 +1 @@ -Subproject commit 749444164c799d5498a8f0621f8e16a946a57145 +Subproject commit f0703a7c779a02f2edaf90019149a5f80922e810 diff --git a/libs/sample_lib b/libs/sample_lib index 286bb590e..2da117338 160000 --- a/libs/sample_lib +++ b/libs/sample_lib @@ -1 +1 @@ -Subproject commit 286bb590eff417cda32d921173469afd059a3695 +Subproject commit 2da1173382038863d585a8de49a09fd4e6b5e4f9 diff --git a/osal b/osal index b8e9b83c9..0bd6c4216 160000 --- a/osal +++ b/osal @@ -1 +1 @@ -Subproject commit b8e9b83c9a09c8e47ee796105d2a1aed3001db56 +Subproject commit 0bd6c4216bca5954ed5e919e59e21ab175c5c7b6 diff --git a/tools/cFS-GroundSystem b/tools/cFS-GroundSystem index 32f361cee..89d90e369 160000 --- a/tools/cFS-GroundSystem +++ b/tools/cFS-GroundSystem @@ -1 +1 @@ -Subproject commit 32f361cee4de7296770eb3ed6edf91afe880c1f7 +Subproject commit 89d90e369d8fabdfa73a4ace042ed5502b5495e8 diff --git a/tools/elf2cfetbl b/tools/elf2cfetbl index b6aa1c072..f06075102 160000 --- a/tools/elf2cfetbl +++ b/tools/elf2cfetbl @@ -1 +1 @@ -Subproject commit b6aa1c072da94295e216a7b794f51d6724a1646c +Subproject commit f060751028fc421c8e1747c92ebec2fb2b3b81cb diff --git a/tools/tblCRCTool b/tools/tblCRCTool index 251e28fcf..9abe3a7a5 160000 --- a/tools/tblCRCTool +++ b/tools/tblCRCTool @@ -1 +1 @@ -Subproject commit 251e28fcf6d633e414c4a00646311d25f3a4df4d +Subproject commit 9abe3a7a50e8c0ecd1afeefe325403838d3579cc