Panel | ||||
---|---|---|---|---|
| ||||
Table of Contents
|
SonarQube collects a maximum of measures in an automated manner but there are some measures for which this is not possible, such as when: the information is not available for collection, the measure is computed by a human, and so on. Whatever the reason, SonarQube provides a service to inject those measures manually and allow you to benefit from other services: the Manual Measures service. The manual measures entered will be picked during the next analysis of the project and thereafter treated as "normal" measures.
Managing Custom Metrics
As with measures that are collected automatically, manual measures are collected on metrics. Therefore, the first thing is to create the metric you want to save your measure against. In order to do so, log in as a system administrator and go to Administration > Configuration > Custom Metrics:
Managing Custom Measures
Custom measures can be entered at project level and module level. To add a measure, sign in as a project administrator, desired project and choose Administration > Custom Measures. You are presented with a table containing the latest measure entered for each metric:
The orange marker means that no analysis has been run since the manual measure was entered, and therefore it will not appear on the component.
From there, you have the ability to edit or delete an existing measure or enter a new one:
Whatever action is taken on a custom measure, the new value will be picked by the next analysis of the component, and shown in the Measures page with everything else
사용자 정의 지표
SonarQube는 소스 코드를 분석하는 과정에서 가능한 많은 지표(measure)를 수집합니다. 그러나 자동으로 수집할 수 없는 지표들도 있습니다. 예를 들면 사람이 직접 계산해야 하는 정보들이 경우입니다. SonarQube는 이러한 지표들을 사용자가 직접 입력할 수 있도록 Manual Measures 기능을 제공합니다. 이 기능을 통해 입력한 지표들은 다음 차례 분석시부터 "일반적인" 지표들과 동일하게 간주됩니다.
사용자 정의 메트릭 관리하기
자동으로 수집되는 지표 및 사용자 정의 지표들은 메트릭(Metric)으로 수집되며, 메트릭 수집을 위해서는 지표 기준을 생성해야 합니다. 사용자 정의 지표 기준을 생성하려면, System administrator 계정으로 로그인 후, Administration > Configuration > Custom Metrics 메뉴룰 사용합니다.
사용자 정의 지표 기준 관리하기
사용자 정의 지표는 프로젝트 및 모듈 레벨에서 입력할 수 있습니다. 지표를 추가하려면 project administrator 계정으로 로그인 후 Administration > Custom Measures 메뉴를 사용합니다. 각 메트릭 별로 가장 최근 입력한 지표들을 포함하는 테이블이 표시됩니다:
오렌지색 마커는 해당 사용자 지표가 생성된 이후, 분석이 수행되지 않았음을 의미하며, 해당 지표는 컴포넌트에 표시되지 않습니다.
위의 화면에서 지표를 수정하거나 생성, 삭제할 수 있습니다:
이후 새롭게 코드를 분석한 후 해당 결과가 Measures 페이지 및 다른 페이지에 표시됩니다.