Wiki » History » Version 14

Marcin Poplawski, 08/31/2018 01:51 PM

1 12 Marcin Poplawski
{{toc}}
2 12 Marcin Poplawski
3 1 Marcin Poplawski
h1. vDC Wiki
4 1 Marcin Poplawski
5 3 Marcin Poplawski
h2. Definition of Done - vDC
6 1 Marcin Poplawski
7 1 Marcin Poplawski
h3. Feature and task
8 1 Marcin Poplawski
9 1 Marcin Poplawski
# MR added to comment
10 1 Marcin Poplawski
# No new defects in cppcheck and Coverity
11 1 Marcin Poplawski
# No new defects in Unit tests
12 3 Marcin Poplawski
# Unit test added (if possible)
13 6 Marcin Poplawski
# Developer test done (dev feed) - by other engineer that was implementing
14 5 Marcin Poplawski
# Spent hours are filled in
15 1 Marcin Poplawski
16 2 Marcin Poplawski
h3. Defect
17 1 Marcin Poplawski
18 1 Marcin Poplawski
# MR added to comment
19 2 Marcin Poplawski
# Comment added - cause and solution
20 1 Marcin Poplawski
# No new defects in Cppcheck and Coverity
21 1 Marcin Poplawski
# No new defects in Unit tests
22 3 Marcin Poplawski
# Unit test added (if possible)
23 6 Marcin Poplawski
# Developer test done (dev feed, different browsers) - by other engineer that was implementing
24 5 Marcin Poplawski
# Spent hours are filled in
25 3 Marcin Poplawski
26 3 Marcin Poplawski
h2. Definition of Done - vDC UI
27 3 Marcin Poplawski
28 3 Marcin Poplawski
h3. Feature and task
29 3 Marcin Poplawski
30 3 Marcin Poplawski
# MR added to comment
31 3 Marcin Poplawski
# No new defects in Linting
32 3 Marcin Poplawski
# No new defects in Unit tests
33 3 Marcin Poplawski
# Unit test added (if reasonable)
34 6 Marcin Poplawski
# Developer test done (dev feed) - by other engineer that was implementing
35 5 Marcin Poplawski
# Spent hours are filled in
36 3 Marcin Poplawski
37 3 Marcin Poplawski
h3. Defect
38 3 Marcin Poplawski
39 3 Marcin Poplawski
# MR added to comment
40 3 Marcin Poplawski
# Comment added - cause and solution
41 3 Marcin Poplawski
# No new defects in Linting
42 3 Marcin Poplawski
# No new defects in Unit tests
43 3 Marcin Poplawski
# Unit test added (if reasonable)
44 6 Marcin Poplawski
# Developer test done (dev feed, different browsers) - by other engineer that was implementing
45 5 Marcin Poplawski
# Spent hours are filled in
46 7 Marcin Poplawski
47 7 Marcin Poplawski
h2. Code review checklist
48 7 Marcin Poplawski
49 8 Krystian Heberlein
- block formatting as follows:
50 9 Krystian Heberlein
<pre>
51 8 Krystian Heberlein
if () ; // one line in the same line is allowed
52 7 Marcin Poplawski
53 7 Marcin Poplawski
if ((wa1) && (wa2)) {
54 7 Marcin Poplawski
55 1 Marcin Poplawski
} else if () {
56 7 Marcin Poplawski
57 7 Marcin Poplawski
}
58 1 Marcin Poplawski
59 8 Krystian Heberlein
for (i; i < 0; ++i) { // other loops in the same form
60 7 Marcin Poplawski
61 1 Marcin Poplawski
}
62 7 Marcin Poplawski
63 1 Marcin Poplawski
switch () {
64 8 Krystian Heberlein
  case 1: //brackets if needed, one line is acceptable
65 1 Marcin Poplawski
  case 2:
66 8 Krystian Heberlein
  default: //required
67 1 Marcin Poplawski
}
68 1 Marcin Poplawski
69 9 Krystian Heberlein
void Myclass::func(const string& aParam1, int aParam2, auto... aParams)
70 1 Marcin Poplawski
{
71 1 Marcin Poplawski
  //using aParams...
72 1 Marcin Poplawski
}
73 9 Krystian Heberlein
</pre>
74 8 Krystian Heberlein
- class declaration:
75 8 Krystian Heberlein
76 9 Krystian Heberlein
* class member initializations in class declaration if possible
77 9 Krystian Heberlein
* no 'using namespace' in header
78 9 Krystian Heberlein
* two lines separation between method definitions in source file
79 8 Krystian Heberlein
80 9 Krystian Heberlein
<pre>
81 8 Krystian Heberlein
/*
82 8 Krystian Heberlein
==========================================================================
83 7 Marcin Poplawski
84 8 Krystian Heberlein
    Class name // separator to be used in header and source file
85 8 Krystian Heberlein
==========================================================================
86 1 Marcin Poplawski
*/
87 7 Marcin Poplawski
	
88 8 Krystian Heberlein
class A // or struct {
89 7 Marcin Poplawski
90 8 Krystian Heberlein
using inherited
91 7 Marcin Poplawski
92 8 Krystian Heberlein
public:
93 8 Krystian Heberlein
  ctor // one line definition is allowed in header
94 8 Krystian Heberlein
  dtor // one line  definition is allowed in header
95 9 Krystian Heberlein
  overridden
96 8 Krystian Heberlein
  enum class EE; // declaration, but definition out of class
97 8 Krystian Heberlein
  methods //  one line  definition is allowed in header
98 7 Marcin Poplawski
99 8 Krystian Heberlein
protected:
100 8 Krystian Heberlein
  overriden
101 8 Krystian Heberlein
  methods
102 7 Marcin Poplawski
103 8 Krystian Heberlein
private:
104 8 Krystian Heberlein
  overriden
105 8 Krystian Heberlein
  methods
106 7 Marcin Poplawski
107 8 Krystian Heberlein
protected:
108 8 Krystian Heberlein
  static const
109 8 Krystian Heberlein
  class members
110 1 Marcin Poplawski
111 7 Marcin Poplawski
private:
112 1 Marcin Poplawski
  static const
113 1 Marcin Poplawski
  class members
114 1 Marcin Poplawski
115 1 Marcin Poplawski
};
116 1 Marcin Poplawski
117 8 Krystian Heberlein
enum class A::EE {
118 8 Krystian Heberlein
  A, // camel case
119 8 Krystian Heberlein
};
120 9 Krystian Heberlein
</pre>
121 8 Krystian Heberlein
122 9 Krystian Heberlein
123 9 Krystian Heberlein
124 9 Krystian Heberlein
* (static) constexpr over static const
125 9 Krystian Heberlein
* std over boost
126 9 Krystian Heberlein
* unique over shared
127 9 Krystian Heberlein
* #pragma once over ifdef
128 9 Krystian Heberlein
* reference over pointers
129 9 Krystian Heberlein
* raw string literals over special signs
130 9 Krystian Heberlein
* streams over formatted string
131 9 Krystian Heberlein
* enum class over enum
132 9 Krystian Heberlein
* interface over wrappers and (ugh!) friends (yuck!)
133 9 Krystian Heberlein
* using over typedef
134 10 Krystian Heberlein
* use vdc-utils
135 9 Krystian Heberlein
136 9 Krystian Heberlein
137 9 Krystian Heberlein
138 11 Krystian Heberlein
* static const SOME_CONST; // all caps
139 9 Krystian Heberlein
* class MyClass // starts with a capital letter + camel case
140 9 Krystian Heberlein
* method, function void myFunction() // starts with a small letter + camel case
141 9 Krystian Heberlein
* function args void myFunction(string aParam) // starts wit small 'a' + camel case
142 9 Krystian Heberlein
* namespace block without indentation
143 9 Krystian Heberlein
* ifdef without indentation
144 9 Krystian Heberlein
* comment on closing bracket for namespace or #endif
145 9 Krystian Heberlein
* multiline comment block if comment is multiline
146 9 Krystian Heberlein
* interface class with 'I' prefix // IMyInterface
147 9 Krystian Heberlein
* class member with 'm' prefix // mMyClassMember
148 9 Krystian Heberlein
* pointer with 'Ptr' suffix // mMyClassMemberPtr / myPointerInMethodPtr / aMyPointerParamPtr
149 13 Marcin Poplawski
150 13 Marcin Poplawski
h2. Usefull tools
151 13 Marcin Poplawski
152 13 Marcin Poplawski
h3. Increase log level of vdc
153 13 Marcin Poplawski
154 14 Marcin Poplawski
VDC_DSUID should be replaced by vdc dsuid. This command can be executed from local UI.
155 14 Marcin Poplawski
156 1 Marcin Poplawski
<pre>
157 14 Marcin Poplawski
dS.utils.ajaxRequest('/json/circuit/invokeMethod', { method: 'loglevel', dsuid: "VDC_DSUID", params: JSON.stringify({ value: 7 }) });
158 13 Marcin Poplawski
</pre>