|
1 # |
|
2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 # All rights reserved. |
|
4 # |
|
5 # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: |
|
6 # |
|
7 # * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. |
|
8 # * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. |
|
9 # * Neither the name of Nokia Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. |
|
10 # |
|
11 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
|
12 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
|
13 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
14 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
15 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
16 # |
|
17 |
|
18 # English.loc |
|
19 # localised string for Script accessArrayElementWithoutCheck |
|
20 |
|
21 stringPool[ "accessArrayElementWithoutCheck!title" ] = "Array element accessed by At() function without checking index is within array range" |
|
22 stringPool[ "accessArrayElementWithoutCheck!description" ] = "Whenever an element in an array is accessed, the index should be checked to ensure that it is less than array.Count(). CodeScanner checks for explicit calls to a Count() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic." |
|
23 stringPool[ "accessArrayElementWithoutCheck!ideTitle" ] = "array element accessed by At() function without checking index is within array range" |
|
24 |
|
25 # localised string for Script accessArrayElementWithoutCheck2 |
|
26 stringPool[ "accessArrayElementWithoutCheck2!title" ] = "Array element accessed by [] without checking range" |
|
27 stringPool[ "accessArrayElementWithoutCheck2!description" ] = "Whenever an element in an array is accessed, the index should first be checked to ensure that it is within range. CodeScanner checks for explicit calls to a Count() or Length() function; so if the array index is checked in a different way, it gives false positives. Accessing an invalid index can cause a panic." |
|
28 stringPool[ "accessArrayElementWithoutCheck2!ideTitle" ] = "array element accessed by [] without checking range" |
|
29 |
|
30 # localised string for Script activestart |
|
31 stringPool[ "activestart!title" ] = "Using CActiveScheduler::Start" |
|
32 stringPool[ "activestart!description" ] = "Using CActiveScheduler::Start() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way." |
|
33 stringPool[ "activestart!ideTitle" ] = "using CActiveScheduler::Start" |
|
34 |
|
35 # localised string for Script activestop |
|
36 stringPool[ "activestop!title" ] = "Using CActiveScheduler::Stop" |
|
37 stringPool[ "activestop!description" ] = "Using CActiveScheduler::Stop() can mean that something asynchronous is being made synchronous. Instead, use active objects correctly in an asynchronous way." |
|
38 stringPool[ "activestop!ideTitle" ] = "using CActiveScheduler::Stop" |
|
39 |
|
40 # localised string for Script arraypassing |
|
41 stringPool[ "arraypassing!title" ] = "Passing arrays by value rather than reference" |
|
42 stringPool[ "arraypassing!description" ] = "Passing arrays by value causes the array to be copied needlessly, which takes up time and memory. For efficiency, references should be used." |
|
43 stringPool[ "arraypassing!ideTitle" ] = "passing arrays by value rather than reference" |
|
44 |
|
45 # localised string for Script arrayptrcleanup |
|
46 stringPool[ "arrayptrcleanup!title" ] = "Using local CArrayPtr classes without cleanup items" |
|
47 stringPool[ "arrayptrcleanup!description" ] = "It is not enough to push a local CArrayPtr class onto the cleanup stack. A TCleanupItem and callback function must be used to avoid leaking the elements." |
|
48 stringPool[ "arrayptrcleanup!ideTitle" ] = "using local CArrayPtr classes without cleanup items" |
|
49 |
|
50 # localised string for Script assertdebuginvariant |
|
51 stringPool[ "assertdebuginvariant!title" ] = "__ASSERT_DEBUG with User::Invariant" |
|
52 stringPool[ "assertdebuginvariant!description" ] = "Replace __ASSERT_DEBUG(<condition>, User::Invariant()) with ASSERT(<condition>), because it is easier to read." |
|
53 stringPool[ "assertdebuginvariant!ideTitle" ] = "__ASSERT_DEBUG with User::Invariant" |
|
54 |
|
55 # localised string for Script baddefines |
|
56 stringPool[ "baddefines!title" ] = "Lowercase definition names" |
|
57 stringPool[ "baddefines!description" ] = "Badly-named definitions makes the code harder to maintain and can lead to defects." |
|
58 stringPool[ "baddefines!ideTitle" ] = "lowercase definition names" |
|
59 |
|
60 # localised string for Script baseconstruct |
|
61 stringPool[ "baseconstruct!title" ] = "Leaving function called before BaseConstructL()" |
|
62 stringPool[ "baseconstruct!description" ] = "If a leave occurs before BaseConstructL() is called, the system can panic because it is trying to clean up an application that has not been fully initialised." |
|
63 stringPool[ "baseconstruct!ideTitle" ] = "leaving method called before BaseConstructL" |
|
64 |
|
65 # localised string for Script callActiveObjectWithoutCheckingOrStopping |
|
66 stringPool[ "callActiveObjectWithoutCheckingOrStopping!title" ] = "Active object called without checking whether it is active or canceling it first" |
|
67 stringPool[ "callActiveObjectWithoutCheckingOrStopping!description" ] = "If an active object is started twice, a panic occurs. CodeScanner picks out places where there is a call to a Start(), Queue(), or After() function on a member variable, without a previous call to IsActive(), Cancel(), or Stop(). In general, if starting a timer, there should at least be a call to IsActive() to ensure that the timer is not already running." |
|
68 stringPool[ "callActiveObjectWithoutCheckingOrStopping!ideTitle" ] = "active object called without checking whether it is active or canceling it first" |
|
69 |
|
70 # localised string for Script changenotification |
|
71 stringPool[ "changenotification!title" ] = "Using RSAVarChangeNotify to see System Agent changes" |
|
72 stringPool[ "changenotification!description" ] = "When watching for System Agent changes, use RSystemAgent rather than RSAVarChangeNotify, which can fail." |
|
73 stringPool[ "changenotification!ideTitle" ] = "using RSAVarChangeNotify to see System Agent changes" |
|
74 |
|
75 # localised string for Script cleanup |
|
76 stringPool[ "cleanup!title" ] = "CleanupStack::Pop(AndDestroy) parameters" |
|
77 stringPool[ "cleanup!description" ] = "These functions should be called with explicit variable parameters to avoid misalignment." |
|
78 stringPool[ "cleanup!ideTitle" ] = "missing CleanupStack::Pop parameter" |
|
79 |
|
80 # localised string for Script commentcode |
|
81 stringPool[ "commentcode!title" ] = "Commented-out code" |
|
82 stringPool[ "commentcode!description" ] = "Instances of code that are commented out make the code hard to maintain and to interpret clearly. The commented out code should be removed. Any requirement to rediscover old code should be made through source control and not by trawling through commented-out code." |
|
83 stringPool[ "commentcode!ideTitle" ] = "commented-out code" |
|
84 |
|
85 # localised string for Script connect |
|
86 stringPool[ "connect!title" ] = "Ignoring Connect() return value" |
|
87 stringPool[ "connect!description" ] = "Ignoring the error returned from Connect() functions means that if the Connect() function fails due to OOM or other problems, the next access to the resource will panic." |
|
88 stringPool[ "connect!ideTitle" ] = "ignoring Connect() return value" |
|
89 |
|
90 # localised string for Script ConnectAndDontCloseMemberVariable |
|
91 stringPool[ "ConnectAndDontCloseMemberVariable!title" ] = "Calling Connect() or Open() on a member variable without calling Close() in the destructor" |
|
92 stringPool[ "ConnectAndDontCloseMemberVariable!description" ] = "If Connect() or Open() is called on any member variable, then Close() must be called in the destructor." |
|
93 stringPool[ "ConnectAndDontCloseMemberVariable!ideTitle" ] = "calling Connect() or Open() on a member variable without calling Close() in the destructor" |
|
94 |
|
95 # localised string for Script constnames |
|
96 stringPool[ "constnames!title" ] = "Badly-named constants" |
|
97 stringPool[ "constnames!description" ] = "Badly-named constant will make the source code harder to maintain and make defects more likely." |
|
98 stringPool[ "constnames!ideTitle" ] = "badly-named constant" |
|
99 |
|
100 # localised string for Script consttdescptr |
|
101 stringPool[ "consttdescptr!title" ] = "Const descriptor pointer as argument" |
|
102 stringPool[ "consttdescptr!description" ] = "Use \"const TDesC&\" instead of \"const TDesC*\"." |
|
103 stringPool[ "consttdescptr!ideTitle" ] = "const descriptor pointer as argument" |
|
104 |
|
105 # localised string for Script controlornull |
|
106 stringPool[ "controlornull!title" ] = "Accessing return value of ControlOrNull()" |
|
107 stringPool[ "controlornull!description" ] = "The return value might be NULL, so it should be checked before access." |
|
108 stringPool[ "controlornull!ideTitle" ] = "accessing return value of ControlOrNull()" |
|
109 |
|
110 # localised string for Script crepository |
|
111 stringPool[ "crepository!title" ] = "Ignoring CRepository::get() return value" |
|
112 stringPool[ "crepository!description" ] = "Independent application cannot assume that the Central Repository is set up fully. This means the return value of CRepository::get() cannot be ignored." |
|
113 stringPool[ "crepository!ideTitle" ] = "ignoring CRepository::get() return value" |
|
114 |
|
115 # localised string for Script ctltargettype |
|
116 stringPool[ "ctltargettype!title" ] = "Use of targettype ctl" |
|
117 stringPool[ "ctltargettype!description" ] = "The ctl target type should not be used. Instead, use DLL and explicitly refer to the Control Panel's DEF file. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code that has extra exports for resetting the Control Panel item's data." |
|
118 stringPool[ "ctltargettype!ideTitle" ] = "use of targettype ctl" |
|
119 |
|
120 # localised string for Script customizableicons |
|
121 stringPool[ "customizableicons!title" ] = "Use of customizable icons" |
|
122 stringPool[ "customizableicons!description" ] = "Due to device customization requirements, independent application must not remove any customization done by the variant team. This means independent application cannot include customizable icons." |
|
123 stringPool[ "customizableicons!ideTitle" ] = "use of customizable icons" |
|
124 |
|
125 # localised string for Script debugrom |
|
126 stringPool[ "debugrom!title" ] = "Debug components in ROM" |
|
127 stringPool[ "debugrom!description" ] = "Debug versions of components in the ROM could mean that ROM space is being taken up with debugging information or that logging is being put out. Release versions should be in the ROM unless there is a good reason why they are not." |
|
128 stringPool[ "debugrom!ideTitle" ] = "debug components in ROM" |
|
129 |
|
130 # localised string for Script declarename |
|
131 stringPool[ "declarename!title" ] = "Use of __DECLARE_NAME" |
|
132 stringPool[ "declarename!description" ] = "The __DECLARE_NAME macro is historical and serves no purpose anymore and should be removed." |
|
133 stringPool[ "declarename!ideTitle" ] = "use of __DECLARE_NAME" |
|
134 |
|
135 # localised string for Script deleteMemberVariable |
|
136 stringPool[ "deleteMemberVariable!title" ] = "Member variable deleted incorrectly" |
|
137 stringPool[ "deleteMemberVariable!description" ] = "When a member variable is deleted, it should be assigned either to NULL or to another value. This prevents accidental access of the deleted object. If a NewL() or other leaving function is called to reassign the member variable, it should first be assigned to NULL in case that function leaves." |
|
138 stringPool[ "deleteMemberVariable!ideTitle" ] = "member variable deleted incorrectly" |
|
139 |
|
140 # localised string for Script destructor |
|
141 stringPool[ "destructor!title" ] = "Pointer access in destructors" |
|
142 stringPool[ "destructor!description" ] = "Accessing pointers to objects in destructors without checking whether they are not NULL could result in a panic because they may not have been constructed. The pointers should be checked to determine whether they are owned objects. If they are not owned, they should really be references rather than pointers." |
|
143 stringPool[ "destructor!ideTitle" ] = "destructor is accessing/dereferencing data member" |
|
144 |
|
145 # localised string for Script doubleSemiColon |
|
146 stringPool[ "doubleSemiColon!title" ] = "Use of double semicolon" |
|
147 stringPool[ "doubleSemiColon!description" ] = "Double semicolons at the end of a line are not necessary and cause a CodeWarrior compiler error." |
|
148 stringPool[ "doubleSemiColon!ideTitle" ] = "use of double semicolon" |
|
149 |
|
150 # localised string for Script driveletters |
|
151 stringPool[ "driveletters!title" ] = "Hard-coded drive letters" |
|
152 stringPool[ "driveletters!description" ] = "Drive letters should not be hard-coded." |
|
153 stringPool[ "driveletters!ideTitle" ] = "hard-coded drive letters" |
|
154 |
|
155 # localised string for Script eikbuttons |
|
156 stringPool[ "eikbuttons!title" ] = "Checks that the R_EIK_BUTTONS_* resources are not being used" |
|
157 stringPool[ "eikbuttons!description" ] = "R_EIK_BUTTONS_* resources will not be internationalised, and should not be used. Instead, create your own button resource. No button resource (or indeed, rls string) should be used in more than one location. Note: This issue is only relevant for development on Nokia platforms." |
|
158 stringPool[ "eikbuttons!ideTitle" ] = "use of R_EIK_BUTTONS_ resources" |
|
159 |
|
160 # localised string for Script eikonenvstatic |
|
161 stringPool[ "eikonenvstatic!title" ] = "Using CEikonEnv::Static" |
|
162 stringPool[ "eikonenvstatic!description" ] = "CEikonEnv::Static() calls should be kept to a minimum, because this involves TLS. All applications, controls, and dialogs already have a pointer to the singleton instance of CEikonEnv as a member variable and so do not need to find it again. If a class does not have access to a CEikonEnv and needs to use it repeatedly, then it should store one." |
|
163 stringPool[ "eikonenvstatic!ideTitle" ] = "using CEikonEnv::Static" |
|
164 |
|
165 # localised string for Script enummembers |
|
166 stringPool[ "enummembers!title" ] = "Enums with badly-named members" |
|
167 stringPool[ "enummembers!description" ] = "Enums with badly-named members make the code harder to maintain and may cause defects." |
|
168 stringPool[ "enummembers!ideTitle" ] = "enum with badly-named member" |
|
169 |
|
170 # localised string for Script enumnames |
|
171 stringPool[ "enumnames!title" ] = "Badly-named enums" |
|
172 stringPool[ "enumnames!description" ] = "Badly-named enums make the code harder to maintain and may cause defects." |
|
173 stringPool[ "enumnames!ideTitle" ] = "badly-named enum" |
|
174 |
|
175 # localised string for Script exportinline |
|
176 stringPool[ "exportinline!title" ] = "Exporting inline functions" |
|
177 stringPool[ "exportinline!description" ] = "Inline functions should not be exported because this can cause those that link to the DLL to fail to build. Exporting functions limits the changes that can be made in the future due to considerations of binary-compatibility." |
|
178 stringPool[ "exportinline!ideTitle" ] = "exporting inline functions" |
|
179 |
|
180 # localised string for Script exportpurevirtual |
|
181 stringPool[ "exportpurevirtual!title" ] = "Exporting pure virtual functions" |
|
182 stringPool[ "exportpurevirtual!description" ] = "Symbian recommends against the exportation of pure virtual functions." |
|
183 stringPool[ "exportpurevirtual!ideTitle" ] = "exporting pure virtual functions" |
|
184 |
|
185 # localised string for Script externaldriveletters |
|
186 # stringPool[ "externaldriveletters!title" ] = "Hard-coded external drive letters" |
|
187 # stringPool[ "externaldriveletters!description" ] = "External drive letters should not be hard-coded as the external drive may change between platforms and releases. This may cause confusion over ownership leading to classes being deleted erroneously and leaks occurring." |
|
188 # stringPool[ "externaldriveletters!ideTitle" ] = "hard-coded external drive letter" |
|
189 |
|
190 # localised string for Script flags |
|
191 stringPool[ "flags!title" ] = "Use of R&D flags or feature flags" |
|
192 stringPool[ "flags!description" ] = "Independent application must not use R&D flags nor feature flags via preprocessor statements in the source code. This means bld*.hrh and productvariant.hrh should not be used." |
|
193 stringPool[ "flags!ideTitle" ] = "use of R&D flags or feature flags" |
|
194 |
|
195 # localised string for Script foff |
|
196 stringPool[ "foff!title" ] = "Use of _FOFF" |
|
197 stringPool[ "foff!description" ] = "_FOFF allows access to data in classes that were not intended for public access. This may cause problems, especially when the location of the data changes." |
|
198 stringPool[ "foff!ideTitle" ] = "use of _FOFF" |
|
199 |
|
200 # localised string for Script forbiddenwords |
|
201 stringPool[ "forbiddenwords!title" ] = "Use of forbidden words in header files" |
|
202 stringPool[ "forbiddenwords!description" ] = "Some words should not be used in header files; especially those header files destined for external release. Some words may be forbidden for legal reasons or for platform consistency. Where they exist, alternative allowed words should be used. For example, \"NMP\" and \"Nokia Mobile Phones\" should be replaced by \"Nokia\"." |
|
203 stringPool[ "forbiddenwords!ideTitle" ] = "use of forbidden words in header files" |
|
204 |
|
205 # localised string for Script forgottoputptroncleanupstack |
|
206 stringPool[ "forgottoputptroncleanupstack!title" ] = "Neglected to put variable on cleanup stack" |
|
207 stringPool[ "forgottoputptroncleanupstack!description" ] = "If a variable is not put on the cleanup stack and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated." |
|
208 stringPool[ "forgottoputptroncleanupstack!ideTitle" ] = "neglected to put variable on cleanup stack" |
|
209 |
|
210 # localised string for Script friend |
|
211 stringPool[ "friend!title" ] = "Use of friends" |
|
212 stringPool[ "friend!description" ] = "The friend directive is often misused and can indicate problems in the OO design." |
|
213 stringPool[ "friend!ideTitle" ] = "use of friends" |
|
214 |
|
215 # localised string for Script goto |
|
216 stringPool[ "goto!title" ] = "Use of goto" |
|
217 stringPool[ "goto!description" ] = "Goto should not be used if it can be avoided because it makes the program flow more difficult to follow." |
|
218 stringPool[ "goto!ideTitle" ] = "use of goto" |
|
219 |
|
220 # localised string for Script ifassignments |
|
221 stringPool[ "ifassignments!title" ] = "Assignment in an If statement" |
|
222 stringPool[ "ifassignments!description" ] = "Assignments inside an If statement often indicate that the assignment was not intended. Even if the assignment was intended, it is clearer to separate out the assignment from the conditional. The script that detects such occurrences has a few false positives when the action statements are on the same line as the conditional check. However, this is also against the coding standards and the action should be on a separate line." |
|
223 stringPool[ "ifassignments!ideTitle" ] = "assignment in an If statement" |
|
224 |
|
225 # localised string for Script ifpreprocessor |
|
226 stringPool[ "ifpreprocessor!title" ] = "Use of #if in .h files" |
|
227 stringPool[ "ifpreprocessor!description" ] = "#if in header files should only be used before the main include guards and not around #include statements or around functional blocks in class definitions. The reason for the latter is to aid readability and to make BC breaks more difficult." |
|
228 stringPool[ "ifpreprocessor!ideTitle" ] = "use of #if in .h files (not as main include guards)" |
|
229 |
|
230 # localised string for Script inheritanceorder |
|
231 stringPool[ "inheritanceorder!title" ] = "Incorrect inheritance order of M and C classes" |
|
232 stringPool[ "inheritanceorder!description" ] = "If a C class inherits first from an M class and then a C class, a panic can occur when trying to pop a CBase pointer pointing to such a class from the cleanup stack when in fact a pointer pointing to the first predecessor, the mixin class, was popped instead." |
|
233 stringPool[ "inheritanceorder!ideTitle" ] = "incorrect inheritance order of M and C classes" |
|
234 |
|
235 # localised string for Script intleaves |
|
236 stringPool[ "intleaves!title" ] = "Methods that leave AND return a TInt error" |
|
237 stringPool[ "intleaves!description" ] = "Returning an error code as well as being able to leave is problematical for the caller. It is preferable to adhere to one method of returning the error. Note: CodeScanner is likely to return false positives for this situation, because some returned TInt values will not be error codes." |
|
238 stringPool[ "intleaves!ideTitle" ] = "methods that leave AND return a TInt error" |
|
239 |
|
240 # localised string for Script jmp |
|
241 stringPool[ "jmp!title" ] = "Use of setjmp and/or longjmp" |
|
242 stringPool[ "jmp!description" ] = "Using setjmp and/or longjmp makes code less maintainable." |
|
243 stringPool[ "jmp!ideTitle" ] = "use of setjmp and/or longjmp" |
|
244 |
|
245 # localised string for Script leave |
|
246 stringPool[ "leave!title" ] = "Leaving functions called in non-leaving functions" |
|
247 stringPool[ "leave!description" ] = "Non-leaving functions should not call leaving functions. Note: Operator functions are considered to be able to leave when scanning the code inside them." |
|
248 stringPool[ "leave!ideTitle" ] = "leaving function called in non-leaving function" |
|
249 |
|
250 # localised string for Script LeaveNoError |
|
251 stringPool[ "LeaveNoError!title" ] = "Leaving with KErrNone" |
|
252 stringPool[ "LeaveNoError!description" ] = "Leaving with KErrNone usually indicates that there is a makeshift way around a design issue rather than a true and proper fix to the architecture." |
|
253 stringPool[ "LeaveNoError!ideTitle" ] = "leaving with KErrNone" |
|
254 |
|
255 # localised string for Script leavingoperators |
|
256 stringPool[ "leavingoperators!title" ] = "Leaving functions called in operator functions" |
|
257 stringPool[ "leavingoperators!description" ] = "It is not obvious that operator functions can leave. Calling leaving functions in operator functions should be considered carefully." |
|
258 stringPool[ "leavingoperators!ideTitle" ] = "leaving functions called in operator functions" |
|
259 |
|
260 # localised string for Script LFunctionCantLeave |
|
261 stringPool[ "LFunctionCantLeave!title" ] = "L-functions that cannot leave" |
|
262 stringPool[ "LFunctionCantLeave!description" ] = "A function should not be named with an 'L' if it cannot leave. The only exception is in virtual functions where the function name is defined in the base class so the L cannot be removed. For example, RunL()." |
|
263 stringPool[ "LFunctionCantLeave!ideTitle" ] = "L-functions that cannot leave" |
|
264 |
|
265 # localised string for Script longlines |
|
266 stringPool[ "longlines!title" ] = "Overly long lines of code" |
|
267 stringPool[ "longlines!description" ] = "Lines longer than about 100 characters can indicate messy or badly-structured code that is hard to maintain." |
|
268 stringPool[ "longlines!ideTitle" ] = "overly long line of code" |
|
269 |
|
270 # localised string for Script magicnumbers |
|
271 stringPool[ "magicnumbers!title" ] = "Use of magic numbers" |
|
272 stringPool[ "magicnumbers!description" ] = "Magic numbers - that is, numbers that are hard-coded into the source code and instead of being presented as constants - make code difficult to maintain and give no indication of why a calculation is the way it is. Magic numbers should be replaced with named constants." |
|
273 stringPool[ "magicnumbers!ideTitle" ] = "use of magic numbers" |
|
274 |
|
275 # localised string for Script mclassdestructor |
|
276 stringPool[ "mclassdestructor!title" ] = "M class has destructor" |
|
277 stringPool[ "mclassdestructor!description" ] = "M classes should not contain a destructor." |
|
278 stringPool[ "mclassdestructor!ideTitle" ] = "M class has destructor" |
|
279 |
|
280 # localised string for Script memberlc |
|
281 stringPool[ "memberlc!title" ] = "Assigning LC methods to member variables" |
|
282 stringPool[ "memberlc!description" ] = "Objects on the cleanup stack should not be assigned to member variables" |
|
283 stringPool[ "memberlc!ideTitle" ] = "LC method assigned to data member" |
|
284 |
|
285 # localised string for Script membervariablecallld |
|
286 stringPool[ "membervariablecallld!title" ] = "Calling LD function on member variable" |
|
287 stringPool[ "membervariablecallld!description" ] = "LD functions should not be called on a member variable because ownership can be unclear and may lead to double deletes." |
|
288 stringPool[ "membervariablecallld!ideTitle" ] = "calling LD function on member variable" |
|
289 |
|
290 # localised string for Script missingcancel |
|
291 stringPool[ "missingcancel!title" ] = "Cancel() not called in active object's destructor" |
|
292 stringPool[ "missingcancel!description" ] = "Cancel() should always be called in active object's destructor to cancel an outstanding request if there is one. If there is no request pending then Cancel() just does nothing, but if we do not call Cancel() when having an outstanding request a panic will be raised. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated." |
|
293 stringPool[ "missingcancel!ideTitle" ] = "Cancel() not called in active object's destructor" |
|
294 |
|
295 # localised string for Script missingcclass |
|
296 stringPool[ "missingcclass!title" ] = "C class not inheriting from another C class" |
|
297 stringPool[ "missingcclass!description" ] = "All C classes should inherit from another C class to ensure that all data members are zeroed." |
|
298 stringPool[ "missingcclass!ideTitle" ] = "C class not inheriting from another C class" |
|
299 |
|
300 # localised string for Script mmpsourcepath |
|
301 stringPool[ "mmpsourcepath!title" ] = "Use of absolute path names in MMP files" |
|
302 stringPool[ "mmpsourcepath!description" ] = "Use of absolute paths in MMP files makes it impossible to relocate the source. Relative paths should be used instead." |
|
303 stringPool[ "mmpsourcepath!ideTitle" ] = "use of absolute path names in MMP files" |
|
304 |
|
305 # localised string for Script multilangrsc |
|
306 stringPool[ "multilangrsc!title" ] = "Not using BaflUtils::NearestLanguageFile() when loading a resource file" |
|
307 stringPool[ "multilangrsc!description" ] = "If AddResourceFileL() is used without first using BaflUtils::NearestLanguageFile(), then not all language versions of resources will be picked up." |
|
308 stringPool[ "multilangrsc!ideTitle" ] = "not using BaflUtils::NearestLanguageFile() when loading a resource file" |
|
309 |
|
310 # localised string for Script multipledeclarations |
|
311 stringPool[ "multipledeclarations!title" ] = "Multiple declarations on one line" |
|
312 stringPool[ "multipledeclarations!description" ] = "Multiple declarations on one line can be confusing. Separate them out so that each declaration is on its own separate line." |
|
313 stringPool[ "multipledeclarations!ideTitle" ] = "multiple declarations on one line" |
|
314 |
|
315 # localised string for Script multipleinheritance |
|
316 stringPool[ "multipleinheritance!title" ] = "Non M-class multiple inheritance" |
|
317 stringPool[ "multipleinheritance!description" ] = "It is bad Symbian OS practice to derive from two classes that have implemented functions. Complex behaviour that was not intended can result." |
|
318 stringPool[ "multipleinheritance!ideTitle" ] = "multiple inheritance from non M-classes" |
|
319 |
|
320 # localised string for Script mydocs |
|
321 stringPool[ "mydocs!title" ] = "Hard-coded mydocs directory strings" |
|
322 stringPool[ "mydocs!description" ] = "The mydocs directory is subject to change so should not be referenced directly. Note: @ This issue will only occur in code developed for the Nokia Series 90 platform." |
|
323 stringPool[ "mydocs!ideTitle" ] = "hard-coded mydocs directory strings" |
|
324 |
|
325 # localised string for Script namespace |
|
326 stringPool[ "namespace!title" ] = "Use of namespace" |
|
327 stringPool[ "namespace!description" ] = "Namespaces are often used to work around a poor naming convention." |
|
328 stringPool[ "namespace!ideTitle" ] = "use of namespace" |
|
329 |
|
330 # localised string for Script newlreferences |
|
331 stringPool[ "newlreferences!title" ] = "NewL() returning a reference" |
|
332 stringPool[ "newlreferences!description" ] = "NewL() and NewLC() functions should return a pointer to an object created on the heap." |
|
333 stringPool[ "newlreferences!ideTitle" ] = "NewL() returning a reference" |
|
334 |
|
335 # localised string for Script noleavetrap |
|
336 stringPool[ "noleavetrap!title" ] = "TRAP used with no leaving functions" |
|
337 stringPool[ "noleavetrap!description" ] = "A TRAP is unnecessary if there are no leaving functions." |
|
338 stringPool[ "noleavetrap!ideTitle" ] = "TRAP contains no leaving functions" |
|
339 |
|
340 # localised string for Script nonconsthbufc |
|
341 stringPool[ "nonconsthbufc!title" ] = "Non-const HBufC* parameter passing" |
|
342 stringPool[ "nonconsthbufc!description" ] = "HBufC* parameters should almost always be passed as a const pointer." |
|
343 stringPool[ "nonconsthbufc!ideTitle" ] = "non-const HBufC* parameter passing" |
|
344 |
|
345 # localised string for Script nonconsttdesc |
|
346 stringPool[ "nonconsttdesc!title" ] = "Non-const TDesC& parameter passing" |
|
347 stringPool[ "nonconsttdesc!description" ] = "TDesC& parameters should be passed as a const. If it is not, it may indicate that the coder does not understand descriptors, for example, passing descriptors by value." |
|
348 stringPool[ "nonconsttdesc!ideTitle" ] = "non-const TDesC& parameter passing" |
|
349 |
|
350 # localised string for Script nonleavenew |
|
351 stringPool[ "nonleavenew!title" ] = "Use of new without (ELeave)" |
|
352 stringPool[ "nonleavenew!description" ] = "Using new without (ELeave) is only used in special circumstances. The leaving variant should typically be used in preference. A common exception is for application creation, where NULL is returned for failed creation." |
|
353 stringPool[ "nonleavenew!ideTitle" ] = "new used without (ELeave)" |
|
354 |
|
355 # localised string for Script nonunicodeskins |
|
356 stringPool[ "nonunicodeskins!title" ] = "Non-Unicode skins" |
|
357 stringPool[ "nonunicodeskins!description" ] = "Skin definition files (SKN, SKE) must be Unicode. Note: Code that causes this issue only needs attention if it is found in code developed for Nokia Series 90 code." |
|
358 stringPool[ "nonunicodeskins!ideTitle" ] = "non-Unicode skins" |
|
359 |
|
360 # localised string for Script null |
|
361 stringPool[ "null!title" ] = "NULL equality check" |
|
362 stringPool[ "null!description" ] = "There is no need to compare pointer variables to NULL. Use If(ptr)." |
|
363 stringPool[ "null!ideTitle" ] = "NULL equality check" |
|
364 |
|
365 # localised string for Script open |
|
366 stringPool[ "open!title" ] = "Ignoring Open() return value" |
|
367 stringPool[ "open!description" ] = "Ignoring the return value from Open() functions (due to OOM, etc.) means that when the resource is accessed next, a panic will result." |
|
368 stringPool[ "open!ideTitle" ] = "ignoring Open() return value" |
|
369 |
|
370 # localised string for Script pointertoarrays |
|
371 stringPool[ "pointertoarrays!title" ] = "Pointer to arrays as members of a C class" |
|
372 stringPool[ "pointertoarrays!description" ] = "In C classes, there is no need to use pointers to arrays as data members. Instead, use the arrays themselves. Using pointers leads to obscure notation like \"(*array)[n]\" for the more usual \"array[n]\". It also makes it necessary to explicitly delete the arrays in the destructor. Using the arrays themselves also simplifies notation, reduces indirection, and reduces heap fragmentation." |
|
373 stringPool[ "pointertoarrays!ideTitle" ] = "pointer to arrays as members of a C class" |
|
374 |
|
375 # localised string for Script pragmadisable |
|
376 stringPool[ "pragmadisable!title" ] = "Use of #pragma warning" |
|
377 stringPool[ "pragmadisable!description" ] = "Disabling warnings can lead to problems, because the warnings are probably there for a reason." |
|
378 stringPool[ "pragmadisable!ideTitle" ] = "use of #pragma warning" |
|
379 |
|
380 # localised string for Script pragmamessage |
|
381 stringPool[ "pragmamessage!title" ] = "Use of #pragma message" |
|
382 stringPool[ "pragmamessage!description" ] = "#pragma messages during the build stage can interfere with the build log parsing." |
|
383 stringPool[ "pragmamessage!ideTitle" ] = "use of #pragma message" |
|
384 |
|
385 # localised string for Script pragmaother |
|
386 stringPool[ "pragmaother!title" ] = "Use of #pragma other than warning and message" |
|
387 stringPool[ "pragmaother!description" ] = "#pragma directives should only be used in very edge cases (for example, functions consisting of inline assembler without explicit return statements) because, typically, their usage masks valid build warnings and error messages." |
|
388 stringPool[ "pragmaother!ideTitle" ] = "use of #pragma other than warning and message" |
|
389 |
|
390 # localised string for Script privateinheritance |
|
391 stringPool[ "privateinheritance!title" ] = "Use of private inheritance" |
|
392 stringPool[ "privateinheritance!description" ] = "Classes should not be inherited privately. If public or protected inheritance is not appropriate, consider using an amalgamation; that is, have an object of that type as a member variable." |
|
393 stringPool[ "privateinheritance!ideTitle" ] = "use of private inheritance" |
|
394 |
|
395 # localised string for Script pushaddrvar |
|
396 stringPool[ "pushaddrvar!title" ] = "Pushing address of a variable onto the cleanup stack" |
|
397 stringPool[ "pushaddrvar!description" ] = "If the variable is owned by the code pushing it, it should be stored as a pointer. If it is not, it should not be pushed onto the cleanup stack." |
|
398 stringPool[ "pushaddrvar!ideTitle" ] = "pushing address of a variable onto the cleanup stack" |
|
399 |
|
400 # localised string for Script pushmember |
|
401 stringPool[ "pushmember!title" ] = "Pushing data members onto the cleanup stack" |
|
402 stringPool[ "pushmember!description" ] = "Pushing member variables is likely to lead to double deletes or leakage in certain circumstances and so should be avoided. Even if no panic can result, it is bad practice and makes maintenance more difficult." |
|
403 stringPool[ "pushmember!ideTitle" ] = "data member pushed to cleanup stack" |
|
404 |
|
405 # localised string for Script readresource |
|
406 stringPool[ "readresource!title" ] = "Using ReadResource() instead of ReadResourceL()" |
|
407 stringPool[ "readresource!description" ] = "ReadResourceL() should always be used in preference to ReadResource() because in an error scenario ReadResource() effectively fails silently. If no check is performed on the resulting descriptor afterwards, unexpected states can ensue. These states are often characterized by buffer overflows." |
|
408 stringPool[ "readresource!ideTitle" ] = "Using ReadResource() instead of ReadResourceL()" |
|
409 |
|
410 # localised string for Script resourcenotoncleanupstack |
|
411 stringPool[ "resourcenotoncleanupstack!title" ] = "Neglected to put resource objects on cleanup stack" |
|
412 stringPool[ "resourcenotoncleanupstack!description" ] = "If a stack-based resource object is not put on the cleanup stack with CleanupResetAndDestroyPushL() or CleanupClosePushL(), and a leaving function or ELeave is called, a memory leak occurs. CodeScanner occasionally gives false positives for this issue. Individual cases should be investigated." |
|
413 stringPool[ "resourcenotoncleanupstack!ideTitle" ] = "neglected to put resource objects on cleanup stack" |
|
414 |
|
415 # localised string for Script resourcesonheap |
|
416 stringPool[ "resourcesonheap!title" ] = "Resource objects on the heap" |
|
417 stringPool[ "resourcesonheap!description" ] = "There is very rarely any real need to put R classes on the heap (unless they are not real R classes!). Doing so can lead to inefficiency and cleanup stack problems." |
|
418 stringPool[ "resourcesonheap!ideTitle" ] = "resource objects on the heap" |
|
419 |
|
420 # localised string for Script returndescriptoroutofscope |
|
421 stringPool[ "returndescriptoroutofscope!title" ] = "Return descriptor out of scope" |
|
422 stringPool[ "returndescriptoroutofscope!description" ] = "Returning a TBuf descriptor that is declared locally takes it out of scope. This can cause a crash on WINSCW, although not on WINS." |
|
423 stringPool[ "returndescriptoroutofscope!ideTitle" ] = "return descriptor out of scope" |
|
424 |
|
425 # localised string for Script rfs |
|
426 stringPool[ "rfs!title" ] = "Use of non-pointer/reference RFs" |
|
427 stringPool[ "rfs!description" ] = "Connecting to an RFs is a time-consuming operation. (It can take approximately 0.1 seconds on some devices.) To minimise wasted time and resources, use the already-connected one in EikonEnv or elsewhere, if possible." |
|
428 stringPool[ "rfs!ideTitle" ] = "use of non-pointer/reference RFs" |
|
429 |
|
430 # localised string for Script rssnames |
|
431 stringPool[ "rssnames!title" ] = "Duplicate RSS names" |
|
432 stringPool[ "rssnames!description" ] = "Resource files with clashing NAME fields can cause the wrong resource file to be accessed. This can lead to incorrect functionality or panics." |
|
433 stringPool[ "rssnames!ideTitle" ] = "duplicate RSS names" |
|
434 |
|
435 # localised string for Script stringliterals |
|
436 stringPool[ "stringliterals!title" ] = "Use of _L string literals" |
|
437 stringPool[ "stringliterals!description" ] = "_L() string literals should be replaced by the _LIT() macro." |
|
438 stringPool[ "stringliterals!ideTitle" ] = "use of _L string literals" |
|
439 |
|
440 # localised string for Script stringsinresourcefiles |
|
441 stringPool[ "stringsinresourcefiles!title" ] = "Strings in RSS or RA files" |
|
442 stringPool[ "stringsinresourcefiles!description" ] = "Strings should not be defined in RSS or RA files. Instead, they should be put in RLS or other localisable files." |
|
443 stringPool[ "stringsinresourcefiles!ideTitle" ] = "strings in RSS or RA files" |
|
444 |
|
445 # localised string for Script struct |
|
446 stringPool[ "struct!title" ] = "Use of struct" |
|
447 stringPool[ "struct!description" ] = "C-style structs should not generally be used. The correct idiom is to use a class with public members. A permissible use of a C-style struct is if it is used to group non-semantically related entities together for convenience, and if a class-related hierarchy would be too heavy-weight." |
|
448 stringPool[ "struct!ideTitle" ] = "use of struct" |
|
449 |
|
450 # localised string for Script tcclasses |
|
451 stringPool[ "tcclasses!title" ] = "T classes inheriting from C classes" |
|
452 stringPool[ "tcclasses!description" ] = "T classes that are derived from C classes may have a complex constructor and so need to be handled differently. It is better to make the T class into a C class, which will make the code easier to maintain." |
|
453 stringPool[ "tcclasses!ideTitle" ] = "T class inherits from C class" |
|
454 |
|
455 # localised string for Script tclassdestructor |
|
456 stringPool[ "tclassdestructor!title" ] = "T class has destructor" |
|
457 stringPool[ "tclassdestructor!description" ] = "T classes should not have a destructor" |
|
458 stringPool[ "tclassdestructor!ideTitle" ] = "T class has destructor" |
|
459 |
|
460 # localised string for Script todocomments |
|
461 stringPool[ "todocomments!title" ] = "\"To do\" comments" |
|
462 stringPool[ "todocomments!description" ] = "\"To do\" comments in code suggest that it is not finished." |
|
463 stringPool[ "todocomments!ideTitle" ] = "\"To do\" comment" |
|
464 |
|
465 # localised string for Script trapcleanup |
|
466 stringPool[ "trapcleanup!title" ] = "Use of LC function in TRAPs" |
|
467 stringPool[ "trapcleanup!description" ] = "You cannot trap something that leaves something on the cleanup stack because it will panic." |
|
468 stringPool[ "trapcleanup!ideTitle" ] = "LC function used in TRAP" |
|
469 |
|
470 # localised string for Script trapeleave |
|
471 stringPool[ "trapeleave!title" ] = "Trapping new(ELeave)" |
|
472 stringPool[ "trapeleave!description" ] = "The trapping of a \"new(ELeave) CXxx\" call is redundant and wasteful as the code to support TRAP is surprisingly large. If the instantiation process really needs not to leave, use \"new CXxx\" and check for NULL." |
|
473 stringPool[ "trapeleave!ideTitle" ] = "trapping new(ELeave)" |
|
474 |
|
475 # localised string for Script traprunl |
|
476 stringPool[ "traprunl!title" ] = "Trapping of (Do)RunL() rather than using RunError()" |
|
477 stringPool[ "traprunl!description" ] = "The RunError() function should be used rather than the CActive derivative using its own TRAPD solution within a RunL()." |
|
478 stringPool[ "traprunl!ideTitle" ] = "trapping of (Do)RunL() rather than using RunError()" |
|
479 |
|
480 # localised string for Script trspassing |
|
481 stringPool[ "trspassing!title" ] = "Passing TRequestStatus parameters by value" |
|
482 stringPool[ "trspassing!description" ] = "TRequestStatus parameters should be passed by reference. If TRequestStatus is just being used as an error code, then convert it to a TInt." |
|
483 stringPool[ "trspassing!ideTitle" ] = "passing TRequestStatus parameters by value" |
|
484 |
|
485 # localised string for Script uids |
|
486 stringPool[ "uids!title" ] = "Duplicate UIDs" |
|
487 stringPool[ "uids!description" ] = "UIDs must be unique." |
|
488 stringPool[ "uids!ideTitle" ] = "duplicate UIDs" |
|
489 |
|
490 # localised string for Script uncompressedaif |
|
491 stringPool[ "uncompressedaif!title" ] = "Uncompressed AIFs in ROM" |
|
492 stringPool[ "uncompressedaif!description" ] = "AIF files should be referenced as \"AIF=\" rather than \"data=\" or \"file=\" otherwise they can bloat the ROM size and slow down application loading." |
|
493 stringPool[ "uncompressedaif!ideTitle" ] = "uncompressed AIFs in ROM" |
|
494 |
|
495 # localised string for Script uncompressedbmp |
|
496 stringPool[ "uncompressedbmp!title" ] = "Uncompressed bitmaps in ROM" |
|
497 stringPool[ "uncompressedbmp!description" ] = "Using uncompressed bitmaps can significantly bloat the size of ROM images. All occurrences of \"bitmap=\" in iby/hby files should be replaced with \"auto-bitmap=\". Also, including bitmaps using \"data=\" or \"file=\" causes bloat and load-speed reductions." |
|
498 stringPool[ "uncompressedbmp!ideTitle" ] = "uncompressed bitmaps in ROM" |
|
499 |
|
500 # localised string for Script unicodesource |
|
501 stringPool[ "unicodesource!title" ] = "Unicode source files" |
|
502 stringPool[ "unicodesource!description" ] = "Having Unicode source files (CPP, H, RLS, LOC, RSS, and RA) will break most build systems." |
|
503 stringPool[ "unicodesource!ideTitle" ] = "Unicode source files" |
|
504 |
|
505 # localised string for Script userafter |
|
506 stringPool[ "userafter!title" ] = "Use of User::After" |
|
507 stringPool[ "userafter!description" ] = "Generally, User::After() functions are used to skirt around timing problems. Typically, they should be removed and the defects fixed properly: that is, by waiting for the correct event to continue execution." |
|
508 stringPool[ "userafter!ideTitle" ] = "use of User::After" |
|
509 |
|
510 # localised string for Script userfree |
|
511 stringPool[ "userfree!title" ] = "Using User::Free directly" |
|
512 stringPool[ "userfree!description" ] = "User::Free() should never be called, because all objects free their memory on deletion; their destructors are not called and further resources cannot be freed or closed. This function should be removed and replaced by explicit deletes." |
|
513 stringPool[ "userfree!ideTitle" ] = "using User::Free directly" |
|
514 |
|
515 # localised string for Script userWaitForRequest |
|
516 stringPool[ "userWaitForRequest!title" ] = "Use of User::WaitForRequest" |
|
517 stringPool[ "userWaitForRequest!description" ] = "User::WaitForRequest() should not generally be used in UI code because the UI will not respond to redraw events while its thread is stopped." |
|
518 stringPool[ "userWaitForRequest!ideTitle" ] = "use of User::WaitForRequest" |
|
519 |
|
520 # localised string for Script variablenames |
|
521 stringPool[ "variablenames!title" ] = "Local variables with member/argument names" |
|
522 stringPool[ "variablenames!description" ] = "Local variable names should be of the form localVariable and not aLocalVar or iLocalVar. Badly-named variables can be misleading and cause maintenance and coding errors." |
|
523 stringPool[ "variablenames!ideTitle" ] = "local variables with member/argument names" |
|
524 |
|
525 # localised string for Script voidparameter |
|
526 stringPool[ "voidparameter!title" ] = "Void parameter explicitly declared" |
|
527 stringPool[ "voidparameter!description" ] = "Declaring a void parameter is unnecessary. A function declared as DoSomething(void) may as well be declared as DoSomething(). Void casts are also unnecessary." |
|
528 stringPool[ "voidparameter!ideTitle" ] = "void parameter explicitly declared" |
|
529 |
|
530 # localised string for Script worryingcomments |
|
531 stringPool[ "worryingcomments!title" ] = "Worrying comments" |
|
532 stringPool[ "worryingcomments!description" ] = "Typically, exclamation and question marks in comments indicate that something odd is in the code or that it is unfinished or not understood fully." |
|
533 stringPool[ "worryingcomments!ideTitle" ] = "worrying comments" |
|
534 |