ITK/Code Review Check List: Difference between revisions
From KitwarePublic
< ITK
Jump to navigationJump to search
Daviddoria (talk | contribs) m (moved ITK Code Review Check List to ITK/Code Review Check List) |
|||
(17 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
'''todo''': Merge this page with the [[ITK_Release_4/Modularization/Code_Reviews/Checklist|ITKv4 Code Review Checklist]] | |||
= Code Review Check List = | = Code Review Check List = | ||
Line 4: | Line 6: | ||
* Filename must match class name | * Filename must match class name | ||
* All files must have the | * All files must have the [[ITK Copyright Header|Copyright Header]] at the top. | ||
* #define for class name in the | * #define for class name in the .h and .hxx files. __classname_h and __classname_hxx | ||
* Brief class doxygen description | * Brief class doxygen description | ||
* namespace | * namespace itk | ||
* Complete class doxygen description | * Complete class doxygen description | ||
* Constructor/Destructor private | * Classes that use SmartPointers must have | ||
** Constructor/Destructor protected | |||
** Copy Constructor : private and not implemented | |||
** Operator= : private and not implemented | |||
* No acronyms in class name or method names | * No acronyms in class name or method names | ||
* no unnecessary headers #included | * no unnecessary headers #included | ||
* Justify every public method | * Justify every public method | ||
* All member variables must be private | * All member variables must be private | ||
* Use Set/Get Macros (macros should call Modified() to ensure pipeline data is updated) | |||
* If deriving from itkObject | |||
** Use New macro | |||
** declare SmartPointer<T> as Pointer | |||
** declare SmartPointer<const T> as ConstPointer | |||
** declare Self | |||
** declare Superclass | |||
** use TypeMacro | |||
** Have PrintSelf() method and print all the member variables | |||
* 100% code coverage (see dashboard) | * 100% code coverage (see dashboard) | ||
* All 'non-const' method must justify why they are not 'const' | * All 'non-const' method must justify why they are not 'const' | ||
* Any information that is printed or displayed has to be legible to human eyes | * Any information that is printed or displayed has to be legible to human eyes | ||
* Respect Coding Style as specified in the document Insight/Documentation/Style.pdf | |||
* Must pass the test of KWStyle | |||
* [Style] In the .hxx files of template classes, the first 5 lines in the declaration of methods should be: | |||
** 1) template | |||
** 2) return type | |||
** 3) class name | |||
** 4) ::method name | |||
** 5) the opening bracket | |||
For example: | |||
template < template_arguments > | |||
return_type | |||
classname< template_arguments > | |||
::methodsName( method_arguments ) | |||
{ | |||
// indentation of two spaces | |||
// for the first line of code | |||
int k = 0; | |||
} | |||
In many cases line (2) uses a trait from the templated class and therefore becomes: | |||
typename classname< template_arguments >::trait | |||
= Running KWStyle = | |||
== In a single file == | |||
KWStyle -xml ITK.kws.xml itkQuadEdgeMeshTest1.cxx -v | |||
== In all the repository == | |||
make StyleCheck | |||
{{ITK/Template/Footer}} |
Latest revision as of 21:10, 11 February 2012
todo: Merge this page with the ITKv4 Code Review Checklist
Code Review Check List
The following is the list of coding style issues that must be verified on every class and file during a code review.
- Filename must match class name
- All files must have the Copyright Header at the top.
- #define for class name in the .h and .hxx files. __classname_h and __classname_hxx
- Brief class doxygen description
- namespace itk
- Complete class doxygen description
- Classes that use SmartPointers must have
- Constructor/Destructor protected
- Copy Constructor : private and not implemented
- Operator= : private and not implemented
- No acronyms in class name or method names
- no unnecessary headers #included
- Justify every public method
- All member variables must be private
- Use Set/Get Macros (macros should call Modified() to ensure pipeline data is updated)
- If deriving from itkObject
- Use New macro
- declare SmartPointer<T> as Pointer
- declare SmartPointer<const T> as ConstPointer
- declare Self
- declare Superclass
- use TypeMacro
- Have PrintSelf() method and print all the member variables
- 100% code coverage (see dashboard)
- All 'non-const' method must justify why they are not 'const'
- Any information that is printed or displayed has to be legible to human eyes
- Respect Coding Style as specified in the document Insight/Documentation/Style.pdf
- Must pass the test of KWStyle
- [Style] In the .hxx files of template classes, the first 5 lines in the declaration of methods should be:
- 1) template
- 2) return type
- 3) class name
- 4) ::method name
- 5) the opening bracket
For example:
template < template_arguments > return_type classname< template_arguments > ::methodsName( method_arguments ) { // indentation of two spaces // for the first line of code int k = 0; }
In many cases line (2) uses a trait from the templated class and therefore becomes:
typename classname< template_arguments >::trait
Running KWStyle
In a single file
KWStyle -xml ITK.kws.xml itkQuadEdgeMeshTest1.cxx -v
In all the repository
make StyleCheck