Coding standards

548 views
Skip to first unread message

owing...@gmail.com

unread,
Aug 22, 2016, 7:58:27 AM8/22/16
to SonarQube
Hi,

Sonarqube provides a nice way of static code testing after coding had been done (or even during, using sonarlint). However, I also want to inform developers on what is expecting of them in the first place so they can do it first-time right.
Is there documentation on the codingstandards that SonarQube uses for the base of its rulesets validation in a well-readible format? I know I can print a ruleset, but that is not very readible.

Thanx!


G. Ann Campbell

unread,
Aug 22, 2016, 9:40:07 AM8/22/16
to SonarQube, owing...@gmail.com
Hi,

Are you asking whether the default profiles are based on set coding standards? If so, the answer is "no". They're based on what's considered "normal" for each language (naming standards are included here) and on our judgement and experience.

This list of rules available in the Java plugin indicates which ones are on by default in the Sonar way profile. Perhaps that would help?


Ann

Owin GMail

unread,
Aug 22, 2016, 10:56:06 AM8/22/16
to G. Ann Campbell, SonarQube

Hi Ann,

 

Thanx for your answer.

What I am interested in is how you determine what is “normal” and your experience. And how I can get that across my developers, other than trial and error via analysis.

In other words, is there a reference at least to what you consider “normal” and perferrable even what you consider a standard through judgement and experience?

 

And is this reference readable, so not a list of rules. More something like this:

https://msdn.microsoft.com/en-us/library/ff926074.aspx

https://csharpguidelines.codeplex.com/downloads/get/540283

 

Thanx

G. Ann Campbell

unread,
Aug 22, 2016, 11:21:13 AM8/22/16
to SonarQube, ann.ca...@sonarsource.com, owing...@gmail.com
Hi Owin,

We don't have anything like that. My first reaction is that the rule set is the documentation. And then I immediately remember how arrogant/wrong that is when you substitute "code" for "rule set".  So I've put it in my mental backlog to think about this.

In the meantime, I can tell you that our prime directive when adding rules to the default rule set is that they should be absolutely uncontroversial. That is, if the we think the majority of the language's developers would react with "Oh! Yeah, that needs fixing." then the rule goes in. If not, it's out.


Ann

Owin GMail

unread,
Sep 19, 2016, 5:17:48 AM9/19/16
to G. Ann Campbell, SonarQube

Hi Ann,

 

Did you already have some though about is?

Our clients also want to know what our coding standards are and just saying “the sonar way” or sending the ruleset is not really the way to go.

 

Hope to hear from you! Thanx

 

Owin

 

 

 

 

 

From: G. Ann Campbell [mailto:ann.ca...@sonarsource.com]
Sent: maandag 22 augustus 2016 17:21
To: SonarQube <sona...@googlegroups.com>
Cc: ann.ca...@sonarsource.com; owing...@gmail.com
Subject: Re: Coding standards

 

Hi Owin,

G. Ann Campbell

unread,
Sep 20, 2016, 9:38:21 AM9/20/16
to Owin GMail, SonarQube
Hi Owin,

Sorry, I have not.


Ann



---
G. Ann CAMPBELL | SonarSource
Product Owner

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/-oB9IS-SMLU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/008b01d21256%24ad01f600%240705e200%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Freddy Mallet

unread,
Sep 20, 2016, 10:10:17 AM9/20/16
to G. Ann Campbell, Owin GMail, SonarQube
In fact Owin, I think there is a misunderstanding somewhere because I don't see any difference between the links you provided and the following link (also available in your own internal SonarQube instance) listing for instance all the rules part of the Java Sonar way quality profiles : https://sonarqube.com/coding_rules#qprofile=java-sonar-way-45126|activation=true

In both case:
  • This is a list of coding conventions/rules
  • For each rule there is a description explaining the purpose of the rule
  • For each rule there is a noncompliant and compliant code example
  • ...
In fact you're "just" asking for an export of this information in a PDF file ?
Thanks
Freddy

To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/CAEi9rULZEfjPzzWjy7OvDzGWzp3Dy8rT%2BKyVzqsk7-qucY%3DReg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.
--
Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com

Owin Gruters

unread,
Sep 27, 2016, 9:45:26 AM9/27/16
to Freddy Mallet, G. Ann Campbell, SonarQube
Hi Freddy,

Thanx for your reply. And sorry for taking so long to reply.
The difference I see between the 2 examples I sent and the list I get from SonarQube is the formatting and readibility. Both examples have an introduction, some general information and categorisation of the rukes, where the Sonar Way is one big unstructured list. Yes, it has the information, but not in a convenient way. So for me the readibility of the 2 examples is much better. Something I can go to customers with and give to (new) developers in the company.
I thought this was also what triggered Ann to think about this...

regards,
Owin



To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages