Code Insights

Code Insights は Bitbucket Server 5.15 に追加された機能です。  

この機能はプル リクエストに関連する情報を表示するため、作成者とレビュワーは十分な情報を得たうえで、より良い意思決定を行うことができます。次のような情報が提供されます。

  • 静的解析レポート
  • セキュリティ スキャン結果
  • アーティファクト リンク
  • ユニット テスト
  • build status

API と UI が含まれているため、サードパーティ製アプリケーションによって、プル リクエストで表示するためのデータを提供できます。 

情報はアノテーションレポートの 2 つの部分で構成されます。

連携

データをプル リクエストに送信するための連携機能を開発することもできます。サードパーティが開発した連携機能を Atlassian Marketplace で見つけることができます。 

Building an integration: Resources

If you're looking to build your own integration, we have some tutorials available on Atlassian's developer documentation site.

If you are interested in adding Code Insights as part of your CI pipeline, here is a very helpful resource

If you're wanting a more comprehensive overview of the feature and how it works, try the how to add code insights to pull requests tutorial.

品質レポートとアノテーション

品質レポート

The generated reports show summary information sent by any integration to Bitbucket Data Center and Server for your branch. They can also be run against your branch without sending a report.

レポートには次の内容が含まれる場合があります。

  • 説明
  • 報告者の URL に戻るためのリンク
  • 最大 6 つのデータ表示用フィールド
  • レポートに添付されたアノテーション (存在する場合) 

アノテーション

アノテーションはプル リクエストの特定の行に特定の情報を示し、レポートに添付されます。 

アノテーションは統合された形式のdiff ビューレポートに表示されます。side-by-side 形式の diff、コミットの diff またはイテラティブ diff には表示されません。

アノテーションは次の行に表示されます。

  • 変更された行
  • プル リクエストで追加された行

このため、自身に関係のない多数の煩わしいアノテーションが表示されることはありません。

Hiding annotations from the diff view

If you need to work without annotations enabled, you can hide them by using keyboard shortcut Shift + A or:

  1. Click Diff view settings .
  2. Clear the Annotations check box option in the menu.

Code coverage

To ensure code that you are reviewing meets the quality requirements it takes to move on to the next stage of development, review code covered directly inside of a pull request without leaving Bitbucket by integrating your code coverage tool.


As part of your continuous integration (CI) workflow, code coverage finds aspects of the code which may not have been covered adequately by tests. The results are compiled and displayed in the diff view by color-coded blocks presenting which lines of code are covered Fully, Partially, or Not covered.


You can then also dig into a coverage report if it’s provided, to see those actual lines that may not have been covered and use that to identify critical parts of your application that still need to be tested.

Hiding code coverage from the diff view

If you need to work without code coverage displayed, you can hide it by using keyboard shortcut Shift + V or:

Click Diff view settings .

Clear the Code coverage check box option in the menu.

Head to Atlassian Marketplace for Apps that support Code Insights. Here is the link to API if you want to integrate it with your own code coverage app.

最終更新日: 2023 年 1 月 31 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.