joern icon indicating copy to clipboard operation
joern copied to clipboard

[Bug] Kotlin2Cpg - Incorrect TypeFullName in TypeDecl's inheritsFromTypeFullName

Open khemrajrathore opened this issue 1 year ago • 0 comments

Describe the bug In kotlin2Cpg frontend the typeFullName for inheritsFromTypeFullName is set incorrectly

To Reproduce Steps to reproduce the behavior:

  1. Clone the repo - https://github.com/pagopa/pagopa-wallet-service.git
  2. importCode("pagopa-wallet-service")
  3. run the query cpg.typeDecl("WalletRepository").l
  4. inheritsFromTypeFullName = ArraySeq("ReactiveCrudRepository<Wallet, String>")

Expected behavior The expected TypeFullName is org.springframework.data.repository.reactive.ReactiveCrudRepository.ReactiveCrudRepository<Wallet, String>

Screenshots

joern> cpg.typeDecl("WalletRepository").l
val res1: List[io.shiftleft.codepropertygraph.generated.nodes.TypeDecl] = List(
  TypeDecl(
    id = 7772L,
    aliasTypeFullName = None,
    astParentFullName = "",
    astParentType = "",
    code = "WalletRepository",
    columnNumber = Some(value = 10),
    filename = "src/main/kotlin/it/pagopa/wallet/repositories/WalletRepository.kt",
    fullName = "it.pagopa.wallet.repositories.WalletRepository",
    inheritsFromTypeFullName = ArraySeq("ReactiveCrudRepository<Wallet, String>"),
    isExternal = false,
    lineNumber = Some(value = 10),
    name = "WalletRepository",
    offset = None,
    offsetEnd = None,
    order = 1
  )
)

khemrajrathore avatar Feb 20 '24 13:02 khemrajrathore