-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internal module for sonar-api-models (#372)
Make a common library for Sonar API objects
- Loading branch information
Showing
41 changed files
with
249 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,4 @@ public String deleteData() { | |
public String createData() { | ||
return "Data Created!"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...odemodder-plugin-sonar/src/main/java/io/codemodder/providers/sonar/DefaultRuleIssues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugins/codemodder-plugin-sonar/src/main/java/io/codemodder/providers/sonar/RuleIssues.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
plugins/codemodder-plugin-sonar/src/main/java/io/codemodder/providers/sonar/api/Paging.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...der-plugin-sonar/src/main/java/io/codemodder/providers/sonar/api/SearchIssueResponse.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
id("io.codemodder.java-library") | ||
id("io.codemodder.maven-publish") | ||
} | ||
|
||
dependencies { | ||
api(libs.jackson.yaml) | ||
api(libs.jackson.core) | ||
} | ||
|
||
description = "Library with API models for data from Sonar tools" |
2 changes: 1 addition & 1 deletion
2
.../codemodder/providers/sonar/api/Flow.java → .../java/io/codemodder/sonar/model/Flow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
sonar-api-model/src/main/java/io/codemodder/sonar/model/Hotspot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.codemodder.sonar.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import io.codemodder.sonar.model.update.FindingSeverity; | ||
|
||
/** Represents a Sonar "hotspot". */ | ||
public final class Hotspot extends SonarFinding { | ||
|
||
@JsonProperty("securityCategory") | ||
private String securityCategory; | ||
|
||
@JsonProperty("ruleKey") | ||
private String ruleKey; | ||
|
||
@JsonProperty("vulnerabilityProbability") | ||
private FindingSeverity vulnerabilityProbability; | ||
|
||
public FindingSeverity getVulnerabilityProbability() { | ||
return vulnerabilityProbability; | ||
} | ||
|
||
public String getSecurityCategory() { | ||
return securityCategory; | ||
} | ||
|
||
public String getRuleKey() { | ||
return ruleKey; | ||
} | ||
|
||
@Override | ||
public String typeName() { | ||
return "hotspots"; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
sonar-api-model/src/main/java/io/codemodder/sonar/model/Issue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.codemodder.sonar.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** Represents a Sonar "issue". */ | ||
public final class Issue extends SonarFinding { | ||
|
||
@JsonProperty("rule") | ||
private String rule; | ||
|
||
public String getRule() { | ||
return rule; | ||
} | ||
|
||
@Override | ||
public String typeName() { | ||
return "issues"; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
sonar-api-model/src/main/java/io/codemodder/sonar/model/Paging.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package io.codemodder.sonar.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
class Paging { | ||
|
||
@JsonProperty("pageIndex") | ||
int pageIndex; | ||
|
||
@JsonProperty("pageSize") | ||
int pageSize; | ||
|
||
@JsonProperty("total") | ||
int total; | ||
} |
24 changes: 24 additions & 0 deletions
24
sonar-api-model/src/main/java/io/codemodder/sonar/model/SearchFindingResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.codemodder.sonar.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** The response when searching for a type of Sonar issue. */ | ||
public abstract class SearchFindingResponse { | ||
|
||
@JsonProperty("total") | ||
private int total; | ||
|
||
@JsonProperty("paging") | ||
private Paging paging; | ||
|
||
public int getTotal() { | ||
return total; | ||
} | ||
|
||
public Paging getPaging() { | ||
return paging; | ||
} | ||
|
||
/** Return the count of issues. */ | ||
public abstract int findingCount(); | ||
} |
Oops, something went wrong.