> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corgea.app/llms.txt
> Use this file to discover all available pages before exploring further.

# コード品質の検出を一覧表示

> コード品質の検出をセキュリティ検出とは別に取得します。classificationの値にはCWEではなく、Maintainabilityなどのコード品質ラベルが使用されます。 デフォルトでは作成日時の新しい順に並びます。同じ作成日時の結果は検出IDで順序を決めるため、ページ分割時も順序が安定します。 スキャンIDを指定しない場合、条件に一致する処理済みスキャンのうち、PRに属さずプロジェクト全体を対象とする最新スキャンを優先します。該当しなければ、条件に一致する最新スキャンを使用します。/detectionsまたは/detections/code-qualityでscan_typeを明示すると、その種類の最新スキャンを選択します。

以前の名前である`/api/v1/issues/code-quality`でも引き続き利用でき、パラメーターとレスポンスは同じです。



## OpenAPI

````yaml /ja/api-reference/openapi.json get /detections/code-quality
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: Corgeaのスキャン機能および脆弱性管理機能を操作するためのAPI
servers:
  - url: https://www.corgea.app/api/v1
    description: 本番サーバー
  - url: https://eu.corgea.app/api/v1
    description: EU本番サーバー
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /detections/code-quality:
    get:
      tags:
        - 検出
      summary: コード品質の検出を一覧表示
      description: >-
        コード品質の検出をセキュリティ検出とは別に取得します。classificationの値にはCWEではなく、Maintainabilityなどのコード品質ラベルが使用されます。
        デフォルトでは作成日時の新しい順に並びます。同じ作成日時の結果は検出IDで順序を決めるため、ページ分割時も順序が安定します。
        スキャンIDを指定しない場合、条件に一致する処理済みスキャンのうち、PRに属さずプロジェクト全体を対象とする最新スキャンを優先します。該当しなければ、条件に一致する最新スキャンを使用します。/detectionsまたは/detections/code-qualityでscan_typeを明示すると、その種類の最新スキャンを選択します。


        以前の名前である`/api/v1/issues/code-quality`でも引き続き利用でき、パラメーターとレスポンスは同じです。
      operationId: listCodeQualityIssues
      parameters:
        - name: project
          in: query
          schema:
            type: string
          description: プロジェクト名で問題を絞り込みます
        - name: repo
          in: query
          schema:
            type: string
          description: リポジトリURLで問題を絞り込みます
        - name: branch
          in: query
          schema:
            type: string
          description: ブランチ名で問題を絞り込みます
        - name: classification
          in: query
          schema:
            type: string
          description: コード品質の分類ラベルで絞り込みます（部分一致）
          example: Maintainability
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          schema:
            type: integer
            default: 20
            maximum: 50
      responses:
        '200':
          description: コード品質の問題を正常に取得しました
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: integer
                  total_pages:
                    type: integer
                  total_issues:
                    type: integer
                  issues:
                    type: array
                    items:
                      $ref: '#/components/schemas/Issue'
components:
  schemas:
    Issue:
      type: object
      properties:
        finding_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            この問題が検出として属するファインディングのID。再スキャンを経ても変わりません。ファインディングが導入される前に取り込まれた問題ではnullです。
        id:
          type: string
          format: uuid
        classification:
          type: object
          nullable: true
          description: >-
            CWEが不明な場合、または分類が自由形式のラベルの場合、idとnameには元の分類ラベルが入り、descriptionはnullになります。分類が空の場合はnullが返されます。
          properties:
            id:
              type: string
              example: CWE-123
            name:
              type: string
              example: Vulnerability Name
            description:
              type: string
              nullable: true
        urgency:
          type: string
          enum:
            - CR
            - HI
            - ME
            - LO
          description: '緊急度コード: CR（重大）、HI（高）、ME（中）、LO（低）。'
        created_at:
          type: string
          format: date-time
        first_detection_date:
          type: string
          format: date-time
          description: >-
            この問題が出現したすべてのスキャンの中で、Corgeaが最初に検出した日時です。これが最初の検出の場合はcreated_atと同じ値になります。
        status:
          type: string
          nullable: true
          enum:
            - open
            - fix_in_progress
            - fixed
            - false_positive
            - accepted_risk
            - duplicate
        sla_status:
          type: string
          nullable: true
          enum:
            - overdue
            - escalated
          description: SLA違反の状態です。期限超過でもエスカレーション済みでもない場合はnullです。
        location:
          $ref: '#/components/schemas/IssueLocation'
        auto_triage:
          $ref: '#/components/schemas/AutoTriage'
        auto_fix_suggestion:
          $ref: '#/components/schemas/AutoFixSuggestion'
        assigned_to:
          $ref: '#/components/schemas/AssignedTo'
        reachability:
          $ref: '#/components/schemas/IssueReachabilitySummary'
    IssueLocation:
      type: object
      properties:
        file:
          type: object
          properties:
            name:
              type: string
            language:
              type: string
            path:
              type: string
            git_hash:
              type: string
              nullable: true
              description: スキャンしたファイルについて記録されたGitハッシュです。問題の一覧を返すエンドポイントでのみ返されます。
        project:
          type: object
          properties:
            name:
              type: string
            branch:
              type: string
            git_sha:
              type: string
        line_number:
          type: integer
        sink_line_number:
          type: integer
          nullable: true
          description: データフローのシンクがこのファイル内にある場合はその行番号、それ以外の場合はnullです。個別の問題を取得した場合にのみ返されます。
    AutoTriage:
      type: object
      properties:
        false_positive_detection:
          type: object
          properties:
            status:
              type: string
              enum:
                - valid
                - false_positive
                - pending
            reasoning:
              description: 誤検知と判断した理由を、利用可能な場合に返します。修正が生成されなかった場合も対象です。
              type: string
              nullable: true
    AutoFixSuggestion:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - fix_available
            - no_fix
            - generating
            - false_positive
            - on_hold
            - unsupported
            - plan
          description: >-
            現在の修正の利用可否。問題を取得すると、デフォルトで生成可能な未生成の修正をバックグラウンドで生成し始めます。その生成中はステータスがgeneratingになります。生成が完了するまで問題を再取得してください。生成が無効な場合、または修正が生成されない場合、ステータスはno_fixになります。
        patch:
          type: object
          properties:
            diff:
              type: string
              description: unified diff形式のパッチ。修正に差分がない場合は空文字列を返します。
            explanation:
              type: string
              description: 修正によって脆弱性がどのように解消されるかの説明
            full_code:
              type: string
              description: 修正を適用したファイルのソースコード全体です。show_full_codeがtrueで、修正が存在する場合にのみ返されます。
    AssignedTo:
      type: object
      nullable: true
      description: 問題の担当ユーザー。未割り当ての場合はnullです。
      properties:
        id:
          type: string
          description: 担当ユーザーのID。
        email:
          type: string
          format: email
          description: 担当ユーザーのメールアドレス。
        name:
          type: string
          nullable: true
          description: 担当ユーザーの表示名。利用できない場合はnullです。
    IssueReachabilitySummary:
      type: object
      description: include_reachabilityがtrueの場合に返されるエンドポイント到達可能性の概要。
      properties:
        is_reachable:
          type: boolean
        endpoint_count:
          type: integer
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: 認証用のAPIキー 無効なユーザーのAPIトークンは拒否されます。
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Authorizationヘッダーで使用するOAuth2アクセストークン（JWT）

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.