Skip to content

Commit 1808ba0

Browse files
authored
Merge pull request #193 from rosette-api/no-jira-suppress-logger-exception-code-smells-in-examples
NO-JIRA: Suppress log-or-rethrow, exception sub-type and use-logger …
2 parents 8884415 + 6755dee commit 1808ba0

27 files changed

+171
-3
lines changed

CI.Jenkinsfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ node ("docker-light") {
99
}
1010
stage("Maven Build") {
1111
withSonarQubeEnv {
12+
mySonarOpts="-Dsonar.login=${env.SONAR_AUTH_TOKEN} -Dsonar.host.url=${env.SONAR_HOST_URL}"
13+
if ("${env.CHANGE_BRANCH}") {
14+
mySonarOpts="$mySonarOpts -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.base=${env.CHANGE_TARGET} -Dsonar.pullrequest.branch=${env.CHANGE_BRANCH}"
15+
}
16+
echo("Sonar Options are: $mySonarOpts")
1217
sh "docker run --rm \
1318
--pull always \
1419
--volume ${sourceDir}:/source \
@@ -17,9 +22,7 @@ node ("docker-light") {
1722
bash -c \"apt-get update && \
1823
apt-get install -y git && \
1924
pushd /source && \
20-
/opt/maven-basis/bin/mvn --batch-mode clean install sonar:sonar \
21-
-Dsonar.login=${env.SONAR_AUTH_TOKEN} \
22-
-Dsonar.host.url=${env.SONAR_HOST_URL}\""
25+
/opt/maven-basis/bin/mvn --batch-mode clean install sonar:sonar $mySonarOpts\""
2326
}
2427
}
2528
slack(true)

examples/src/main/java/com/basistech/rosette/examples/AddressSimilarityExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
/**
3030
* Example which demonstrates address similarity
3131
*/
32+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3233
public final class AddressSimilarityExample extends ExampleBase {
3334
public static void main(String[] args) {
3435
try {

examples/src/main/java/com/basistech/rosette/examples/CategoriesExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* Gets QAG categories (http://www.iab.net/QAGInitiative/overview/taxonomy) of a web page document
3131
* located at http://www.basistech.com/about
3232
*/
33+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3334
public final class CategoriesExample extends ExampleBase {
3435
public static void main(String[] args) {
3536
try {

examples/src/main/java/com/basistech/rosette/examples/EntitiesExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
/**
2828
* Example which demonstrates the entity extraction api.
2929
*/
30+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3031
public final class EntitiesExample extends ExampleBase {
3132
public static void main(String[] args) {
3233
try {

examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/**
2626
* Provides examples on how to use the {@link com.basistech.rosette.api.HttpRosetteAPI HttpRosetteAPI}
2727
*/
28+
@SuppressWarnings("java:S106")
2829
public abstract class ExampleBase {
2930
private static final String KEY_PROP_NAME = "rosette.api.key";
3031
private static final String URL_PROP_NAME = "rosette.api.altUrl";

examples/src/main/java/com/basistech/rosette/examples/InfoExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* Example which demonstrates the top level info api.
2525
*/
26+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
2627
public final class InfoExample extends ExampleBase {
2728
public static void main(String[] args) {
2829
try {

examples/src/main/java/com/basistech/rosette/examples/LanguageExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
/**
2828
* Example which demonstrates the language detection api.
2929
*/
30+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3031
public final class LanguageExample extends ExampleBase {
3132
public static void main(String[] args) {
3233
try {

examples/src/main/java/com/basistech/rosette/examples/LanguageMultilingualExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
/**
2828
* Example which demonstrates the language detection api with the multilingual option.
2929
*/
30+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3031
public final class LanguageMultilingualExample extends ExampleBase {
3132
public static void main(String[] args) {
3233
try {

examples/src/main/java/com/basistech/rosette/examples/MorphologyCompleteExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
/**
2929
* Example which demonstrates the complete morphology api.
3030
*/
31+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3132
public final class MorphologyCompleteExample extends ExampleBase {
3233
public static void main(String[] args) {
3334
try {

examples/src/main/java/com/basistech/rosette/examples/MorphologyCompoundComponentsExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
/**
3030
* Example which demonstrates the decompounding api.
3131
*/
32+
@SuppressWarnings({"java:S1166", "java:S2221", "java:S106"})
3233
public final class MorphologyCompoundComponentsExample extends ExampleBase {
3334
public static void main(String[] args) {
3435
try {

0 commit comments

Comments
 (0)