[[Property:title|CA011 - Too many arguments]]
[[Property:link_title|CA011]]
[[Property:weight|0]]
[[Property:uuid|d25e2dc7-7a95-c13a-bfa2-ceb42a084fa6]]
__NOTOC__
=Description=
A feature that has too many arguments should be avoided since it makes the class interface complicated and is not easy to use. The feature arguments may include options, which should be considered to be moved to separate features.
:{| class="doctable"
|-
| '''Scope'''
| feature
|-
| '''Status'''
| Enabled
|-
| '''Severity'''
| Warning
|-
| '''Applicability'''
| All
|-
| '''Score'''
| 50
|-
| '''Arguments threashold'''
| 4
|}
=Example of violation=
my_document.print (printer_name, paper_size, postscript_level, print_resolution)
=Recommendation=
Detect arguments that are really options and create procedures to set them.
In the example, one could write:
my_document.set_paper_size (paper_size)
my_document.set_postscript_level (postscript_level)
my_document.set_print_resolution (print_resolution)
my_document.print (printer_name)