1
Sonar in Action
by Frédéric DROUET and Arnaud HERITIER
02/03/2011
2
Agenda
» How do we measure the code quality ?
» The 7 worst practices
» The Goals of Sonar
» Demonstration on YOUR code
3
3
Why do we need this kind of tool
4
How do we measure the code quality ?
In the past
5
How do we measure the code quality ?
That is not sufficient !
6
How do we measure the code quality ?
Today : we need to measure the Technical Debt …
7
How do we measure the code quality ?
… and to monitor this Technical Debt …
… to take corrective actions without being blind
8
The 7 worst practices
9
The 7 worst practices
1- Duplicated code
»  Which one do you prefer ?
10
The 7 worst practices
2- Maldistribution of the complexity
»  What is the best ?
»  1 method with a complexity of 30
»  10 methods with a complexity of 3
11
The 7 worst practices
3- Bad design
»  Which package / class
is responsible of what ?
12
The 7 worst practices
4- Potential bugs
13
The 7 worst practices
5- Little or no use of unit tests
»  Please add a new case
BUT
without any regression of course
14
The 7 worst practices
6- Non-compliance with standards
»  We have opened a dedicated Wiki Space for Development Standards for eXo
»  https://wiki-int.exoplatform.org/display/DEVSTD
15
The 7 worst practices
7- No comment or too many comments
16
The goals of Sonar
17
The goals of Sonar
» Help the developer to find the problems
» Help the managers to monitor the health of the codebase
and to follow the trends
18
Demonstration
19
Demonstration
» https://sonar.exoplatform.org

Sonar In Action 20110302-vn

  • 1.
    1 Sonar in Action byFrédéric DROUET and Arnaud HERITIER 02/03/2011
  • 2.
    2 Agenda » How do wemeasure the code quality ? » The 7 worst practices » The Goals of Sonar » Demonstration on YOUR code
  • 3.
    3 3 Why do weneed this kind of tool
  • 4.
    4 How do wemeasure the code quality ? In the past
  • 5.
    5 How do wemeasure the code quality ? That is not sufficient !
  • 6.
    6 How do wemeasure the code quality ? Today : we need to measure the Technical Debt …
  • 7.
    7 How do wemeasure the code quality ? … and to monitor this Technical Debt … … to take corrective actions without being blind
  • 8.
    8 The 7 worstpractices
  • 9.
    9 The 7 worstpractices 1- Duplicated code »  Which one do you prefer ?
  • 10.
    10 The 7 worstpractices 2- Maldistribution of the complexity »  What is the best ? »  1 method with a complexity of 30 »  10 methods with a complexity of 3
  • 11.
    11 The 7 worstpractices 3- Bad design »  Which package / class is responsible of what ?
  • 12.
    12 The 7 worstpractices 4- Potential bugs
  • 13.
    13 The 7 worstpractices 5- Little or no use of unit tests »  Please add a new case BUT without any regression of course
  • 14.
    14 The 7 worstpractices 6- Non-compliance with standards »  We have opened a dedicated Wiki Space for Development Standards for eXo »  https://wiki-int.exoplatform.org/display/DEVSTD
  • 15.
    15 The 7 worstpractices 7- No comment or too many comments
  • 16.
  • 17.
    17 The goals ofSonar » Help the developer to find the problems » Help the managers to monitor the health of the codebase and to follow the trends
  • 18.
  • 19.