Code Monkey home page Code Monkey logo

Comments (6)

dedece35 avatar dedece35 commented on May 25, 2024

check if possible to add tag ("eco-conception" for example) to an existing rule

check if possible to change severity of an existing rule

  • Sonar web site : yes possible. to do that : we have to create a new profile inherited from default "sonar way" profile and then on specific rule page, wh can change severity
  • Programmatically : TODO DDC

from ecocode.

Silicoman avatar Silicoman commented on May 25, 2024

Hi,

it's actually what i'm doing on my sonarqube server.
I create new profile "green" for each language. It can be exported as xml file. Other team using other sonarqube can import this custom profile.
BUT , if if there is new rule on sonarqube (because you have done update sonarqube), you have to update the profile.

One solution, i was thinking to do a script using API to create from scratch the profile (and update it?).
Sonarsource uses scripts ps1 to solve this kind of issue.

Modify severity is another feature with low value. Not sure have to be done.

from ecocode.

dedece35 avatar dedece35 commented on May 25, 2024

Hi @Silicoman ,
thank you for ideas.

indeed, in Sonarqube community forum (please see question link above), the SonarQube community manager gave us this answer also.
For me, this is not an optimized solution, because after plugin installation, we must execute a batch to initialize the environment. This is a possible solution but not the "top" solution for me. If the plugin do it automatically, it's better.

I agree with you regarding "severity modification" : maybe an other subject.
But, the purpose of this issue is to test possibles automatics actions that the plugin could do.
After that, we will discuss internally if we do them or not.

regards.

from ecocode.

dedece35 avatar dedece35 commented on May 25, 2024

After discussion with Sonar source developers, here are their answers :

First answer (from SonarQube community manager) :
Hey there. Are you sure a custom plugin is the right way to go, rather than using the Web API (documentation linked in the footer of your instance).

Second answer (from SonarQube developer) :
Hi, this doesn’t seem to be achievable with current Plugin API. You can do what you want with the rules your plugin define but not with the rules other plugins define. The work-around would be to call SonarQube Web API from inside your plugin, to achieve what you want, but this doesn’t seem in general as a clean, good practice.

To conclude : the best practice is to use SonarQube API after installation of ecocode plugin.
To do this, we have to develop an installation process :

  • 1/ install plugin into SonarQube
  • 2/ call SonarQube Api to add ecoconception tag to all rules that we want (an internal list ?)

Question : do you have to create a new one profile (like @Silicoman example), or change default profile ?
According to me, creating a new profile isn't the best idea because one project could be only affected to only one profile and not several profiles. Thus, we can't at the same time and for one project, check several profiles (the personal profile and our ecoconeption profile)

from ecocode.

MP-Aubay avatar MP-Aubay commented on May 25, 2024

Hi @dedece35 ,

I think we should keep it simple at first, documenting the process to add ecoconception tag, and documenting how to add this tag in a new profile. That way users can create specific profile for ecocode or modify their custom profile.

An internal list all rules is a good idea, firstly based on performance rules on Sonar, and we could test it with ETSdiff when possible to keep good rules.

I am a bit frustrating too that we cannot automate the process, but a good documentation can do the job. And all users will not have the same configuration, with the same base rules set (depending on Sonar version).

from ecocode.

dedece35 avatar dedece35 commented on May 25, 2024

@MP-Aubay

good idea, I agree with you to keep simple in the first time and describe the process in documentation with different use cases.
I will work to complete documentation.

from ecocode.

Related Issues (20)

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.