•  


CodeQL scanned fewer lines than expected - GitHub Docs
Skip to main content

CodeQL scanned fewer lines than expected

If CodeQL analyzed less code than you expected, you may need to use a custom build command.

About analysis of compiled languages

When compiled languages are analyzed using the autobuild or manual build mode, CodeQL only scans files that are built during the analysis. Therefore the number of lines of code scanned will be lower than expected if some of the source code isn't compiled correctly. This can happen for several reasons:

  1. The CodeQL autobuild feature uses heuristics to build the code in a repository. However, sometimes this approach results in an incomplete analysis of a repository. For example, when multiple build.sh commands exist in a single repository, the analysis may not be complete since the autobuild step will only execute one of the commands, and therefore some source files may not be compiled.

  2. Some compilers do not work with CodeQL and can cause issues while analyzing the code. For example, most vendor-specific C compilers will not be recognized by CodeQL. C code will need to be compiled with a recognized compiler (for example GCC, Clang or MSVC) in order to be analyzed.

If your CodeQL analysis scans fewer lines of code than expected, you can try changing the build mode to manual and specifying build commands if your workflow specifies a build mode, replacing the autobuild step with build commands if your workflow contains an autobuild step, or inspecting the copy of the source files in the CodeQL database.

Change to a manual build process

Replace the autobuild process with the same build commands you would use in production. This makes sure that CodeQL knows exactly how to compile all of the source files you want to scan. For more information about defining build steps, see " CodeQL code scanning for compiled languages ."

Inspect the copy of the source files in the CodeQL database

You may be able to understand why some source files haven't been analyzed by inspecting the copy of the source code included with the CodeQL database. To obtain the database from your Actions workflow, modify the init step of your CodeQL workflow file and set debug: true .

-
 name:
 Initialize
 CodeQL

  uses:
 github/codeql-action/init@v3

  with:

    debug:
 true

This uploads the database as an actions artifact that you can download to your local machine. For more information, see " Storing workflow data as artifacts ."

The artifact will contain an archived copy of the source files scanned by CodeQL called src.zip . If you compare the source code files in the repository and the files in src.zip , you can see which types of file are missing. Once you know what types of file are not being analyzed, it is easier to understand how you may need to change the workflow for CodeQL analysis.

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본