Skip to main content

Эта версия GitHub Enterprise Server была прекращена 2024-03-26. Исправления выпускаться не будут даже при критических проблемах безопасности. Для повышения производительности, повышения безопасности и новых функций выполните обновление до последней версии GitHub Enterprise Server. Чтобы получить справку по обновлению, обратитесь в службу поддержки GitHub Enterprise.

Просмотр журналов проверки кода

Выходные данные, созданные во время анализа code scanning в ваш экземпляр GitHub Enterprise Server.

Кто эту функцию можно использовать?

If you have write permissions to a repository, you can view the code scanning logs for that repository.

Code scanning доступен для репозиториев, принадлежащих организации, в GitHub Enterprise Server. Для этой функции требуется лицензия на GitHub Advanced Security. Дополнительные сведения см. в разделе Сведения о GitHub Advanced Security.

Note: Your site administrator must enable code scanning for your GitHub Enterprise Server instance before you can use this feature. If you want to use GitHub Actions to scan your code, the site administrator must also enable GitHub Actions and set up the infrastructure required. For more information, see "Configuring code scanning for your appliance."

About your code scanning configuration

You can use a variety of tools to configure code scanning in your repository. For more information, see "Configuring code scanning."

The log and diagnostic information available to you depends on the method you use for code scanning in your repository. You can check the type of code scanning you're using in the Security tab of your repository, by using the Tool drop-down menu in the alert list. For more information, see "Managing code scanning alerts for your repository."

About analysis and diagnostic information

You can see analysis and diagnostic information for code scanning run using CodeQL analysis on GitHub.

Analysis information is shown for the most recent analysis in a header at the top of the list of alerts. For more information, see "Managing code scanning alerts for your repository."

Diagnostic information is displayed in the Action workflow logs and consists of summary metrics and extractor diagnostics. For information about accessing code scanning logs on GitHub, see "Viewing the logging output from code scanning" below.

If you're using the CodeQL CLI outside GitHub, you'll see diagnostic information in the output generated during database analysis. This information is also included in the SARIF results file you upload to GitHub with the code scanning results.

For information about the CodeQL CLI, see "Analyzing your code with CodeQL queries."

About summary metrics

Summary metrics include:

  • Lines of code in the codebase (used as a baseline), before creation and extraction of the CodeQL database
  • Lines of code in the CodeQL database extracted from the code, including external libraries and auto-generated files
  • Lines of code in the CodeQL database excluding auto-generated files and external libraries

About CodeQL source code extraction diagnostics

Extractor diagnostics only cover files that were seen during the analysis, metrics include:

  • Number of files successfully analyzed
  • Number of files that generated extractor errors during database creation
  • Number of files that generated extractor warnings during database creation

You can see more detailed information about CodeQL extractor errors and warnings that occurred during database creation by enabling debug logging. For more information, see "Logs are not detailed enough."

Viewing the logging output from code scanning

This section applies to code scanning run using GitHub Actions (CodeQL or third-party).

After configuring code scanning for your repository, you can watch the output of the actions as they run.

  1. Under your repository name, click Actions.

    Screenshot of the tabs for the "github/docs" repository. The "Actions" tab is highlighted with an orange outline.

    You'll see a list that includes an entry for running the code scanning workflow. The text of the entry is the title you gave your commit message.

    Screenshot of the "All workflows" page. In the list of workflow runs is a run labeled "Create .github/workflows/codeql.yml."

  2. Click the entry for the code scanning workflow.1. Click the job name on the left. For example, Analyze (LANGUAGE).

    Screenshot of the log output for the "Analyze (go)" job. In the left sidebar, under the "Jobs" heading, "Analyze (go)" is listed.

  3. Review the logging output from the actions in this workflow as they run.

  4. Optionally, to see more detail about the commit that triggered the workflow run, click the short commit hash. The short commit hash is 7 lowercase characters immediately following the commit author's username.

  5. Once all jobs are complete, you can view the details of any code scanning alerts that were identified. For more information, see "Managing code scanning alerts for your repository."