Code review rules: Problem list
Functionality problems concern the users of your software. This is where it really pays off to scan your application with Project Analyzer's problem detection feature. When you fix these issues before finishing your project the users will find your program working better than what it would've been without the fixes.
Most of the functionality problems are related to user interface issues, error trapping and event handling.
Stop/End statement found. Your program ends here. Check if you really want to end your program like this. It may be completely as you planned, though, and if you think everything is OK, leave it as is. END, STOP
Error handler missing. A procedure has no error handler. Your program may crash if a run-time error occurs in this procedure. You can ignore this problem in procedures with less than or equal to x lines of code. Write x in the "Ignore when" textbox in Problem Options. Sub/Function and End Sub/Function lines are counted as code, making an empty procedure or property block have 2 lines. Leave the box empty if you don't wish to have a limit. NO_ERROR_HANDLER
Delayed error handler. A procedure uses delayed error handling (On Error Resume Next, Try without Catch). Run-time errors are handled in the procedure(s) that call this one. This may be completely as you planned, or you may have forgotten to add an error handler (On Error Goto, or Catch in a Try..End Try block). You can ignore this problem in procedures with less than or equal to x lines of code. Write x in the "Ignore when" textbox in Problem Options. Sub and End Sub lines are counted as code, making an empty procedure or property block have 2 lines. Leave the box empty for no limit. DELAYED_ERROR_HANDLER
Consider using Aivosto VB Watch, a tool that ensures proper error handling.Error event missing. Every Data control should have the Error event implemented. If you don't do it, Visual Basic only displays a simple error message. It is also important to use an error handler inside the Error event, because if a new error occurs, the Error event fires again. This problem is available for VB 3-6. NO_ERROR
Click event missing. A CommandButton or menu item does not do anything when clicked. This problem is available for VB 3-6. NO_CLICK
Timer event missing. A Timer does not fire an event at defined intervals. This problem is available for VB 3-6. NO_TIMER
Timer interval below 55 ms. The interrupt interval of a Timer control is shorter than 55 ms. Shorter intervals are not supported by VB. This problem is available for VB 3-6. TIMER_INTERVAL
Events not handled. An object variable is declared WithEvents. However, none of the events are handled. NO_EVENTS
Assignment to self. An assignment statement seems to set the value of a variable or property to itself without modification. Example: x = x. This is most probably an error. The assignment is either unnecessary or it is incorrect and should be fixed. ASSIGNMENT_TO_SELF
Form missing Icon. A Form doesn't have an icon that is required. A default icon, generated by VB, will be shown. This problem is available for VB 3-6. NO_ICON
Form missing HelpContextID. Your program uses context-sensitive help (F1), but a Form was found that has no HelpContextID set. This problem is available for VB 3-6. NO_HELPCONTEXTID
Default button missing. A dialog box has CommandButtons but none of them is marked Default. When the user hits Enter, none of the buttons handle it as a Click event. This problem is available for VB 3-6. BUTTONS
Cancel button missing. A dialog box has CommandButtons but none of them is marked Cancel. When the user hits Esc, none of the buttons handle it as a Click event. This problem is available for VB 3-6. BUTTONS
Resizable Form missing Form_Resize. The Form_Resize event is missing from a Form that users can resize at run-time. Your application may look odd if you don't respond to Resize events. This problem is available for VB 3-6. NO_RESIZE
Hotkey conflict. Two or more controls or menu items share a hotkey. For example, there are options &Save and &Search in the same menu. This problem is available for VB 3-6. HOTKEY_CONFLICT, HOTKEYS
Hotkey missing. A control or menu item is missing a hotkey. Checked controls: CommandButton, CheckBox, OptionButton, Frame, Menu. This problem is available for VB 3-6. NO_HOTKEY, HOTKEYS
Possibly twisted tab order. The tab order of some controls on a form looks questionable. Take a look at the TabIndex properties of the mentioned controls. The best way to do this is to open the form in VB, select the first control and press the Tab key repeatedly. Generally, the focus should move either right or down. Labels with an access key (& in the caption) should precede the control next to them. A container control should precede any child controls placed within it. An back jump is allowed to move the focus from the bottom of the form to the top-left corner. If the form's RightToLeft property is True, Project Analyzer uses a mirrored rule to require moves either left or down. The twisted tab order detection rules are not foolproof. In some cases, a twisted-looking tab order might be all right. Forms that hide, show or move their controls at run-time are exceptional in that their design-time layout is different from the run-time layout. In that case, this rule may produce a false warning and you should ignore it. This problem is available for VB 3-6. TABORDER
DLL procedure related problems are available if DLL analysis has been enabled (Enterprise Edition only).
The comment directive parameter for the rules on this page is FUNC.
Problem detection
Code review rules: Problem list
©Aivosto Oy - Project Analyzer Help Contents