Code Monkey home page Code Monkey logo

ecocode-java-test-project's People

Contributors

alograg avatar dedece35 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ecocode-java-test-project's Issues

Improve documentation or script tool_send_to_sonar.sh indicating project key to use

Hi,

when I first tried to run an analysis on the project, I've got an error : You're not authorized to run analysis. Please contact the project administrator. I thought the problem came from the token in the script tool_send_to_sonar.sh but I changed it and use the good one.

In fact, I had to add -Dsonar.projectKey=ecocode in the script since my project name on Sonar was "ecocode".

I think you should indicate in the readme or in the script the project key we have to use when configurating the project or how we can add it in the script.

Regards.

Documentation: indicate how to configure the project to test the rules

Hi,

For people that are not used to the ecoCode project, I think you should indicate somewhere how to configure the test project on Sonar to test the good set of rules. Since there is no "ecoCode" profiles in Java, maybe you should explain how to create the profile with the good rules. In my case to test, I create an ecoCode profile from scratch with all the rules tagged eco-conception.

Regards

Be more precise in comment "Non Compliant"

Hi,

I think you should add more information in comments where issues are thrown. I will set an example:

Capture d’écran 2023-03-13 à 09 10 09

The line 58 triggers a rule, not related with the rule the file is supposed to test but, well, it is here. I think you should indicate in this case that an issue should be found at that line.
On the line 62, on the same idea, I think you should indicate in the comment the rule that we expect here, to be sure it is the good one that is detected.

Regards.

First build errors

I try to build the project before any changes and I get errors. Do I have to compile it in a specific environment?

Commnad

$ ./tool_build.sh

Enviroment

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 11.0.21, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: fr_FR, platform encoding: UTF-8
OS name: "linux", version: "5.15.0-91-generic", arch: "amd64", family: "unix"

Errors

[INFO] 12 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.381 s
[INFO] Finished at: 2024-01-18T17:24:38+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project ecocode-java-plugin-test-project: Compilation failure: Compilation failure: 
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[58,22] method map in interface java.util.stream.Stream<T> cannot be applied to given types;
[ERROR]   required: java.util.function.Function<? super java.lang.Integer,? extends R>
[ERROR]   found: (id)->{ Op[...]; } }
[ERROR]   reason: cannot infer type-variable(s) R
[ERROR]     (argument mismatch; bad return type in lambda expression
[ERROR]       missing return value)
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[76,17] incompatible types: inference variable T has incompatible bounds
[ERROR]     equality constraints: fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee
[ERROR]     lower bounds: java.lang.Integer
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[84,37] constructor Employee in class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee cannot be applied to given types;
[ERROR]   required: java.lang.Integer,java.lang.String
[ERROR]   found: no arguments
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[94,37] constructor Employee in class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee cannot be applied to given types;
[ERROR]   required: java.lang.Integer,java.lang.String
[ERROR]   found: no arguments
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[95,21] cannot find symbol
[ERROR]   symbol:   variable employees
[ERROR]   location: class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[98,25] incompatible types: inference variable T has incompatible bounds
[ERROR]     equality constraints: fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee
[ERROR]     lower bounds: java.util.Optional<fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee>
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[108,37] constructor Employee in class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee cannot be applied to given types;
[ERROR]   required: java.lang.Integer,java.lang.String
[ERROR]   found: no arguments
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[109,21] cannot find symbol
[ERROR]   symbol:   variable employees
[ERROR]   location: class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[107,26] incompatible types: inference variable R has incompatible bounds
[ERROR]     lower bounds: java.lang.Object
[ERROR]     lower bounds: void
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[118,37] constructor Employee in class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee cannot be applied to given types;
[ERROR]   required: java.lang.Integer,java.lang.String
[ERROR]   found: no arguments
[ERROR]   reason: actual and formal argument lists differ in length
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[119,77] cannot find symbol
[ERROR]   symbol:   method anotherMethod()
[ERROR]   location: class fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee
[ERROR] /home/intm/work/sncf/tickets/213/ecoCode-java-test-project/src/main/java/fr/greencodeinitiative/java/checks/AvoidSpringRepositoryCallInStreamCheck.java:[121,25] incompatible types: inference variable T has incompatible bounds
[ERROR]     equality constraints: fr.greencodeinitiative.java.checks.AvoidSpringRepositoryCallInStreamCheck.Employee
[ERROR]     lower bounds: java.lang.Object
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.