[sonar-dev] Macker sonar plugin

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[sonar-dev] Macker sonar plugin

Guillaume Soldera

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Freddy Mallet SonarSource
Hi Guillaume,

In fact with Sonar 2.3 we now have all the material to implement this feature in the core without any dependency on external tool. Indeed :
  1. By extending the Sonar Squid rule engine and more precisely the BytecodeCheck [1], we can visit each edge between classes (method BytecodeVisitor.visitEdge(AsmEdge asmEdge) [2]).
  2. By using the new Sonar 2.3 feature which allows to duplicate a rule as often as needed, it's now possible to create as many architecture rule as desired. An architecture rule could have two parameters : "from classes" (optional) and "to classes" (mandatory). Each of those two parameters could be filled with a list of patterns like "java.util.Vector" or "java.sql.**, **.db.**"
I've created a JIRA ticket : http://jira.codehaus.org/browse/SONAR-1832

If you want to contribute to this development, I'd be happy to help you.

regards,
Freddy


[2] - http://svn.codehaus.org/sonar/trunk/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/check/BytecodeCheck.java
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


On Thu, Sep 30, 2010 at 4:42 PM, Guillaume Soldera <[hidden email]> wrote:

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
Hi Freddy, 

It's a great news that Sonar 2.3 have its own tools to implement this feature, it avoids the choice between external tools (i saw the topic about macker, architecture rule and classycle).


Yes, I'd be happy to contribute to this development.
I checkouted sonar source code to begin to look at classes which must be inherited and how work existing *Check and *Visitor classes. I think that I will have some questions to ask later about links between rules definition and rules execution.


Is there some deadlines for this feature ?
Have you got any idea about time to spend for this task?

Regards, 
Guillaume


2010/10/1 Freddy Mallet <[hidden email]>
Hi Guillaume,

In fact with Sonar 2.3 we now have all the material to implement this feature in the core without any dependency on external tool. Indeed :
  1. By extending the Sonar Squid rule engine and more precisely the BytecodeCheck [1], we can visit each edge between classes (method BytecodeVisitor.visitEdge(AsmEdge asmEdge) [2]).
  2. By using the new Sonar 2.3 feature which allows to duplicate a rule as often as needed, it's now possible to create as many architecture rule as desired. An architecture rule could have two parameters : "from classes" (optional) and "to classes" (mandatory). Each of those two parameters could be filled with a list of patterns like "java.util.Vector" or "java.sql.**, **.db.**"
I've created a JIRA ticket : http://jira.codehaus.org/browse/SONAR-1832

If you want to contribute to this development, I'd be happy to help you.

regards,
Freddy


[2] - http://svn.codehaus.org/sonar/trunk/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/check/BytecodeCheck.java
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------



On Thu, Sep 30, 2010 at 4:42 PM, Guillaume Soldera <[hidden email]> wrote:

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume


Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Freddy Mallet SonarSource
Hi Guillaume,

In fact the steps could be very straightforward :
  1. Copy/Paste the source code of the check CallToDeprecatedMethodCheck [1] to create a new DependencyCheck
  2. Update the Check annotation to specify the characteristics of your new rule (which will be displayed in the "Sonar Quality Profiles" page)
  3. Defines two properties "from" and "to" on your new check with the @CheckProperty annotation (see exemple [2])
  4. Implement the visitEdge(Edge edge) method and log architecture violations when necessary
  5. Update the repository of bytecode checks to declare this new check [3]
  6. Write a unit test [4]
  7. Compile and run Sonar, it should work   <- 1 or 2 days should be enough to reach this step
  8. Come back with the patch, attach it to http://jira.codehaus.org/browse/SONAR-1832 and I'll apply it to the trunk (the goal would be to integrate this feature in Sonar 2.4).
  9. I'll then migrate the Java Squid module to use the new @Rule annotation instead of the deprecated @Check annotation. With the new @Rule annotation, it will be possible in the Sonar web interface to duplicated this new dependency rule as many time as desired.
  10. End
And I do think it could be fun to implement this feature ;-),
[2]
  @CheckProperty(title = "Maximum complexity threshold", key = "maximumFunctionComplexityThreshold",
      description = "The maximum authorized complexity in function. Default value is : 4")
  private int maximumFunctionComplexityThreshold = 4;

  public void setMaximumFunctionComplexityThreshold(int threshold) {
    this.maximumFunctionComplexityThreshold = threshold;
  }


----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


2010/10/6 Guillaume Soldera <[hidden email]>
Hi Freddy, 

It's a great news that Sonar 2.3 have its own tools to implement this feature, it avoids the choice between external tools (i saw the topic about macker, architecture rule and classycle).


Yes, I'd be happy to contribute to this development.
I checkouted sonar source code to begin to look at classes which must be inherited and how work existing *Check and *Visitor classes. I think that I will have some questions to ask later about links between rules definition and rules execution.


Is there some deadlines for this feature ?
Have you got any idea about time to spend for this task?

Regards, 
Guillaume


2010/10/1 Freddy Mallet <[hidden email]>

Hi Guillaume,

In fact with Sonar 2.3 we now have all the material to implement this feature in the core without any dependency on external tool. Indeed :
  1. By extending the Sonar Squid rule engine and more precisely the BytecodeCheck [1], we can visit each edge between classes (method BytecodeVisitor.visitEdge(AsmEdge asmEdge) [2]).
  2. By using the new Sonar 2.3 feature which allows to duplicate a rule as often as needed, it's now possible to create as many architecture rule as desired. An architecture rule could have two parameters : "from classes" (optional) and "to classes" (mandatory). Each of those two parameters could be filled with a list of patterns like "java.util.Vector" or "java.sql.**, **.db.**"
I've created a JIRA ticket : http://jira.codehaus.org/browse/SONAR-1832

If you want to contribute to this development, I'd be happy to help you.

regards,
Freddy


[2] - http://svn.codehaus.org/sonar/trunk/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/check/BytecodeCheck.java
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------



On Thu, Sep 30, 2010 at 4:42 PM, Guillaume Soldera <[hidden email]> wrote:

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume



Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
Hi Freddy !

I just started to work on rule architecture engine by following steps that you gave me. I create a DependencyCheck file by a copy/paste from CallToDeprecatedMethodCheck file.
I set good informations for @Check annotation. Then I declared two fields in this class with the @CheckProperty annotation like the example that you gave me.
And I started to implement the 'visitEdge' method. I check the type of edge usage, then I get the internalName of targetAsmClass. And I test for each element of 'toClasses' CheckProperty if this element matches with the internalName of targetAsmClass. And I log a message when there is a violation.
However I have a few questions :
 1 - How a rule will be defined ? By example if the user don't want UI classes use java.sql.* classes, the rule will declare a 'from' property set to "**.*UI.java and a "to" property set to "java.sql.*" ? So, if I'm right, I must check if internalName of asmClass matches with an element of 'from' property. In case of many rules, what will 'from' and 'to' properties contain ?
 2 - How @CheckProperty are filled ? And how filled these properties in a test case ? Because right now, I fix these properties.


Thanks for your help.
Regards
Guillaume


2010/10/7 Freddy Mallet <[hidden email]>
Hi Guillaume,

In fact the steps could be very straightforward :
  1. Copy/Paste the source code of the check CallToDeprecatedMethodCheck [1] to create a new DependencyCheck
  2. Update the Check annotation to specify the characteristics of your new rule (which will be displayed in the "Sonar Quality Profiles" page)
  3. Defines two properties "from" and "to" on your new check with the @CheckProperty annotation (see exemple [2])
  4. Implement the visitEdge(Edge edge) method and log architecture violations when necessary
  5. Update the repository of bytecode checks to declare this new check [3]
  6. Write a unit test [4]
  7. Compile and run Sonar, it should work   <- 1 or 2 days should be enough to reach this step
  8. Come back with the patch, attach it to http://jira.codehaus.org/browse/SONAR-1832 and I'll apply it to the trunk (the goal would be to integrate this feature in Sonar 2.4).
  9. I'll then migrate the Java Squid module to use the new @Rule annotation instead of the deprecated @Check annotation. With the new @Rule annotation, it will be possible in the Sonar web interface to duplicated this new dependency rule as many time as desired.
  10. End
And I do think it could be fun to implement this feature ;-),
[2]
  @CheckProperty(title = "Maximum complexity threshold", key = "maximumFunctionComplexityThreshold",
      description = "The maximum authorized complexity in function. Default value is : 4")
  private int maximumFunctionComplexityThreshold = 4;

  public void setMaximumFunctionComplexityThreshold(int threshold) {
    this.maximumFunctionComplexityThreshold = threshold;
  }


----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


2010/10/6 Guillaume Soldera <[hidden email]>

Hi Freddy, 

It's a great news that Sonar 2.3 have its own tools to implement this feature, it avoids the choice between external tools (i saw the topic about macker, architecture rule and classycle).


Yes, I'd be happy to contribute to this development.
I checkouted sonar source code to begin to look at classes which must be inherited and how work existing *Check and *Visitor classes. I think that I will have some questions to ask later about links between rules definition and rules execution.


Is there some deadlines for this feature ?
Have you got any idea about time to spend for this task?

Regards, 
Guillaume


2010/10/1 Freddy Mallet <[hidden email]>

Hi Guillaume,

In fact with Sonar 2.3 we now have all the material to implement this feature in the core without any dependency on external tool. Indeed :
  1. By extending the Sonar Squid rule engine and more precisely the BytecodeCheck [1], we can visit each edge between classes (method BytecodeVisitor.visitEdge(AsmEdge asmEdge) [2]).
  2. By using the new Sonar 2.3 feature which allows to duplicate a rule as often as needed, it's now possible to create as many architecture rule as desired. An architecture rule could have two parameters : "from classes" (optional) and "to classes" (mandatory). Each of those two parameters could be filled with a list of patterns like "java.util.Vector" or "java.sql.**, **.db.**"
I've created a JIRA ticket : http://jira.codehaus.org/browse/SONAR-1832

If you want to contribute to this development, I'd be happy to help you.

regards,
Freddy


[2] - http://svn.codehaus.org/sonar/trunk/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/check/BytecodeCheck.java
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------



On Thu, Sep 30, 2010 at 4:42 PM, Guillaume Soldera <[hidden email]> wrote:

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume




Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Freddy Mallet SonarSource
Hi Guillaume, 

 1 - How a rule will be defined ? By example if the user don't want UI classes use java.sql.* classes, the rule will declare a 'from' property set to "**.*UI.java and a "to" property set to "java.sql.*" ? So, if I'm right, I must check if internalName of asmClass matches with an element of 'from' property. In case of many rules, what will 'from' and 'to' properties contain ?

In fact, the Sonar platform will take care to create one instance of the DependencyCheck class by instance of the dependency rule in the quality profile. So if you manage to make it work for one rule, it'll work for many rules (for this I'll have to migrate the old deprecated @Check annotation to the new @Rule annotation which allows to define a rule with "MULTIPLE" cardinality). 
 
 2 - How @CheckProperty are filled ? And how filled these properties in a test case ? Because right now, I fix these properties.

The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.

regards,
Freddy
 


2010/10/7 Freddy Mallet <[hidden email]>

Hi Guillaume,

In fact the steps could be very straightforward :
  1. Copy/Paste the source code of the check CallToDeprecatedMethodCheck [1] to create a new DependencyCheck
  2. Update the Check annotation to specify the characteristics of your new rule (which will be displayed in the "Sonar Quality Profiles" page)
  3. Defines two properties "from" and "to" on your new check with the @CheckProperty annotation (see exemple [2])
  4. Implement the visitEdge(Edge edge) method and log architecture violations when necessary
  5. Update the repository of bytecode checks to declare this new check [3]
  6. Write a unit test [4]
  7. Compile and run Sonar, it should work   <- 1 or 2 days should be enough to reach this step
  8. Come back with the patch, attach it to http://jira.codehaus.org/browse/SONAR-1832 and I'll apply it to the trunk (the goal would be to integrate this feature in Sonar 2.4).
  9. I'll then migrate the Java Squid module to use the new @Rule annotation instead of the deprecated @Check annotation. With the new @Rule annotation, it will be possible in the Sonar web interface to duplicated this new dependency rule as many time as desired.
  10. End
And I do think it could be fun to implement this feature ;-),
[2]
  @CheckProperty(title = "Maximum complexity threshold", key = "maximumFunctionComplexityThreshold",
      description = "The maximum authorized complexity in function. Default value is : 4")
  private int maximumFunctionComplexityThreshold = 4;

  public void setMaximumFunctionComplexityThreshold(int threshold) {
    this.maximumFunctionComplexityThreshold = threshold;
  }


----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------


2010/10/6 Guillaume Soldera <[hidden email]>

Hi Freddy, 

It's a great news that Sonar 2.3 have its own tools to implement this feature, it avoids the choice between external tools (i saw the topic about macker, architecture rule and classycle).


Yes, I'd be happy to contribute to this development.
I checkouted sonar source code to begin to look at classes which must be inherited and how work existing *Check and *Visitor classes. I think that I will have some questions to ask later about links between rules definition and rules execution.


Is there some deadlines for this feature ?
Have you got any idea about time to spend for this task?

Regards, 
Guillaume


2010/10/1 Freddy Mallet <[hidden email]>

Hi Guillaume,

In fact with Sonar 2.3 we now have all the material to implement this feature in the core without any dependency on external tool. Indeed :
  1. By extending the Sonar Squid rule engine and more precisely the BytecodeCheck [1], we can visit each edge between classes (method BytecodeVisitor.visitEdge(AsmEdge asmEdge) [2]).
  2. By using the new Sonar 2.3 feature which allows to duplicate a rule as often as needed, it's now possible to create as many architecture rule as desired. An architecture rule could have two parameters : "from classes" (optional) and "to classes" (mandatory). Each of those two parameters could be filled with a list of patterns like "java.util.Vector" or "java.sql.**, **.db.**"
I've created a JIRA ticket : http://jira.codehaus.org/browse/SONAR-1832

If you want to contribute to this development, I'd be happy to help you.

regards,
Freddy


[2] - http://svn.codehaus.org/sonar/trunk/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/check/BytecodeCheck.java
----------------------------------------
Freddy Mallet
www.SonarSource.org
www.SonarSource.com
----------------------------------------



On Thu, Sep 30, 2010 at 4:42 PM, Guillaume Soldera <[hidden email]> wrote:

Hi all, 


I take an interest in continuous integration and tools around that (like Hudson, Sonar...).
To improve quality code analysis on projects, I would like develop a sonar plugin for Macker, a tool to check architecture rules.
A JIRA has been opened (http://jira.codehaus.org/browse/SONARPLUGINS-35) but there is few activity.
I have seen that a new team has resumed work about Macker but the roadmap doesn't talk about a sonar plugin.

Did anybody start something about a "macker sonar plugin" ?
Because I'm ok to work on it, and it would be a pity that there is a double.

I wait for news !

Regards

Guillaume





Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Simon
Administrator

The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>

The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Evgeny Mandrikov
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Evgeny Mandrikov
Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.

On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
Hi !

I just tested before your message and when I launch the maven command that you give me, I see the rule in Sonar quality profile (that's cool :) ) but when I launch a 'mvn sonar:sonar' on a project, I have an embedded error :

Embedded error: The type of the field private java.util.List org.sonar.java.bytecode.check.DependencyCheck.toClasses is not supported: interface java.util.List

I suppose that I must use a type String field for 'fromClasses' and 'toClasses'.
So, I do the changes !

However, if you want what I have done, it's possible !



2010/10/19 Evgeny Mandrikov <[hidden email]>
Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.


On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
Hi !

I just tested quickly my changes and everything seems good. I create patch, I check patch is good and I attach it to jira ticket

2010/10/19 Guillaume Soldera <[hidden email]>
Hi !

I just tested before your message and when I launch the maven command that you give me, I see the rule in Sonar quality profile (that's cool :) ) but when I launch a 'mvn sonar:sonar' on a project, I have an embedded error :

Embedded error: The type of the field private java.util.List org.sonar.java.bytecode.check.DependencyCheck.toClasses is not supported: interface java.util.List

I suppose that I must use a type String field for 'fromClasses' and 'toClasses'.
So, I do the changes !

However, if you want what I have done, it's possible !



2010/10/19 Evgeny Mandrikov <[hidden email]>

Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.


On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Evgeny Mandrikov
Perfect!

On Tue, Oct 19, 2010 at 22:27, Guillaume Soldera <[hidden email]> wrote:
Hi !

I just tested quickly my changes and everything seems good. I create patch, I check patch is good and I attach it to jira ticket

2010/10/19 Guillaume Soldera <[hidden email]>

Hi !

I just tested before your message and when I launch the maven command that you give me, I see the rule in Sonar quality profile (that's cool :) ) but when I launch a 'mvn sonar:sonar' on a project, I have an embedded error :

Embedded error: The type of the field private java.util.List org.sonar.java.bytecode.check.DependencyCheck.toClasses is not supported: interface java.util.List

I suppose that I must use a type String field for 'fromClasses' and 'toClasses'.
So, I do the changes !

However, if you want what I have done, it's possible !



2010/10/19 Evgeny Mandrikov <[hidden email]>

Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.


On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Guillaume Soldera
I have attach patch to jira ticket http://jira.codehaus.org/browse/SONAR-1832
Implementation is with deprecated annotation but I would give you patch quickly ! 
If you have some remarks or suggestions (like use @Rule and @RuleProperty !), you can mail me.

Is there a way to internationalize messages ?



2010/10/19 Evgeny Mandrikov <[hidden email]>
Perfect!


On Tue, Oct 19, 2010 at 22:27, Guillaume Soldera <[hidden email]> wrote:
Hi !

I just tested quickly my changes and everything seems good. I create patch, I check patch is good and I attach it to jira ticket

2010/10/19 Guillaume Soldera <[hidden email]>

Hi !

I just tested before your message and when I launch the maven command that you give me, I see the rule in Sonar quality profile (that's cool :) ) but when I launch a 'mvn sonar:sonar' on a project, I have an embedded error :

Embedded error: The type of the field private java.util.List org.sonar.java.bytecode.check.DependencyCheck.toClasses is not supported: interface java.util.List

I suppose that I must use a type String field for 'fromClasses' and 'toClasses'.
So, I do the changes !

However, if you want what I have done, it's possible !



2010/10/19 Evgeny Mandrikov <[hidden email]>

Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.


On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] Macker sonar plugin

Fabrice Bellingard-4
Hi Guillaume,

there's no way to internationalize messages currently, so don't bother with this for the moment :-)

Best regards,
Fabrice

----------------------------------------
Fabrice BELLINGARD
www.SonarSource.org
www.SonarSource.com
----------------------------------------



On Tue, Oct 19, 2010 at 10:20 PM, Guillaume Soldera <[hidden email]> wrote:
I have attach patch to jira ticket http://jira.codehaus.org/browse/SONAR-1832
Implementation is with deprecated annotation but I would give you patch quickly ! 
If you have some remarks or suggestions (like use @Rule and @RuleProperty !), you can mail me.

Is there a way to internationalize messages ?




2010/10/19 Evgeny Mandrikov <[hidden email]>
Perfect!


On Tue, Oct 19, 2010 at 22:27, Guillaume Soldera <[hidden email]> wrote:
Hi !

I just tested quickly my changes and everything seems good. I create patch, I check patch is good and I attach it to jira ticket

2010/10/19 Guillaume Soldera <[hidden email]>

Hi !

I just tested before your message and when I launch the maven command that you give me, I see the rule in Sonar quality profile (that's cool :) ) but when I launch a 'mvn sonar:sonar' on a project, I have an embedded error :

Embedded error: The type of the field private java.util.List org.sonar.java.bytecode.check.DependencyCheck.toClasses is not supported: interface java.util.List

I suppose that I must use a type String field for 'fromClasses' and 'toClasses'.
So, I do the changes !

However, if you want what I have done, it's possible !



2010/10/19 Evgeny Mandrikov <[hidden email]>

Hi Guillaume,

Did you have succeeded in testing your patch ? In any case it would be cool to take a look on it.


On Mon, Oct 18, 2010 at 21:36, Evgeny Mandrikov <[hidden email]> wrote:
Hi,

You're faster than me ! :) Just yesterday I've tried to develop this check just for fun ;)

I suppose you patch can be applied on trunk. So when you compiled Sonar with this new check you can execute following command :
mvn --non-recursive org.codehaus.sonar:sonar-dev-maven-plugin:0.9:start -Dsonar.runtimeVersion=2.4-SNAPSHOT
This command will start standalone Sonar 2.4-SNAPSHOT with embedded database, so you can analyze any example project in order to check your patch.

But don't worry - we can migrate your patch to the new API.

You can simply attach your patch to the jira ticket : http://jira.codehaus.org/browse/SONAR-1832

On Mon, Oct 18, 2010 at 21:24, Guillaume Soldera <[hidden email]> wrote:
Hi !

I finished (I think ! :) ) my implementation and my unit tests are ok.
I formatted my code with rules described in developer guide.
However, I don't know how test this new feature in Sonar. Can you explain me hwo do that ? I compiled sonar project and I got war file. But how set the 'sonar.properties' conf file ? How build the standalone application ? Should I deployed war file in a Glassfish server ?
How do I provide you my code (patch SVN ?, pull request on a github repo ?) ?
I use deprecated annotations. However, I can change that. What are the difference between deprecated and actual annotations ?

Regards
Guillaume

2010/10/13 Simon Brandhof <[hidden email]>


The fields with annotation @CheckProperty are automatically filled by the Sonar platform according to the rule configuration done by the user through the Web quality profile service. For unit test, you have to set the values of those fields in your unit tests.


For information the annotations are @org.sonar.check.Rule and @org.sonar.check.RuleProperty (not CheckProperty)




--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_



--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_