Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixee-sonar-cloud-integration #21

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/analysis-input-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:

jobs:
pixeebot-fix:
name: Pixeebot Fix Workflow Dispatch
name: Pixeebot Fix Pull Request
runs-on: ubuntu-latest
timeout-minutes: 6

Expand Down
2 changes: 1 addition & 1 deletion pixeebot-fix-files/sonar
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"total":5,"p":1,"ps":100,"paging":{"pageIndex":1,"pageSize":100,"total":5},"effortTotal":50,"debtTotal":50,"issues":[{"key":"AY5E4GYTs_tWO_i4HuB0","rule":"java:S1192","severity":"CRITICAL","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":14,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":14,"endLine":14,"startOffset":27,"endOffset":40},"flows":[{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":14,"endLine":14,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":21,"endLine":21,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":28,"endLine":28,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":35,"endLine":35,"startOffset":27,"endOffset":40},"msg":"Duplication"}]}],"status":"OPEN","message":"Define a constant instead of duplicating this literal \"Hello world\" 4 times.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["design"],"creationDate":"2024-03-16T01:29:45+0100","updateDate":"2024-03-16T01:42:03+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"10","cleanCodeAttribute":"DISTINCT","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"HIGH"}]},{"key":"AY5E4GYTs_tWO_i4HuB1","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":14,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":14,"endLine":14,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-16T01:29:45+0100","updateDate":"2024-03-16T01:42:03+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"10","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY5E4GYTs_tWO_i4HuB2","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":21,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":21,"endLine":21,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-16T01:29:45+0100","updateDate":"2024-03-16T01:42:03+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"10","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY5E4GYTs_tWO_i4HuB3","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":28,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":28,"endLine":28,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-16T01:29:45+0100","updateDate":"2024-03-16T01:42:03+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"10","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY5E4GYTs_tWO_i4HuB4","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":35,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":35,"endLine":35,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-16T01:29:45+0100","updateDate":"2024-03-16T01:42:03+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"10","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]}],"components":[{"organization":"jesuscotlamee","key":"JesusCotlamee_test-sonar-integration-with-app","uuid":"AY5E3jOsFmlz6D5t_HQA","enabled":true,"qualifier":"TRK","name":"test-sonar-integration-with-app","longName":"test-sonar-integration-with-app","pullRequest":"10"},{"organization":"jesuscotlamee","key":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","uuid":"AY5E4GP3s_tWO_i4HuBv","enabled":true,"qualifier":"FIL","name":"CodeWithErrors.java","longName":"src/main/java/pixee/CodeWithErrors.java","path":"src/main/java/pixee/CodeWithErrors.java","pullRequest":"10"}],"organizations":[{"key":"jesuscotlamee","name":"Jesus Cotlame"}],"facets":[]}
{"total":5,"p":1,"ps":100,"paging":{"pageIndex":1,"pageSize":100,"total":5},"effortTotal":50,"debtTotal":50,"issues":[{"key":"AY59PUtorh5MAQncQ5Zt","rule":"java:S1192","severity":"CRITICAL","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":14,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":14,"endLine":14,"startOffset":27,"endOffset":40},"flows":[{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":14,"endLine":14,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":21,"endLine":21,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":28,"endLine":28,"startOffset":27,"endOffset":40},"msg":"Duplication"}]},{"locations":[{"component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","textRange":{"startLine":35,"endLine":35,"startOffset":27,"endOffset":40},"msg":"Duplication"}]}],"status":"OPEN","message":"Define a constant instead of duplicating this literal \"Hello world\" 4 times.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["design"],"creationDate":"2024-03-27T01:07:41+0100","updateDate":"2024-03-27T01:09:01+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"21","cleanCodeAttribute":"DISTINCT","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"HIGH"}]},{"key":"AY59PUtorh5MAQncQ5Zu","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":14,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":14,"endLine":14,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-27T01:07:41+0100","updateDate":"2024-03-27T01:09:01+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"21","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY59PUtorh5MAQncQ5Zv","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":21,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":21,"endLine":21,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-27T01:07:41+0100","updateDate":"2024-03-27T01:09:01+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"21","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY59PUtorh5MAQncQ5Zw","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":28,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":28,"endLine":28,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-27T01:07:41+0100","updateDate":"2024-03-27T01:09:01+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"21","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]},{"key":"AY59PUtorh5MAQncQ5Zx","rule":"java:S106","severity":"MAJOR","component":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","project":"JesusCotlamee_test-sonar-integration-with-app","line":35,"hash":"ee85ab3172684733c23db0097a603ee0","textRange":{"startLine":35,"endLine":35,"startOffset":8,"endOffset":18},"flows":[],"status":"OPEN","message":"Replace this use of System.out by a logger.","effort":"10min","debt":"10min","assignee":"JesusCotlamee@github","tags":["bad-practice","cert"],"creationDate":"2024-03-27T01:07:41+0100","updateDate":"2024-03-27T01:09:01+0100","type":"CODE_SMELL","organization":"jesuscotlamee","pullRequest":"21","cleanCodeAttribute":"MODULAR","cleanCodeAttributeCategory":"ADAPTABLE","impacts":[{"softwareQuality":"MAINTAINABILITY","severity":"MEDIUM"}]}],"components":[{"organization":"jesuscotlamee","key":"JesusCotlamee_test-sonar-integration-with-app:src/main/java/pixee/CodeWithErrors.java","uuid":"AY59PUj9rh5MAQncQ5Zo","enabled":true,"qualifier":"FIL","name":"CodeWithErrors.java","longName":"src/main/java/pixee/CodeWithErrors.java","path":"src/main/java/pixee/CodeWithErrors.java","pullRequest":"21"},{"organization":"jesuscotlamee","key":"JesusCotlamee_test-sonar-integration-with-app","uuid":"AY59PRoOLOdq6J14ZpyS","enabled":true,"qualifier":"TRK","name":"test-sonar-integration-with-app","longName":"test-sonar-integration-with-app","pullRequest":"21"}],"organizations":[{"key":"jesuscotlamee","name":"Jesus Cotlame"}],"facets":[]}
10 changes: 4 additions & 6 deletions src/main/java/pixee/CodeWithErrors.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

public class CodeWithErrors {

private static final String HELLO_WORLD = "Hello world";

// Error: Unused variable
private int unusedVariable;

Expand All @@ -13,28 +11,28 @@ public class CodeWithErrors {
// Method getVariable should have a return type int
// Error: It should be public int getVariable()
public void getVariable() {
System.out.println(HELLO_WORLD);
System.out.println("Hello world");
return variable;
}

// Method setVariable should not have a return type
// Error: It should be public void setVariable(int variable)
public int setVariable(int variable) {
System.out.println(HELLO_WORLD);
System.out.println("Hello world");
this.variable = variable;
}

// Method sum should not have a return type
// Error: It should be public int sum(int a, int b)
public void sum(int a, int b) {
System.out.println(HELLO_WORLD);
System.out.println("Hello world");
return a + b;
}

// Method one should not be private
// Error: It should be public int one()
private int one(){
System.out.println(HELLO_WORLD);
System.out.println("Hello world");
return 1;
}

Expand Down
6 changes: 0 additions & 6 deletions src/main/java/pixee/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ public static void main(String[] args) {
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
System.out.println("Hello world");
}

public void log(){
Expand Down