|
1 | 1 | function value = check_settings(name) |
| 2 | +%CHECK_SETTINGS returns settings vor CHECK. |
| 3 | +% CHECK_SETTINGS(NAME) returns the VALUE of the settings called NAME. |
| 4 | +% |
| 5 | +% Create a local copy of this file and overwrite values if you want |
| 6 | +% custom behavior in a specific project. |
| 7 | + |
| 8 | + % thresholds for the number of lines in classes: |
2 | 9 | settings.lo_class_num_lines = 200; |
3 | 10 | settings.hi_class_num_lines = 400; |
| 11 | + % thresholds for the number of properties in classes: |
4 | 12 | settings.lo_class_num_properties = 10; |
5 | 13 | settings.hi_class_num_properties = 15; |
| 14 | + % thresholds for the number of methods in classes: |
6 | 15 | settings.lo_class_num_methods = 10; |
7 | 16 | settings.hi_class_num_methods = 20; |
8 | 17 |
|
| 18 | + % thresholds for the number of lines in scripts: |
9 | 19 | settings.lo_script_num_lines = 100; |
10 | 20 | settings.hi_script_num_lines = 200; |
| 21 | + % thresholds for the number of variables in scripts: |
11 | 22 | settings.lo_script_num_variables = 10; |
12 | 23 | settings.hi_script_num_variables = 20; |
| 24 | + % thresholds for the level of indentation in scripts: |
13 | 25 | settings.lo_script_max_indentation = 4; |
14 | 26 | settings.hi_script_max_indentation = 8; |
15 | 27 |
|
| 28 | + % thresholds for the number of lines in functions: |
16 | 29 | settings.lo_function_num_lines = 50; |
17 | 30 | settings.hi_function_num_lines = 100; |
| 31 | + % thresholds for the number of arguments in functions: |
18 | 32 | settings.lo_function_num_arguments = 3; |
19 | 33 | settings.hi_function_num_arguments = 5; |
| 34 | + % thresholds for the number of variables in functions: |
20 | 35 | settings.lo_function_num_variables = 7; |
21 | 36 | settings.hi_function_num_variables = 15; |
| 37 | + % thresholds for the level of indentation in functions: |
22 | 38 | settings.lo_function_max_indentation = 3; |
23 | 39 | settings.hi_function_max_indentation = 6; |
| 40 | + % thresholds for the complexity of functions: |
24 | 41 | settings.lo_function_complexity = 10; |
25 | 42 | settings.hi_function_complexity = 15; |
26 | 43 |
|
| 44 | + % thresholds for the line length of files: |
27 | 45 | settings.lo_line_length = 75; |
28 | 46 | settings.hi_line_length = 90; |
29 | 47 |
|
| 48 | + % threshold for the variable length and spread (spread is the |
| 49 | + % number of lines in which a variable is used). |
| 50 | + % Read this as "if a variable name is less than 3 characters |
| 51 | + % long, it should be use in no more than 3 lines": |
30 | 52 | settings.lo_varname_short_length = 3; |
31 | 53 | settings.lo_varname_short_spread = 3; |
32 | 54 | settings.lo_varname_long_length = 5; |
|
36 | 58 | settings.hi_varname_long_length = 5; |
37 | 59 | settings.hi_varname_long_spread = 15; |
38 | 60 |
|
| 61 | + % switches to switch whole modules on or off: |
39 | 62 | settings.do_check_comments = true; |
40 | 63 | settings.do_check_documentation = true; |
41 | 64 | settings.do_check_eval = true; |
|
45 | 68 | settings.do_check_line_length = true; |
46 | 69 | settings.do_check_indentation = true; |
47 | 70 |
|
| 71 | + % indent by this many spaces per level of indentation: |
48 | 72 | settings.indentation_step = 4; |
| 73 | + % Matlab does not indent top-level function bodies. Most other |
| 74 | + % languages would think this behavior funny: |
49 | 75 | settings.indentation_check_like_matlab = true; |
50 | 76 |
|
51 | 77 | value = settings.(name); |
|
0 commit comments