StevenLooman / magik-tools

Sonar Magik plugin
GNU General Public License v3.0
18 stars 10 forks source link

Add the possibility to show the default values for parameters #135

Closed sebastiaanspeck closed 1 week ago

sebastiaanspeck commented 2 weeks ago

Also improved the formatting a little:

Before:

- unused-variable (Variable is unused)
        unused-variable.check-parameters:       true (Check for unused parameters)

After:

- unused-variable (Variable is unused)
  * check-parameters: true (Check for unused parameters)

Adding --with-default-values to --show-checks, generates the next output:

Enabled checks:
- commented-code (Remove commented code)
  * (default) min-lines: 3 (Minimum number of commented lines)
- duplicate-method-in-file (Duplicate method definition in file)
- empty-block (Block is empty and can be removed)
- exemplar-slot-count (Exemplar has too many slots)
  * (default) max-slot-count: 10 (Maximum number of slots for an exemplar)
- file-method-count (File has too many methods defined)
  * (default) max-method-count: 10 (Maximum number of methods in file)
- file-not-in-load-list (File is not included in load_list)
- forbidden-call (Forbidden call)
  * (default) forbidden-calls (List of forbidden calls, separated by ','):
    - show()
    - sw:show()
    - print()
    - sw:print()
    - debug_print()
    - sw:debug_print()
    - .sys!perform()
    - .sys!slot()
- forbidden-global-usage (Forbidden usage of global)
  * (default) forbidden-globals (List of forbidden globals, separated by ','):
    - !current_grs!
    - sw:!current_grs!
- forbidden-inheritance (Forbidden inheritance)
  * (default) forbidden-parents:  (Forbidden parents to inhertit from, separated by ',')
- formatting (Improper formatting)
  * (default) indent-character: tab (The character used for indentation (tab/space))
  * (default) tab-width: 8 (The width of a tab character)
- hides-variable (Variable definition hides another variable with the same name.)
- import-missing-definition (Import missing definition)
- lhs-rhs-comparator-equal (Left hand side and right hand side of comparison are the same)
- line-length (Lines should not be too long)
  * (default) max-line-length: 120 (Maximum number of characters on a single line)
  * (default) tab-width: 8 (The width of a tab character)
- local-import-procedure (Possibly meant _import instead of _local)
- method-complexity (Methods should not be too complex)
  * (default) max-complexity: 10 (Maximum complexity of method by the McCabe definition)
- method-line-count (Method/procedure is too long)
  * (default) max-length: 35 (Maximum length of method in lines without white lines and comment lines)
- nesting-depth (Methods/procedures/if-statements/loop-statements should not exceed the maximum nesting depth)
  * (default) max-nesting-depth: 3 (Maximum nesting depth)
  * (default) count-early-return-as-nesting-depth: true (Count early return as nesting depth)
- no-self-use (No usage of _self)
- no-statement-after-body-exit (No statement after body exit)
- parameter-count (Methods/procedures should not have too many parameters)
  * (default) max-parameter-count: 6 (Maximum number of parameters for a method or procedure)
- scope-count (Too many variables in scope)
  * (default) max-scope-count: 25 (Maximum number of entries in scope)
- simplify-if (If statement can be simplified)
- size-zero-empty (Use .empty? instead of .size = 0)
- sw-method-doc (Method is missing documentation in Smallworld style)
  * (default) allow-blank-method-doc: false (Allow blank method doc)
- syntax-error (Syntax error)
- todo-comment (TODO comment)
  * (default) forbidden-comment-words (List of forbidden words, separated by ',', case sensitive):
    - TODO
    - FIXME
    - HACK
    - NOTE
    - TEMP
    - XXX
- trailing-whitespace (Remove the trailing whitespace)
- type-doc (Method is missing documentation)
- undefined-variable (Prefixed variable used as a global)
- unsafe-evaluate-invocation (Use of unsafe_evaluate())
- unused-variable (Variable is unused)
  * check-parameters: true (Check for unused parameters)
- use-value-compare (Compare strings and bignums with the equality-operators)
- variable-count (Method/procedure contains too many variables)
  * (default) max-variable-count: 8 (Maximum number of variables in method)
- variable-declaration-usage-distance (Distance between variable definition and usage)
  * (default) max-distance: 5 (Maximum distance between declaration and usage)
  * (default) ignore-constants: true (Ignore declared constants)
- variable-naming (Give variables a proper descriptive name)
  * (default) max-length: 32 (Maximum number of characters for a variable name)
  * (default) min-length: 3 (Minimum number of characters for a variable name)
  * (default) whitelist:  (Whitelist (comma separated) of variable names to allow/ignore.)
- warned-call (Warned call)
  * (default) warned-calls (List of Warned calls, separated by ','):
    - write()
    - sw:write()
    - remex()
    - sw:remex()
    - remove_exemplar()
    - sw:remove_exemplar()
Disabled checks: