|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Sonar/IDE IntegrationHi,
is there any plan for any IDE integration? A long term solution could be having a plugin (e.g. eclipse plugin) connecting to sonar, fetching the results and displaying them in the IDE. A short/mid term solution could be enriching the sonar source drill down view in the browser so each violation is decorated with some meta-information. The user is then able to click on a violation, opening the exact source/line in an IDE (e.g. eclipse). This would allow an issue reported by sonar to be quickly fixed in the development environment. I haven't tried the following eclipse monkey script myself but it can be a good starting point for a quick sonar/eclipse integration proof of concept: http://monkey.brain-bakery.com/entry/show/8 Feel free to drop me an email if you want to discuss further - or maybe move it to the dev mailing list. Best regards, Filippo Macchiettini |
|
|
Re: Sonar/IDE IntegrationHi Filippo,
I'm not convinced by the short/mid term solution as we can't determined the local path of the source on the developer machine. The only thing that we know is the path of the file in a source code repository like cvs or svn. Moreover, once open in the IDE, the developer will lost all information (violations, metrics, ...) on that file/class. Even if this is a long term solution, I prefer an integration through an eclipse plugin. In fact, for me, there is already a short/mid term solution with the checkstyle [1], pmd [2] and metrics [3] plugins. Instead of writing a new eclipse plugin, what do you think about creating a Sonar MyLyn [4] extension ? Indeed, violations can be considered as tasks to be done and MyLyn seems to offer the mechanism to associate a context (file, class, method) to a task. We can then imagine to filter violations by rules, categories, etc... This idea has appeared when reading your email, so I'm not sure to have took enough time to think about it. Interested to know your opinion about this idea. cheers, Freddy [1] - http://eclipse-cs.sourceforge.net/ [2] - http://pmd.sourceforge.net/eclipse/ [3] - http://metrics.sourceforge.net/ [4] - http://www.eclipse.org/mylyn/ On Mon, Mar 16, 2009 at 12:36 AM, filippo macchiettini <filippo.macchiettini@...> wrote:
|
|
|
Re: Sonar/IDE IntegrationHi Freddy,
> I'm not convinced by the short/mid term solution as we can't determined the local path of the source on the developer machine. I'm a bit rusty with eclipse development, but I'm pretty sure that we can do smart things to get a java resource given a package name + class name within eclipse, and this should the information you have in sonar when displaying the source view (for the time being, let's ignore cases in which we have 2 java resource with the same package+class name in an eclipse workspace:) > In fact, for me, there is already a short/mid term solution with the checkstyle [1], pmd [2] and metrics [3] plugins. Yes, there are all of these plugins, but what I find very valuable in sonar is the ability to have a single point where all the violations are stored and displayed. I have some custom metrics in my build I'd like to add to sonar as extensions, e.g. layering architecture violations with aspectj - but I don't want to install ajdt on all the developers' eclipse and slow down their development - I'd prefer for those checks to be performed during the integrated build, and then using sonar to display and open them in eclipse with one click. > Instead of writing a new eclipse plugin, what do you think about creating a Sonar MyLyn [4] extension ? Very nice idea! I think this is a good starting point for further discussions. Best regards, Filippo
|
|
|
Re: Sonar/IDE IntegrationHi Filippo,
I've taken time (perhaps too much :-)) to think about your ideas and you're about to convince me about few concepts. The first one embrace the current trend around cloud computing by stopping the arms race on the developer IDE and delegating all the CPU effort to servers. No more need to install and run PMD, Checkstyle, Findbugs and even code coverage plugins on the developer IDE, just keep the IDE as light and efficient as possible. If tomorrow, we add a DSM analysis engine to Sonar, the computation time, must not impact the developer on his daily work. Then comes the second concept : the Sonar Eclipse (why not Idea or Netbean tomorrow) should behave like a light source code decorator. Greasemonkey is a well known Firefox add-on that makes on the fly changes on web pages. The Eclipse Monkey plugin seems to be something pretty equivalent in the Eclipse world. The good news is that Sonar already published most of measures through REST API (JSON and Web) to feed for instance ... Eclipse Monkey scripts. When merging the two concepts, we can imagine the development of an Eclipse Monkey script which could retrieve from Sonar : violations, duplicated blocs and code coverage associated to a source code (key : package + class name in a first time) and decorate on the fly the source code with the provides measures ... Filippo, if you want to start, we'll definitely support you on this challenge by making any necessary changes on the REST API ! Cheers, Freddy SonarSource S.A. http://www.sonarsource.com http://sonar.codehaus.org On Tue, Mar 17, 2009 at 12:52 AM, filippo macchiettini <filippo.macchiettini@...> wrote:
|
|
|
Re: Sonar/IDE IntegrationI'm not sure that the second solution is so good. First of all, there's a big constraint : sources must exactly be the same between IDE and sonar server. Then if we have a look at Intellij Idea, we see that an IDE can integrate all code analysis tools. It simply already works. The Sonar value-added for an IDE is the centralized configuration of quality profiles. That's why I'd prefer an eclipse plugin that configures and drives checkstyle/PMD/Findbugs to decorate sources in real-time.
|
|
|
Re: Sonar/IDE IntegrationSimon, the plugins you're talking about already exist and theirs names are well known. Ok, we can imagine to contribute to those plugins in order to improve their integration with Sonar by for instance dynamically loading the rules configuration files from Sonar. That's fine, but which developer will really launch checkstyle, pmd, findbugs, emma, cpd, and up coming sonarncss, ... during its daily work ? Even if tomorrow, we'll provide an all-in-one plugin, this plugin will require too much CPU and memory to be really useful. That will be great on a slide but only on the slide. I'm not saying that those plugins are useless and we must advise Sonar users to adopt them (Checkstyle plugin is for instance pretty light). But those plugins are perhaps not the good solution/answer for a large amount of developers. What filippo suggests is to provide a very light plugin which decorate the source code with all metrics available in Sonar today and even tomorrow (DSM for instance). The only but real issue is then to manage at best the possible daily desynchronization between the local sources and sources used by Sonar. Nevertheless, a first version of this plugin even without any synchronization optimizations has a good value. In long term, for those who really want to check code quality locally, we can imagine to allow them to launch a Sonar Server light (with embedded database) through a Maven command line (haven't you done that several days ago ? :-)) and then launch the quality analysis with the classical Sonar Maven goal. The eclipse plugin could then connect to this local Sonar server instead of the remote one. On Thu, Mar 26, 2009 at 11:15 AM, Simon Brandhof <simon.brandhof@...> wrote: I'm not sure that the second solution is so good. First of all, there's a big constraint : sources must exactly be the same between IDE and sonar server. Then if we have a look at Intellij Idea, we see that an IDE can integrate all code analysis tools. It simply already works. The Sonar value-added for an IDE is the centralized configuration of quality profiles. That's why I'd prefer an eclipse plugin that configures and drives checkstyle/PMD/Findbugs to decorate sources in real-time. |
|
|
Re: Sonar/IDE IntegrationHi Simon,
We use Eclipse with Checkstyle and PMD plug-in. and configure them with the rules from SONAR instance. This is easy as we follow the proactive quality development. So if developers choose they can prevent violations from creeping in or weed out on maintenance projects, before they are caught and displayed to the world on SONAR instance. And using time machine every project can boast their quality effort so to speak... Thanks Prashant Bhatt. |
| Free embeddable forum powered by Nabble | Forum Help |