Is there any possibility to having duplicate issue keys for a file

I’m using SonarQube Community Edition version 6.7.4 and try to get details about project issues using following API call.

http://localhost:9000/api/issues/search?componentKey=project01&status=OPEN,REOPENED,CONFIRMED,CLOSED,RESOLVED

Response

{
“key”: “AW3zlXu_254vpXSpgp3L”,
“rule”: “common-java:DuplicatedBlocks”,
“severity”: “MAJOR”,
“component”: “projedct01:model:src/main/java/com/sample/testFile.java”,
“project”: “sonarqube-data-extractor”,
“subProject”: “project01:model”,
“tags”: [
“pitfall”
],

}

Is there any possibility to having duplicate issue keys for a file.

Hi Dilan and welcome on this community forum !

It’s not possible to have any duplicate issue keys, there are all unique.

Regards

1 Like

Thanks @julienlancelot for your quick response.
I found some of hash is not displaying in project issues API call. (api/issues/search)
Is there any particular reason to this.

Response

{
key: "AW3u9erW8FRa7reh8576",
rule: "common-java:DuplicatedBlocks",
severity: "MAJOR",
component: "project01:model:src/main/java/com/sample/testFile1.java",
project: "project01",
flows: [ ],
status: "OPEN",
message: "2 duplicated blocks of code must be removed.",
effort: "30min",
debt: "30min",
author: "dilan2012salinda@gmail.com",
tags: 
[
	"pitfall"
],
creationDate: "2019-10-21T14:12:22+0530",
updateDate: "2019-10-21T21:05:43+0530",
type: "CODE_SMELL",
organization: "default-organization"

}

What are the situations of hash key not displaying in issues.

Hi Dilan,

Hash is not generated for issues linked to file, and not to line.

Regards

1 Like