Sign in Join
Wiki copytemporary

IDE Window: Code Explorer Options: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-<img src="IDE-options-code-explorer.JPG" title="Code Explorer Options" width="400" alt="Code Explorer Options" /> The dialog is explained here: [[IDE Window: Code Explorer]]
1+![Code Explorer Options](/wiki-images/c/c4/IDE-options-code-explorer.JPG) The dialog is explained here: [[IDE Window: Code Explorer]]
22
33## Update
44
55Preferred Exhibition Mode
66
77- Category - sort all declarations into categories like constants, variables, types, procedures, ...
88- Source - show all declarations as they are in the source
99
1010Refresh automatically
1111
1212- Never, only manually - only when pressing the Refresh button
1313- When switching file in source editor - when switching to another unit
1414- On idle - whenever the user does not type or move the mouse
1515
1616## Categories
1717
1818Shows the available categories. Check all that you want to see in the code explorer.
1919
2020The category **Code Observer** exists since 0.9.27 and lists uncommon or hard to read code fragments. You can set the details in the next option page.
2121
2222## Code Observer
2323
2424Complexity
2525
2626- Long procedures\
2727 Lists all procedures with more lines of code than in the edit field to the right. Long procedures are hard to read by others. Use the [[IDE Window: Extract Procedure|Extract Procedure]] tool to split it into several procedures.
2828- Many parameters\
2929 Lists all procedures with more parameters than in the edit field to the right.
3030- Many nested procedures\
3131 Lists all procedures with more nested sub procedures than in the edit field to the right.
3232
3333Empty constructs
3434
3535- Empty procedures\
3636 Lists all procedures without code. They can contain comments and directives. The code below will be listed under linux.
3737
3838``` pascal
3939begin
4040 {$IFDEF win32}write;{$ENDIF}
4141end;
4242```
4343
4444- Empty blocks\
4545 Lists all empty blocks, like begin..end and repeat..until. Blocks containing comments are not listed. Empty blocks can be endless loops or forgotten to clean up.
4646- Empty class sections\
4747 Lists all empty class sections like *private*, *public*, *protected*.
4848
4949Style
5050
5151- Unnamed Constants\
5252 Lists all literal constants in statements, that means constants that have no name. You can define in the text fields below what should not be listed.
5353- Unsorted visibility\
5454 Lists all class sections, that are not sorted. For example if a private section comes behind a public section.
5555- Unsorted members\
5656 Lists all class variables, methods and properties that are not sorted alphabetically.
5757
5858Other
5959
6060- Wrong indentation\
6161 Lists all places with suspicious indentation. For example: In the next example the *then* statement was accidentally deleted:
6262
6363``` pascal
6464for i:=0 to 10 do
6565 if i=0 then
6666writeln('');
6767```
6868
6969- Published properties without default\
7070 Lists all properties without a default value. For example:
7171
7272``` pascal
7373published
7474 property Flag: booolean read FFlag write SetFlag;
7575```
7676
7777Since FPC 2.2.4 such properties are treated as if they have the *nodefault* specifier. That means they are always saved to the lfm.
7878
7979- ToDos\
8080 Lists alls ToDos. See the [[IDE Window: ToDo List|ToDo list]].
8181
8282Ignore next unnamed constants
8383
8484These constants will not be listed in the unnamed category. Examples:
8585
8686``` pascal
87870
88881
8989'a'
9090'abc'
9191#3
9292#$3
9393```
9494
9595Ignore constants in next functions
9696
9797Constants passed as parameters to the following functions will not be listed in the unnamed category. There are two types. For example:
9898
9999``` pascal
100100Write
101101.ParamByName
102102```
103103
104104Note the point in front of ParamByName.
105105
106106Result:
107107
108108``` pascal
109109Write('A'); // 'A' will be ignored
110110MemStream.Write('A'); // 'A' will be listed
111111DataModule1.SQLQuery1.Params.ParamByName('ART_ID').AsString; // will be ignored
112112ParamByName('ART_ID').AsString; // will be listed
113113```
114114
115115---
116116*From the Free Pascal wiki, page "IDE Window: Code Explorer Options", as it stood on 2020-07-13 after a change by Arent, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history