github.com/prebid/prebid-server/v2@v2.18.0/.semgrep/adapter/bid-type-if-check.yml (about)

     1  rules:
     2    - id: bid-type-if-check
     3      message: The current implementation follows an anti-pattern, assumes that if there is a multi-format request, the media type defaults to $ORTBTYPE. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, we strongly recommend implementing a pattern where the adapter server sets the [MType](https://github.com/prebid/openrtb/blob/main/openrtb2/bid.go#L334) field in the response to accurately determine the media type for the impression.
     4      languages:
     5        - go
     6      severity: WARNING
     7      patterns:
     8        - pattern-inside: |
     9            if $CONDITION != nil {
    10              return $ORTBTYPE
    11            }
    12        - metavariable-pattern:
    13            metavariable: $ORTBTYPE
    14            patterns:
    15              - pattern-either:
    16                  - pattern: openrtb_ext.$BIDTYPE
    17              - metavariable-regex:
    18                  metavariable: $BIDTYPE
    19                  regex: BidType*